LAMMPSInteraction¶
-
class
narupatools.lammps.dynamics.LAMMPSInteraction(*, dynamics: _TDynamics, key: str, interaction: narupa.imd.particle_interaction.ParticleInteraction, start_time: float)¶ IMD Interaction applied to a LAMMPS simulation.
Inheritance

Methods
Create a new interaction.
Get the positions of the affected particles for this interaction, in nanometers.
Perform any tasks necessary after a dynamics step.
Perform any tasks necessary before a dynamics step.
Calculate the forces and energy of this interaction.
-
__init__(*, dynamics: _TDynamics, key: str, interaction: narupa.imd.particle_interaction.ParticleInteraction, start_time: float)¶ Create a new interaction.
- Parameters
dynamics – Underlying dynamics this interaction is affecting.
key – Unique key to identify this interaction.
interaction – Initial parameters of the interaction.
start_time – Start time of interaction in simulation time in picoseconds
-
get_positions() → numpy.ndarray[Any, numpy.dtype[numpy.float64]]¶ Get the positions of the affected particles for this interaction, in nanometers.
These are needed to calculate work.
- Returns
Array of positions for the particles affected by this interaction.
-
update_energy_and_forces() → Tuple[numpy.ndarray[Any, numpy.dtype[numpy.float64]], float]¶ Calculate the forces and energy of this interaction.
Overriding this allows a subclass to implement features such as caching.
- Returns
Tuple of forces (in kilojoules per mole per nanometer) and energy (in kilojoules per mole).
Attributes
Forces that will be applied by the interaction.
Current parameters of the interaction.
List of indices affected by this interaction.
Potential energy of the interaction, in kilojoules per mole.
Start time of the interaction in picoseconds.
Total work performed by interaction in kilojoules per mole.
Work performed last step in kilojoules per mole.
-
forces¶ Forces that will be applied by the interaction.
The forces are in kilojoules per mole per nanometer.
This is a (N, 3) NumPy array, where N is the number of particles affected by this interaction.
-
interaction¶ Current parameters of the interaction.
-
particle_indices¶ List of indices affected by this interaction.
-
potential_energy¶ Potential energy of the interaction, in kilojoules per mole.
-
start_time¶ Start time of the interaction in picoseconds.
-
total_work¶ Total work performed by interaction in kilojoules per mole.
-
work_last_step¶ Work performed last step in kilojoules per mole.
-