Skip to content

Commit

Permalink
Added a seperate bulk setting for surface energy calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
Aini Palizhati committed Jun 7, 2019
1 parent ef294ad commit 6f45a09
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
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

0 comments on commit 6f45a09

Please sign in to comment.