ExtendedSpaceSimulation¶
- class ufedmm.ExtendedSpaceSimulation(variables, topology, system, integrator, platform=None, platformProperties=None)[source]¶
A simulation involving extended phase-space variables.
- Parameters:
variables (list of DynamicalVariable) – The dynamical variables to be added to the system’s phase space.
topology (openmm.app.Topology) – A Topology describing the system to be simulated.
system (openmm.System) – The openmm.System object to be simulated.
integrator (openmm.Integrator) – The OpenMM Integrator to use for simulating the system dynamics.
- Keyword Arguments:
platform (openmm.Platform, default=None) – If not None, the openmm.Platform to use.
platformProperties (dict, default=None) – If not None, a set of platform-specific properties to pass to the Context’s constructor.
Methods
- add_periodic_task(task, force_group=0)[source]¶
Adds a task to be executed periodically along this simulation.
- Parameters:
task (PeriodicTask) – A
PeriodicTaskobject.
- loadCheckpoint(file)[source]¶
Load a checkpoint file that was created with saveCheckpoint().
- Parameters:
file (string or file) – a File-like object to load the checkpoint from, or alternatively a filename
- saveCheckpoint(file)[source]¶
Save a checkpoint of the simulation to a file.
The output is a binary file that contains a complete representation of the current state of the Simulation. It includes both publicly visible data such as the particle positions and velocities, and also internal data such as the states of random number generators. Reloading the checkpoint will put the Simulation back into precisely the same state it had before, so it can be exactly continued.
A checkpoint file is highly specific to the Simulation it was created from. It can only be loaded into another Simulation that has an identical System, uses the same Platform and OpenMM version, and is running on identical hardware. If you need a more portable way to resume simulations, consider using saveState() instead.
- Parameters:
file (string or file) – a File-like object to write the checkpoint to, or alternatively a filename
- saveState(file)[source]¶
Saves the current state of the simulation to a file, like
saveStatein OpenMM’sSimulation.Warning
A saved state does not include the state of periodic tasks, such as the metadynamics bias. Use
saveCheckpoint()to save it too.