AtomProperty

class narupatools.lammps.atom_properties.AtomProperty(key: str, datatype: narupatools.lammps._constants.VariableType, components: int)

Definition of an atom property defined by LAMMPS.

These definitions can be found in atom.cpp in the LAMMPS src/ folder.

Inheritance

Inheritance diagram of AtomProperty

Methods

__init__

Initialize self.

define

Define an atom property used by LAMMPS.

extract

Extract the value of the property from a LAMMPS wrapper.

__init__(key: str, datatype: narupatools.lammps._constants.VariableType, components: int)None

Initialize self. See help(type(self)) for accurate signature.

classmethod define(key: str, datatype: Literal[lammps.LAMMPS_INT, lammps.LAMMPS_INT_2D], components: int)narupatools.lammps.atom_properties.AtomProperty[numpy.ndarray[Any, numpy.dtype[numpy.int64]]]
classmethod define(key: str, datatype: Literal[lammps.LAMMPS_DOUBLE, lammps.LAMMPS_DOUBLE_2D], components: int)narupatools.lammps.atom_properties.AtomProperty[numpy.ndarray[Any, numpy.dtype[numpy.float64]]]

Define an atom property used by LAMMPS.

This property can be used with the gather_atoms function to collect the property for all atoms, ordered by their atom ID.

Calling this should only be necessary if a new custom property has been implemented in LAMMPS, as all the default properties are already defined in narupatools.lammps.atom_properties

Parameters
  • key – Key used to identify property in LAMMPS, such as ‘x’ or ‘f’.

  • datatype – The type of the returned value, either a floating point number or an integer.

  • components – The number of components in this property. Normally ‘1’ for scalar values such as charge, and ‘3’ for vector values such as position.

Returns

An AtomProperty that can be used with LAMMPSSimulation.gather_atoms().

extract(lammps: narupatools.lammps._wrapper.LAMMPSWrapper)_TReturnType

Extract the value of the property from a LAMMPS wrapper.