diff --git a/src/nomad_simulations/outputs_JFR_temp.py b/src/nomad_simulations/outputs_JFR_temp.py index 0c22067f..0fd8bd74 100644 --- a/src/nomad_simulations/outputs_JFR_temp.py +++ b/src/nomad_simulations/outputs_JFR_temp.py @@ -69,6 +69,15 @@ from .model_system import ModelSystem +class ScalarProperty(BaseProperty): + """ + Generic section containing the values and information for any scalar property. + """ + + def normalize(self, archive, logger) -> None: + super().normalize(archive, logger) + + # TODO check that all variable and bin quantities are None class AtomicProperty(BaseProperty): """ @@ -172,8 +181,6 @@ class EnergyEntry(Atomic): Section describing a type of energy or a contribution to the total energy. """ - m_def = Section(validate=False) - reference = Quantity( type=np.dtype(np.float64), shape=[], @@ -260,13 +267,11 @@ class EnergyEntry(Atomic): ) -class Energy(MSection): +class Energy(ArchiveSection): """ Section containing all energy types and contributions. """ - m_def = Section(validate=False) - total = SubSection( sub_section=EnergyEntry.m_def, categories=[FastAccess], @@ -580,7 +585,6 @@ class Energy(MSection): """, ) - class ForcesEntry(Atomic): """ Section describing a contribution to or type of atomic forces. @@ -996,23 +1000,34 @@ class MultipolesEntry(Atomic): orbital_projected = SubSection(sub_section=MultipolesValues.m_def, repeats=True) -# TODO remove this section -class Thermodynamics(MSection): +class Enthalpy(ScalarProperty): """ - Section containing results related to a thermodynamics calculation. + Section containing the enthalpy (i.e. energy_total + pressure * volume.) of a (sub)system. """ - m_def = Section(validate=False) + value = Quantity( + type=np.float64, + unit='joule', + ) - enthalpy = Quantity( - type=np.dtype(np.float64), - shape=[], + def normalize(self, archive, logger) -> None: + super().normalize(archive, logger) + self.value_unit = 'joule' + +class Entropy(ScalarProperty): + """ + Section containing the entropy of a (sub)system. + """ + + value = Quantity( + type=np.float64, unit='joule', - description=""" - Value of the calculated enthalpy per cell i.e. energy_total + pressure * volume. - """, ) + def normalize(self, archive, logger) -> None: + super().normalize(archive, logger) + self.value_unit = 'joule' + entropy = Quantity( type=np.dtype(np.float64), shape=[], diff --git a/src/nomad_simulations/property.py b/src/nomad_simulations/property.py index 2ac9df7f..e0ec8b17 100644 --- a/src/nomad_simulations/property.py +++ b/src/nomad_simulations/property.py @@ -191,6 +191,8 @@ def __init__(self, *args, **kwargs): """, ) + # TODO Add value_per_particle? + system_ref = Quantity( type=Reference(ModelSystem.m_def), shape=[1],