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

Inheritance diagram of LAMMPSInteraction

Methods

__init__

Create a new interaction.

get_positions

Get the positions of the affected particles for this interaction, in nanometers.

on_post_step

Perform any tasks necessary after a dynamics step.

on_pre_step

Perform any tasks necessary before a dynamics step.

update_energy_and_forces

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.

on_post_step()None

Perform any tasks necessary after a dynamics step.

on_pre_step()None

Perform any tasks necessary before a dynamics step.

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

Forces that will be applied by the 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.

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.