-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjustments to the protocols/generator for
Fleur
code (#265)
* Delete 'serial' key from default SCF wf parameters The interface has changed, the default is False, so it is not needed. In general for flexibility we might have to change some of the other queue parameters through, since over the common workflow the default scf cannot be changed. * Ignore `kpoints_distance` input if a `kpt` specification comes from the parameters of the reference workchain * Turn off writing of atom ids in get_parameters * Adjust protocols, parse the protocol to inpgen, use fleur protocols * Fix that protocol name was not given to inpgen * Decouple protocol name in common workflows with profile/protocol used in the inpgen of fleur * Add oxides_validation protocol * Add oxides_validation protocol also to the FleurCommonRelaxInputGenerator * Fix wrong name of gamma option in fleur protocol * Make sure that the gamma option is set for all relax workchains not just for the reference workchain * Fix for last commit * Add oxides_validation to valid type for the protocol input * Incorporate Gregor's changes * Add remote_folder output to FleurCommonRelaxWorkChain * Move valid protocols to fleur workchain * Add `verification-pbe-v1` protocol * Add missing description * Update aiida-fleur dependency to make sure the common workflows have everything they need * Add extractor for TS contribution for FleurCommonRelaxWorkChain * Add fallback solution for extracting the TS contribution directly from the out.xml For calculations that do not already extract this information in the main fleur parser Co-authored-by: Jens Bröder <j.broeder@fz-juelich.de> Co-authored-by: Jens Broeder <broeder-j@users.noreply.github.com>
- Loading branch information
1 parent
2fd47d0
commit ac214b1
Showing
5 changed files
with
128 additions
and
19 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
aiida_common_workflows/workflows/relax/fleur/extractors.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Collects some functions to postprocess a `FleurCommonRelaxWorkChain`. | ||
""" | ||
|
||
|
||
def get_ts_energy(common_relax_workchain): | ||
""" | ||
Return the TS value of a concluded FleurCommonRelaxWorkChain. | ||
T the fictitious temperature due to the presence of a smearing and S is | ||
the entropy. The units must be eV. | ||
In Fleur this contribution is directly available in the output parameters | ||
of the Fleur calculation | ||
""" | ||
from aiida.common import LinkType | ||
from aiida.orm import WorkChainNode | ||
from aiida.plugins import WorkflowFactory | ||
from masci_tools.io.io_fleurxml import load_outxml | ||
from masci_tools.util.constants import HTR_TO_EV | ||
from masci_tools.util.schema_dict_util import evaluate_attribute | ||
|
||
if not isinstance(common_relax_workchain, WorkChainNode): | ||
return ValueError('The input is not a workchain (instance of `WorkChainNode`)') | ||
if common_relax_workchain.process_class != WorkflowFactory('common_workflows.relax.fleur'): | ||
return ValueError('The input workchain is not a `FleurCommonRelaxWorkChain`') | ||
|
||
fleur_relax_wc = common_relax_workchain.get_outgoing(link_type=LinkType.CALL_WORK).one().node | ||
fleur_calc_out = fleur_relax_wc.outputs.last_scf.last_calc | ||
|
||
output_parameters = fleur_calc_out.output_parameters | ||
ts = None #pylint: disable=invalid-name | ||
if 'ts_energy' in output_parameters.keys(): | ||
ts = output_parameters['ts_energy'] #pylint: disable=invalid-name | ||
elif fleur_relax_wc.is_finished_ok: | ||
#This check makes sure that the parsing worked before so we don't get | ||
#nasty surprises in load_outxml | ||
|
||
with fleur_calc_out.retrieved.open('out.xml', 'rb') as file: | ||
xmltree, schema_dict = load_outxml(file) | ||
try: | ||
ts_all = evaluate_attribute( | ||
xmltree, schema_dict, 'value', tag_name='tkbtimesentropy', iteration_path=True, list_return=True | ||
) | ||
except ValueError: | ||
pass | ||
else: | ||
if ts_all: | ||
ts = ts_all[-1] * HTR_TO_EV #pylint: disable=invalid-name | ||
|
||
return ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters