There is a maintenance of MPCDF Gitlab on Thursday, April 22st 2020, 9:00 am CEST - Expect some service interruptions during this time

dl_poly.py 6.5 KB
Newer Older
Markus Scheidgen's avatar
Markus Scheidgen committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
import numpy as np            # pylint: disable=unused-import
import typing                 # pylint: disable=unused-import
from nomad.metainfo import (  # pylint: disable=unused-import
    MSection, MCategory, Category, Package, Quantity, Section, SubSection, SectionProxy,
    Reference
)
from nomad.metainfo.legacy import LegacyDefinition

from nomad.datamodel.metainfo import public

m_package = Package(
    name='dl_poly_nomadmetainfo_json',
    description='None',
    a_legacy=LegacyDefinition(name='dl_poly.nomadmetainfo.json'))


class x_dl_poly_section_md_molecule_type(MSection):
    '''
    Section to store molecule type information
    '''

    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='x_dl_poly_section_md_molecule_type'))

    x_dl_poly_md_molecule_type_id = Quantity(
        type=np.dtype(np.int32),
        shape=[],
        description='''
        Molecule type id
        ''',
        a_legacy=LegacyDefinition(name='x_dl_poly_md_molecule_type_id'))

    x_dl_poly_md_molecule_type_name = Quantity(
        type=str,
        shape=[],
        description='''
        Molecule type name
        ''',
        a_legacy=LegacyDefinition(name='x_dl_poly_md_molecule_type_name'))


class x_dl_poly_section_md_topology(MSection):
    '''
    Section modelling the MD topology
    '''

    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='x_dl_poly_section_md_topology'))

    x_dl_poly_md_molecular_types = Quantity(
        type=np.dtype(np.int32),
        shape=[],
        description='''
        Number of molecular types in topology
        ''',
        a_legacy=LegacyDefinition(name='x_dl_poly_md_molecular_types'))

    x_dl_poly_section_md_molecule_type = SubSection(
        sub_section=SectionProxy('x_dl_poly_section_md_molecule_type'),
        repeats=True,
        a_legacy=LegacyDefinition(name='x_dl_poly_section_md_molecule_type'))


class section_sampling_method(public.section_sampling_method):

    m_def = Section(validate=False, extends_base_section=True, a_legacy=LegacyDefinition(name='section_sampling_method'))

    x_dl_poly_barostat_target_pressure = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        unit='pascal',
        description='''
        MD barostat target pressure.
        ''',
        categories=[public.settings_molecular_dynamics, public.settings_barostat, public.settings_sampling],
        a_legacy=LegacyDefinition(name='x_dl_poly_barostat_target_pressure'))

    x_dl_poly_barostat_tau = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        unit='second',
        description='''
        MD barostat relaxation time.
        ''',
        categories=[public.settings_molecular_dynamics, public.settings_barostat, public.settings_sampling],
        a_legacy=LegacyDefinition(name='x_dl_poly_barostat_tau'))

    x_dl_poly_integrator_dt = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        unit='second',
        description='''
        MD integration time step.
        ''',
        categories=[public.settings_molecular_dynamics, public.settings_integrator, public.settings_sampling],
        a_legacy=LegacyDefinition(name='x_dl_poly_integrator_dt'))

    x_dl_poly_integrator_type = Quantity(
        type=str,
        shape=[],
        description='''
        MD integrator type, valid values are defined in the integrator_type wiki page.
        ''',
        categories=[public.settings_molecular_dynamics, public.settings_integrator, public.settings_sampling],
        a_legacy=LegacyDefinition(name='x_dl_poly_integrator_type'))

    x_dl_poly_number_of_steps_requested = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        description='''
        Number of requested MD integration time steps.
        ''',
        categories=[public.settings_molecular_dynamics, public.settings_integrator, public.settings_sampling],
        a_legacy=LegacyDefinition(name='x_dl_poly_number_of_steps_requested'))

    x_dl_poly_thermostat_target_temperature = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        unit='kelvin',
        description='''
        MD thermostat target temperature.
        ''',
        categories=[public.settings_molecular_dynamics, public.settings_thermostat, public.settings_sampling],
        a_legacy=LegacyDefinition(name='x_dl_poly_thermostat_target_temperature'))

    x_dl_poly_thermostat_tau = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        unit='second',
        description='''
        MD thermostat relaxation time.
        ''',
        categories=[public.settings_molecular_dynamics, public.settings_thermostat, public.settings_sampling],
        a_legacy=LegacyDefinition(name='x_dl_poly_thermostat_tau'))


class section_run(public.section_run):

    m_def = Section(validate=False, extends_base_section=True, a_legacy=LegacyDefinition(name='section_run'))

    x_dl_poly_program_version_date = Quantity(
        type=str,
        shape=[],
        description='''
        Program version date
        ''',
        a_legacy=LegacyDefinition(name='x_dl_poly_program_version_date'))

    x_dl_poly_system_description = Quantity(
        type=str,
        shape=[],
        description='''
        Simulation run title
        ''',
        a_legacy=LegacyDefinition(name='x_dl_poly_system_description'))


class section_system(public.section_system):

    m_def = Section(validate=False, extends_base_section=True, a_legacy=LegacyDefinition(name='section_system'))

    x_dl_poly_section_md_topology = SubSection(
        sub_section=SectionProxy('x_dl_poly_section_md_topology'),
        repeats=True,
        a_legacy=LegacyDefinition(name='x_dl_poly_section_md_topology'))


class section_method(public.section_method):

    m_def = Section(validate=False, extends_base_section=True, a_legacy=LegacyDefinition(name='section_method'))

    x_dl_poly_step_number_equilibration = Quantity(
        type=np.dtype(np.int32),
        shape=[],
        description='''
        MD equilibration step number
        ''',
        a_legacy=LegacyDefinition(name='x_dl_poly_step_number_equilibration'))

    x_dl_poly_step_number = Quantity(
        type=np.dtype(np.int32),
        shape=[],
        description='''
        MD total step number
        ''',
        a_legacy=LegacyDefinition(name='x_dl_poly_step_number'))

    x_dl_poly_thermostat_temperature = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        description='''
        Thermostat coupling temperature
        ''',
        a_legacy=LegacyDefinition(name='x_dl_poly_thermostat_temperature'))


m_package.__init_metainfo__()