Commit e2c42ccc authored by Alvin Noe Ladines's avatar Alvin Noe Ladines
Browse files

Added calculations_ref to Relaxation metainfo

parent bdd9a67b
Pipeline #81470 passed with stages
in 11 minutes and 1 second
......@@ -5627,8 +5627,7 @@ class Relaxation(MSection):
description='''
The maximum net force in the last relaxation step.
''',
a_legacy=LegacyDefinition(name='final_force_maximum')
)
a_legacy=LegacyDefinition(name='final_force_maximum'))
final_calculation_ref = Quantity(
type=Reference(SectionProxy('section_single_configuration_calculation')),
......@@ -5638,6 +5637,23 @@ class Relaxation(MSection):
''',
a_legacy=LegacyDefinition(name='final_calculation_ref'))
n_relaxation_steps = Quantity(
type=int,
shape=[],
description='''
Number of relaxation steps.
''',
a_legacy=LegacyDefinition(name='n_relaxation_steps'))
calculations_ref = Quantity(
type=Reference(SectionProxy('section_single_configuration_calculation')),
shape=['n_relaxation_steps'],
description='''
List of references to each section_single_configuration_calculation corresponding
to each step in the relaxation.
''',
a_legacy=LegacyDefinition(name='calculations_ref'))
class Phonon(MSection):
'''
......
......@@ -73,11 +73,17 @@ class RelaxationNormalizer(Normalizer):
if not self.section.relaxation_type:
self.section.relaxation_type = self._get_relaxation_type()
scc = self.section_run.section_single_configuration_calculation
if not self.section.final_calculation_ref:
scc = self.section_run.section_single_configuration_calculation
if scc:
self.section.final_calculation_ref = scc[-1]
if not self.section.n_relaxation_steps:
self.section.n_relaxation_steps = len(scc)
if not self.section.calculations_ref:
self.section.calculations_ref = scc
if not self.section.final_energy_difference:
energies = []
for scc in self.section_run.section_single_configuration_calculation:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment