relentless.simulate.Simulation#

class relentless.simulate.Simulation(initializer, operations=None)#

Simulation engine.

A simulation engine interprets a sequence of SimulationOperations into a set of commands or parameters that are executed by backend software. The easiest backend software to work with will have a Python interface so that the operation commands can be passed through to Python commands. However, in-house or legacy software may require creation of input files, etc. that are executed by other binaries or programs.

When the simulation is run(), a SimulationInstance is created that can hold specific data or parameters associated with the operations. Hence, a single Simulation can be run multiple times, e.g., with varied inputs, to obtain different output SimulationInstances.

Parameters:
  • initializer (InitializationOperation) – Operation to initialize the simulation.

  • operations (array_like) – Sequence of SimulationOperations to call.

Methods

run(potentials, directory)

Run the simulation operations.

Attributes

initializer

Initialization operation.

operations

The operations to be performed during a simulation run.

property initializer#

Initialization operation.

Type:

InitializationOperation

property operations#

The operations to be performed during a simulation run.

Type:

list

run(potentials, directory)#

Run the simulation operations.

A new simulation instance is created to perform the run. It is intended to be destroyed at the end of the run to prevent memory leaks.

Parameters:
  • potentials (Potentials) – The interaction potentials.

  • directory (str or Directory) – Directory for output.

Returns:

The simulation instance after the operations are performed.

Return type:

SimulationInstance