Skip to content

Commit

Permalink
reorg energy and force structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jrudz committed Jun 27, 2024
1 parent 08aacca commit bf7da80
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 604 deletions.
20 changes: 20 additions & 0 deletions src/nomad_simulations/schema_packages/physical_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from nomad import utils
from nomad.datamodel.data import ArchiveSection
from nomad.datamodel.metainfo.basesections import Entity
from nomad.datamodel.metainfo.annotations import ELNAnnotation
from nomad.metainfo import (
URL,
MEnum,
Expand All @@ -41,6 +42,7 @@

from nomad_simulations.schema_packages.numerical_settings import SelfConsistency
from nomad_simulations.schema_packages.variables import Variables
from nomad_simulations.schema_packages.model_method import ModelMethod

# We add `logger` for the `validate_quantity_wrt_value` decorator
logger = utils.get_logger(__name__)
Expand Down Expand Up @@ -324,3 +326,21 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:

# Resolve if the physical property `is_derived` or not from another physical property.
self.is_derived = self._is_derived()

class PropertyContribution(PhysicalProperty):
"""
Abstract physical property section linking a property contribution to a contribution
from some method.
"""
model_method_ref = Quantity(
type=ModelMethod,
description="""
Reference to the `ModelMethod` section to which the property is linked to.
""",
a_eln=ELNAnnotation(component='ReferenceEditQuantity'),
)

def normalize(self, archive, logger) -> None:
super().normalize(archive, logger)
if not self.name:
self.name = self.get('model_method_ref').get('name')
3 changes: 1 addition & 2 deletions src/nomad_simulations/schema_packages/properties/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
from .band_structure import ElectronicBandStructure, ElectronicEigenvalues
from .energies import (
FermiLevel,
ChemicalPotential,
TotalEnergy,
Energy,
ClassicalEnergy,
QuantumEnergy,
)
from .forces import TotalForce, Force
from .thermodynamics import Temperature
from .thermodynamics import Temperature, ChemicalPotential
from .fermi_surface import FermiSurface
from .hopping_matrix import CrystalFieldSplitting, HoppingMatrix
from .permittivity import Permittivity
Expand Down
Loading

0 comments on commit bf7da80

Please sign in to comment.