Skip to content

Commit

Permalink
added MDOutputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jrudz committed Apr 9, 2024
1 parent caf7a0b commit 76166fb
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 24 deletions.
57 changes: 57 additions & 0 deletions src/nomad_simulations/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,60 @@ class SCFOutputs(Outputs):

def normalize(self, archive, logger) -> None:
super().normalize(archive, logger)

# Set if the output property `is_converged` or not.
self.is_scf_converged = self.check_is_scf_converged(
self.is_scf_converged, logger
)

class MDOutputs(Outputs):
"""
This section contains the self-consistent (SCF) steps performed to converge an output property,
as well as the information if the output property `is_converged` or not, depending on the
settings in the `SelfConsistency` base class defined in `numerical_settings.py`.
For simplicity, we contain the SCF steps of a simulation as part of the minimal workflow defined in NOMAD,
the `SinglePoint`, i.e., we do not split each SCF step in its own entry. Thus, each `SinglePoint`
`Simulation` entry in NOMAD contains the final output properties and all the SCF steps.
"""

step = Quantity(
type=np.int32,
description="""
Number of self-consistent steps to converge the output property. Note that the SCF steps belong to
the same minimal `Simulation` workflow entry which is known as `SinglePoint`.
""",
)

time = Quantity(
type=np.int32,
description="""
Number of self-consistent steps to converge the output property. Note that the SCF steps belong to
the same minimal `Simulation` workflow entry which is known as `SinglePoint`.
""",
)

scf_step = SubSection(
sub_section=Outputs.m_def,
repeats=True,
description="""
Self-consistent (SCF) steps performed for converging a given output property. Note that the SCF steps belong to
the same minimal `Simulation` workflow entry which is known as `SinglePoint`.
""",
)

ff_ref = Quantity(
type=SelfConsistency,
description="""
Reference to the `SelfConsistency` section that defines the numerical settings to converge the
output property.
""",
)

md_ref = Quantity(
type=SelfConsistency,
description="""
Reference to the `SelfConsistency` section that defines the numerical settings to converge the
output property.
""",
)
49 changes: 25 additions & 24 deletions src/nomad_simulations/outputs_JFR_temp.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from nomad.metainfo.metainfo import DirectQuantity, Dimension
from nomad.datamodel.metainfo.annotations import ELNAnnotation

from .outputs import Outputs
from .outputs import MDOutputs
from .property import BaseProperty
from .atoms_state import AtomsState

Expand Down Expand Up @@ -1000,7 +1000,7 @@ class MultipolesEntry(Atomic):
orbital_projected = SubSection(sub_section=MultipolesValues.m_def, repeats=True)


class Enthalpy(ScalarProperty):
class Enthalpy(MDOutputs, ScalarProperty):
"""
Section containing the enthalpy (i.e. energy_total + pressure * volume.) of a (sub)system.
"""
Expand All @@ -1021,40 +1021,41 @@ class Entropy(ScalarProperty):

value = Quantity(
type=np.float64,
unit='joule',
unit='joule / kelvin',
)

def normalize(self, archive, logger) -> None:
super().normalize(archive, logger)
self.value_unit = 'joule'
self.value_unit = 'joule / kelvin'

entropy = Quantity(
type=np.dtype(np.float64),
shape=[],
unit='joule / kelvin',
description="""
Value of the entropy.
""",
)
class ChemicalPotential(ScalarProperty):
"""
Section containing the chemical potential of a (sub)system.
"""

chemical_potential = Quantity(
type=np.dtype(np.float64),
shape=[],
value = Quantity(
type=np.float64,
unit='joule',
description="""
Value of the chemical potential.
""",
)

kinetic_energy = Quantity(
type=np.dtype(np.float64),
shape=[],
def normalize(self, archive, logger) -> None:
super().normalize(archive, logger)
self.value_unit = 'joule'

class KineticEnergy(ScalarProperty):
"""
Section containing the kinetic energy of a (sub)system.
"""

value = Quantity(
type=np.float64,
unit='joule',
description="""
Value of the kinetic energy.
""",
)

def normalize(self, archive, logger) -> None:
super().normalize(archive, logger)
self.value_unit = 'joule'

potential_energy = Quantity(
type=np.dtype(np.float64),
shape=[],
Expand Down

0 comments on commit 76166fb

Please sign in to comment.