Skip to content

Commit

Permalink
Correct the fermi energy output. The bands output of fleur is shifted…
Browse files Browse the repository at this point in the history
… to ef=0.0
  • Loading branch information
janssenhenning committed Apr 7, 2022
1 parent 392fae6 commit ca56a39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 2 additions & 0 deletions aiida_common_workflows/workflows/bands/fleur/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def _construct_builder(self, **kwargs) -> engine.ProcessBuilder:
raise ValueError('The `parent_folder` has not been created by a FleurCalculation')
builder_parent = parent_folder.creator.get_builder_restart()

#Transfer inputs from the parent calculation
builder = self.process_class.get_builder()
builder.options = orm.Dict(dict=builder_parent.metadata.options)
builder.fleur = builder_parent.code
Expand All @@ -48,6 +49,7 @@ def _construct_builder(self, **kwargs) -> engine.ProcessBuilder:
builder.kpoints = bands_kpoints
builder.remote = parent_folder

#Add inputs from engines if given
if engines:
try:
band_engines = engines['bands']
Expand Down
9 changes: 2 additions & 7 deletions aiida_common_workflows/workflows/bands/fleur/workchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
__all__ = ('FleurCommonBandsWorkChain',)


@calcfunction
def get_fermi_energy(pardict):
"""Extract the Fermi energy from the `output_parameters` dictionary"""
return Float(pardict['fermi_energy_scf'])


class FleurCommonBandsWorkChain(CommonBandsWorkChain):
"""Implementation of `aiida_common_workflows.common.bands.workchain.CommonBandsWorkChain` for Fleur."""

Expand All @@ -29,6 +23,7 @@ def convert_outputs(self):
self.report('FleurBandDOSWorkChain concluded without returning bands!')
return self.exit_codes.ERROR_SUB_PROCESS_FAILED

self.out('fermi_energy', get_fermi_energy(self.ctx.workchain.outputs.output_banddos_wc_para))
#The bands output of fleur is shifted to have the fermi energy at zero
self.out('fermi_energy', Float(0.0))

self.out('bands', self.ctx.workchain.outputs['output_banddos_wc_bands'])

0 comments on commit ca56a39

Please sign in to comment.