Skip to content

Commit

Permalink
write ys_cohesive_energy_per_atom
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Aug 21, 2024
1 parent 142c137 commit eea144c
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/aiida_sssp_workflow/workflows/convergence/cohesive_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,29 +189,33 @@ def compute_xy(

reference_node = orm.load_node(report.reference.uuid)
output_parameters_r: orm.Dict = reference_node.outputs.output_parameters
y_ref = output_parameters_r["cohesive_energy_per_atom"]
y_ref = output_parameters_r['cohesive_energy_per_atom']

xs = []
ys = []
ys_cohesive_energy_per_atom = []
for node_point in report.convergence_list:
if node_point.exit_status != 0:
# TODO: log to a warning file for where the node is not finished_okay
continue

x = node_point.wavefunction_cutoff
xs.append(x)

node = orm.load_node(node_point.uuid)
output_parameters_p: orm.Dict = node.outputs.output_parameters

y = (output_parameters_p["cohesive_energy_per_atom"] - y_ref) / y_ref * 100
y = (output_parameters_p['cohesive_energy_per_atom'] - y_ref) / y_ref * 100
ys.append(y)
ys_cohesive_energy_per_atom.append(output_parameters_p['cohesive_energy_per_atom'])

return {
"xs": xs,
"ys": ys,
"ys_relative_diff": ys,
"metadata": {
"unit": "%",
},
'xs': xs,
'ys': ys,
'ys_relative_diff': ys,
'ys_cohesive_energy_per_atom': ys_cohesive_energy_per_atom,
'metadata': {
'unit': '%',
}
}

0 comments on commit eea144c

Please sign in to comment.