Skip to content
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

Added a separate bulk_settings() for surface energy calculations #80

Merged
merged 1 commit into from
Jun 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions gaspy/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,24 @@ def bulk_settings():
**xc_settings()))
return bulk_settings

def SE_bulk_settings():
'''
The default settings we use to do DFT calculations of bulks
spefically for surface energy calculations.
'''
SE_bulk_settings = OrderedDict(max_atoms=80,
vasp=OrderedDict(ibrion=1,
nsw=100,
isif=7,
isym=0,
ediff=1e-8,
kpts=(10, 10, 10),
prec='Accurate',
encut=500.,
pp_version=pp_version(),
**xc_settings('pbesol')))
return SE_bulk_settings


def slab_settings():
'''
Expand Down
3 changes: 2 additions & 1 deletion gaspy/tasks/metadata_calculators.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
GASDB_PATH = utils.read_rc('gasdb_path')
GAS_SETTINGS = defaults.gas_settings()
BULK_SETTINGS = defaults.bulk_settings()
SE_BULK_SETTINGS = defaults.SE_bulk_settings()
SLAB_SETTINGS = defaults.slab_settings()
ADSLAB_SETTINGS = defaults.adslab_settings()

Expand Down Expand Up @@ -273,7 +274,7 @@ class CalculateSurfaceEnergy(luigi.Task):
slab_generator_settings = luigi.DictParameter(SLAB_SETTINGS['slab_generator_settings'])
get_slab_settings = luigi.DictParameter(SLAB_SETTINGS['get_slab_settings'])
vasp_settings = luigi.DictParameter(SLAB_SETTINGS['vasp'])
bulk_vasp_settings = luigi.DictParameter(BULK_SETTINGS['vasp'])
bulk_vasp_settings = luigi.DictParameter(SE_BULK_SETTINGS['vasp'])

def _static_requires(self):
'''
Expand Down
4 changes: 3 additions & 1 deletion gaspy/tests/tasks_tests/metadata_calculators_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from ...tasks.calculation_finders import FindBulk, FindSurface

GAS_SETTINGS = defaults.gas_settings()

SE_BULK_SETTINGS = defaults.SE_bulk_settings()

def test_CalculateAdsorptionEnergy():
'''
Expand Down Expand Up @@ -150,7 +150,9 @@ def test__static_requires(self):
it and doesn't do some of the other steps (i.e., assign attributes)
'''
mpid = 'mp-1018129'
bulk_vasp_settings = SE_BULK_SETTINGS['vasp']
task = CalculateSurfaceEnergy(mpid=mpid, miller_indices=(0, 0, 1), shift=0.081)
assert unfreeze_dict(task.bulk_vasp_settings) == bulk_vasp_settings
bulk_task = task._static_requires()
assert isinstance(bulk_task, FindBulk)
assert bulk_task.mpid == mpid
Expand Down