-
Notifications
You must be signed in to change notification settings - Fork 182
update: add a new option of absolute volume in /dpgen/dpgen/auto_test/EOS.py #741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
c0e8a31
efc9654
5e5a7dc
dde101e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
A new parameter "vol_abs" is added. If you want to use absolute volume to get EOS, you can add | ||
|
||
"vol_abs": true, | ||
|
||
in the "eos" part of property.json | ||
if it's not mentioned, "False" is set defaultly | ||
when you are using absolute volume, there will be a notation in the last line of output during "make" process, which is like | ||
|
||
treat vol_start and vol_end as absolute volume |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ def __init__(self, | |
self.vol_start = parameter['vol_start'] | ||
self.vol_end = parameter['vol_end'] | ||
self.vol_step = parameter['vol_step'] | ||
parameter['vol_abs'] = parameter.get('vol_abs', False) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you mean the other parts in this file, indeed I don't think they are ok. Here |
||
self.vol_abs = parameter['vol_abs'] | ||
parameter['cal_type'] = parameter.get('cal_type', 'relaxation') | ||
self.cal_type = parameter['cal_type'] | ||
default_cal_setting = {"relax_pos": True, | ||
|
@@ -117,6 +119,10 @@ def make_confs(self, | |
|
||
else: | ||
print('gen eos from ' + str(self.vol_start) + ' to ' + str(self.vol_end) + ' by every ' + str(self.vol_step)) | ||
if self.vol_abs : | ||
print('treat vol_start and vol_end as absolute volume') | ||
njzjz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
else : | ||
print('treat vol_start and vol_end as relative volume') | ||
equi_contcar = os.path.join(path_to_equi, 'CONTCAR') | ||
if not os.path.exists(equi_contcar): | ||
raise RuntimeError("please do relaxation first") | ||
|
@@ -138,8 +144,13 @@ def make_confs(self, | |
task_list.append(output_task) | ||
os.symlink(os.path.relpath(equi_contcar), 'POSCAR.orig') | ||
# scale = (vol / vol_to_poscar) ** (1. / 3.) | ||
scale = vol ** (1. / 3.) | ||
eos_params = {'volume': vol * vol_to_poscar, 'scale': scale} | ||
|
||
if self.vol_abs : | ||
scale = (vol / vol_to_poscar) ** (1. / 3.) | ||
eos_params = {'volume': vol, 'scale': scale} | ||
else : | ||
scale = vol ** (1. / 3.) | ||
eos_params = {'volume': vol * vol_to_poscar, 'scale': scale} | ||
dumpfn(eos_params, 'eos.json', indent=4) | ||
self.parameter['scale2equi'].append(scale) # 06/22 | ||
vasp.poscar_scale('POSCAR.orig', 'POSCAR', scale) | ||
|
Uh oh!
There was an error while loading. Please reload this page.