mythos.simulators.lammps.lammps_oxdna

LAMMPS-based OxDNA simulator for mythos.

Attributes

REPLACEMENT_MAP

REPLACEMENT_MAP

LAMMPS_REQUIRED_FIELDS

Classes

LAMMPSoxDNASimulator

LAMMPS-based OxDNA simulator.

Functions

_lammps_oxdna_replace_inputs(→ list[str])

_replace_parts_in_line(→ str)

_transform_param(→ float)

_transform_lammps_state(→ numpy.ndarray)

_transform_lammps_quat(→ numpy.ndarray)

_read_lammps_output(→ mythos.input.trajectory.Trajectory)

Reads LAMMPS trajectory dump file and extracts the final energy values.

Module Contents

class mythos.simulators.lammps.lammps_oxdna.LAMMPSoxDNASimulator[source]

Bases: mythos.simulators.base.InputDirSimulator

LAMMPS-based OxDNA simulator.

Please note that for LAMMPS simulations of oxDNA, BondedExcludedVolume should be left out of the energy function, as LAMMPS does not implement it (or does not in a compatible way).

Parameters:
  • input_dir – Path to the directory containing the LAMMPS input files.

  • overwrite – Whether to overwrite the input directory or copy to a temporary directory.

  • input_file_name – Name of the LAMMPS input file (default “input”).

  • energy_fn – Energy function used in the simulation, for updating parameters.

  • variables – Additional variables to set in the LAMMPS input file before run. These variables must already be defined in the input file using a command of the form “variable name equal value”.

  • temperature_variable – Name of the LAMMPS variable that holds the simulation temperature in reduced units (kT). When the corresponding variable is set, it is used to populate the temperature field of the output trajectory.

energy_fn: mythos.energy.base.EnergyFunction
input_file_name: str = 'input'
variables: dict[str, Any]
temperature_variable: str = 'kt'
__post_init__() None[source]
run_simulation(input_dir: pathlib.Path, params: mythos.utils.types.Params, seed: int | None = None) mythos.simulators.base.SimulatorOutput[source]

Run the simulation in the given input directory.

_replace_parameters(input_dir: pathlib.Path, params: mythos.utils.types.Params, seed: int | None) None[source]
mythos.simulators.lammps.lammps_oxdna._lammps_oxdna_replace_inputs(input_lines: list[str], params: list[dict[str, float]], seed: int | None, variables: dict[str, Any] | None = None) list[str][source]
mythos.simulators.lammps.lammps_oxdna._replace_parts_in_line(inputs: str, replacements: tuple[str], params: dict[str, float]) str[source]
mythos.simulators.lammps.lammps_oxdna.REPLACEMENT_MAP
mythos.simulators.lammps.lammps_oxdna.REPLACEMENT_MAP
mythos.simulators.lammps.lammps_oxdna._transform_param(param: str, value: float) float[source]
mythos.simulators.lammps.lammps_oxdna.LAMMPS_REQUIRED_FIELDS
mythos.simulators.lammps.lammps_oxdna._transform_lammps_state(state: numpy.ndarray, fields: str) numpy.ndarray[source]
mythos.simulators.lammps.lammps_oxdna._transform_lammps_quat(quat: numpy.ndarray) numpy.ndarray[source]
mythos.simulators.lammps.lammps_oxdna._read_lammps_output(output_file: pathlib.Path) mythos.input.trajectory.Trajectory[source]

Reads LAMMPS trajectory dump file and extracts the final energy values.

The file must have been created by a dump LAMMPS dump command similar to:

compute quat all property/atom quatw quati quatj quatk dump {name} all custom {freq} trajectory.dat x y z vx vy vz &

c_quat[1] c_quat[2] c_quat[3] c_quat[4] angmomx angmomy angmomz

noting that the above fields are required, but other fields may also be present in the dump.

Parameters:

output_file – Path to the LAMMPS trajectory dump file.

Returns:

A Trajectory object in mythos format.