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

Implement CommonBandsWorkChain for CASTEP #258

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix the handling of soft elements
Only apply a minimum cut off if cut off energy is not explicitly
set already.
  • Loading branch information
zhubonan committed Mar 12, 2022
commit ecc443244449a49953f29442f12c9111b51e36e0
16 changes: 9 additions & 7 deletions aiida_common_workflows/workflows/relax/castep/generator.py
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ def define(cls, spec):
super().define(spec)
spec.input(
'protocol',
valid_type=ChoiceType(('fast', 'moderate', 'precise', 'oxide_validation')),
valid_type=ChoiceType(('fast', 'moderate', 'precise', 'verification-PBE-v1')),
default='moderate',
help='The protocol to use for the automated input generation. This value indicates the level of precision '
'of the results and computational cost that the input parameters will be selected for.',
@@ -80,7 +80,7 @@ def _construct_builder(self, **kwargs) -> engine.ProcessBuilder:

# Because the subsequent generators may modify this dictionary and convert things
# to AiiDA types, here we make a full copy of the original protocol
protocol = copy.deepcopy(self.get_protocol(protocol))
protocol = copy.deepcopy(self._protocols[protocol])
code = engines['relax']['code']

override = {'base': {'calc': {'metadata': {'options': engines['relax']['options']}}}}
@@ -168,11 +168,13 @@ def _construct_builder(self, **kwargs) -> engine.ProcessBuilder:
# Raise the cut off energy for very soft pseudopotentials
# this is because the small basis set will give rise to errors in EOS / variable volume
# relaxation even with the "fine" option
with open(str(pathlib.Path(__file__).parent / 'soft_elements.yml')) as fhandle:
soft_elements = yaml.safe_load(fhandle)
symbols = [kind.symbol for kind in structure.kinds]
if all(sym in soft_elements for sym in symbols):
param['cut_off_energy'] = 326 # eV, approximately 12 Ha
if 'cut_off_energy' not in param:
with open(str(pathlib.Path(__file__).parent / 'soft_elements.yml')) as fhandle:
soft_elements = yaml.safe_load(fhandle)
symbols = [kind.symbol for kind in structure.kinds]
if all(sym in soft_elements for sym in symbols):
param['cut_off_energy'] = 326 # eV, approximately 12 Ha
param.pop('basis_precision', None)

# Apply the overrides
if param: