facade

Module containing an abstract base class for MD engine facades

class MDMC.MD.engine_facades.facade.MDEngine[source]

Abstract base class for MD engine facades

abstract convert_trajectory(start: int = 0, stop: int = None, step: int = 1, **settings: dict) MDMC.trajectory_analysis.compact_trajectory.CompactTrajectory[source]

Parses the trajectory from the MDEngine format into MDMC format

Parameters
  • start (int) – The index of the first trajectory, inclusive.

  • stop (int) – The index of the last trajectory, exclusive.

  • step (int) – The step size between trajectories.

  • **settings

    scaled_positions (bool)

    If the trajectory_file has scaled positions

    atom_IDs (list)

    LAMMPS ID of the atoms which should be included. If not passed then all atoms are included in the converted trajectory.

Returns

The CompactTrajectory from the most recent production simulation

Return type

CompactTrajectory

abstract minimize(n_steps: int, minimize_every: int = 10, **settings: dict) None[source]

Minimizes the simulation energy

Parameters
  • n_steps (int) – Maximum number of MD steps during the energy minimization.

  • minimize_every (int, optional, default 10) – Number of MD steps between two consecutive minimizations.

property parent_simulation: Simulation

Get or set the simulation that created this engine facade

Returns

The Simulation object that created this engine facade

Return type

Simulation

abstract reset_config() None[source]

Resets the configuration of the simulation to that in saved_config

abstract run(n_steps: int, equilibration: bool) None[source]

Runs a simulation. Must follow a call to setup_universe() and setup_simulation().

Parameters
  • n_steps (int) – Number of steps for the time integrator.

  • equilibration (bool) – If True, run is equilibration which does not store the trajectory. Otherwise run is prodution.

abstract save_config() None[source]

Sets self.saved_config to the current configuration

abstract property saved_config: MDMC.trajectory_analysis.trajectory.Configuration

Get the saved configuration of the atomic positions

Returns

The atomic positions

Return type

Configuration

abstract setup_simulation(**settings: dict) None[source]

Sets the options required to perform a simulation on a setup Universe. Must follow a call to setup_universe().

Parameters
  • universe (Universe) – A molecular dynamics Universe which will be simulated in the MDEngine.

  • settings** – The majority of these are generic but some are specific to the MDEngine that is being used.

abstract setup_universe(universe: str, **settings: dict) None[source]

Creates a Universe.configuration and populates with Structure

Parameters
  • universe (Universe) – A molecular dynamics Universe which will be setup in the MDEngine.

  • **settings – The majority of these are generic but some are specific to the MDEngine that is being used.

property time_step: float

Get the simulation time step in fs from the parent simulation

Returns

Simulation time step in fs

Return type

float

property traj_step: int

Get the number of simulation steps between saving the CompactTrajectory from the parent simulation

Returns

Number of simulation steps that elapse between the CompactTrajectory being stored

Return type

int

abstract update_parameters() None[source]

Updates the MDEngine force field Parameter objects from the Universe