-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
663 additions
and
12 deletions.
There are no files selected for viewing
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,59 @@ | ||
--- | ||
standard: | ||
name: acwf | ||
description: Delta measure parameters compatible with AiiDA common workflow | ||
|
||
occupations: smearing | ||
degauss: 0.0045 | ||
smearing: fd | ||
conv_thr_per_atom: 1.0e-9 | ||
kpoints_distance: 0.06 | ||
mixing_beta: 0.4 | ||
|
||
dense: | ||
name: dense | ||
description: dense to reproduce deniele results | ||
|
||
occupations: smearing | ||
degauss: 0.005 | ||
smearing: cold | ||
conv_thr_per_atom: 1.0e-9 | ||
kpoints_distance: 0.08 | ||
mixing_beta: 0.4 | ||
|
||
balanced: | ||
name: balanced | ||
description: The balanced protocol from Gabriel | ||
|
||
occupations: smearing | ||
degauss: 0.02 | ||
smearing: fd | ||
conv_thr_per_atom: 1.0e-8 | ||
kpoints_distance: 0.2 | ||
mixing_beta: 0.4 | ||
|
||
test: | ||
name: test-only | ||
description: light loose set for test | ||
|
||
occupations: smearing | ||
degauss: 0.0045 | ||
smearing: fd | ||
conv_thr_per_atom: 1.0e-6 | ||
kpoints_distance: 0.5 | ||
mixing_beta: 0.4 | ||
scale_count: 5 | ||
scale_increment: 0.02 | ||
|
||
opsp: | ||
name: opsp | ||
description: For OPSP verifications | ||
|
||
occupations: smearing | ||
degauss: 0.0045 | ||
smearing: fd | ||
conv_thr_per_atom: 1.0e-8 | ||
kpoints_distance: 0.06 | ||
mixing_beta: 0.4 | ||
scale_count: 5 | ||
scale_increment: 0.03 |
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
90 changes: 90 additions & 0 deletions
90
src/aiida_sssp_workflow/workflows/evaluate/_magnetization.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,90 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
A calcfunctian create_isolate_atom | ||
Create the structure of isolate atom | ||
""" | ||
|
||
from aiida import orm | ||
from aiida.engine import ToContext, calcfunction | ||
from aiida.plugins import DataFactory, WorkflowFactory | ||
|
||
from . import _BaseEvaluateWorkChain | ||
|
||
PwBaseWorkChain = WorkflowFactory("quantumespresso.pw.base") | ||
UpfData = DataFactory("pseudo.upf") | ||
|
||
|
||
@calcfunction | ||
def helper_get_magnetization(output_parameters): | ||
""" | ||
doc | ||
""" | ||
return orm.Dict( | ||
dict={ | ||
"total_magnetization_units": output_parameters["total_magnetization_units"], | ||
"total_magnetization": output_parameters["total_magnetization"], | ||
} | ||
) | ||
|
||
|
||
class MagnetizationWorkChain(_BaseEvaluateWorkChain): | ||
"""WorkChain to calculate magnetization of input structure""" | ||
|
||
@classmethod | ||
def define(cls, spec): | ||
"""Define the process specification.""" | ||
# yapf: disable | ||
super().define(spec) | ||
spec.input('structure', valid_type=orm.StructureData, | ||
help='Ground state structure which the verification perform') | ||
spec.input_namespace('pseudos', valid_type=UpfData, dynamic=True, | ||
help='A mapping of `UpfData` nodes onto the kind name to which they should apply.') | ||
spec.expose_inputs(PwBaseWorkChain, exclude=["pw.structure", "pw.pseudos"]) | ||
|
||
spec.outline( | ||
cls.run_scf, | ||
cls.inspect_scf, | ||
cls.finalize, | ||
) | ||
spec.output('output_parameters', valid_type=orm.Dict, required=True, | ||
help='The output parameters include pressure of the structure.') | ||
|
||
# yapf: enable | ||
|
||
def run_scf(self): | ||
""" | ||
set the inputs and submit scf | ||
""" | ||
inputs = self.exposed_inputs(PwBaseWorkChain) | ||
inputs["pw"]["structure"] = self.inputs.structure | ||
inputs["pw"]["pseudos"] = self.inputs.pseudos | ||
|
||
running = self.submit(PwBaseWorkChain, **inputs) | ||
self.report(f"Running pw scf calculation pk={running.pk}") | ||
|
||
return ToContext(workchain_scf=running) | ||
|
||
def inspect_scf(self): | ||
"""inspect the result of scf calculation.""" | ||
workchain = self.ctx.workchain_scf | ||
|
||
if workchain.is_finished: | ||
self._disable_cache(workchain) | ||
|
||
if not workchain.is_finished_ok: | ||
self.report( | ||
f"PwBaseWorkChain for pressure evaluation failed with exit status {workchain.exit_status}" | ||
) | ||
return self.exit_codes.ERROR_SUB_PROCESS_FAILED_SCF | ||
|
||
output_parameters = workchain.outputs.output_parameters | ||
|
||
# Return the output parameters of current workchain | ||
output_parameters = helper_get_magnetization( | ||
output_parameters | ||
) | ||
|
||
self.out("output_parameters", output_parameters) | ||
|
||
def finalize(self): | ||
"""set ecutwfc and ecutrho""" |
Empty file.
Oops, something went wrong.