openpathsampling.engines.openmm.engine.OpenMMEngine

class openpathsampling.engines.openmm.engine.OpenMMEngine(topology, system, integrator, openmm_properties=None, options=None)[source]

OpenMM dynamics engine based on OpenMM system and integrator.

The engine will create a openmm.app.Simulation instance and uses this to generate new frames.

__init__(topology, system, integrator, openmm_properties=None, options=None)[source]
Parameters:
  • topology (openpathsampling.engines.topology.MDTrajTopology) – a template snapshots which provides the topology object to be used to create the openmm engine

  • system (openmm.app.System) – the openmm system object

  • integrator (openmm.Integrator) – the openmm integrator object

  • openmm_properties (dict) – optional setting for creating the openmm simuation object. Typical keys include GPU floating point precision. Note that by default the engine selects the fastest currently available OpenMM platform. If you want to specify the platform you will have to call engine.initialize(platform) after creating the engine.

  • options (dict) –

    a dictionary that provides additional settings for the OPS engine. Allowed are

    ’n_steps_per_frame’int, default: 10

    the number of integration steps per returned snapshot

    ’n_frames_max’int, default: 5000,

    the maximal number of frames allowed for a returned trajectory object

Notes

The n_frames_max does not limit Trajectory objects in length. It only limits the maximal length of returned trajectory objects when this engine is used.

Methods

__init__(topology, system, integrator[, ...])

apply_constraints([snapshot, position_tol, ...])

Apply position and velocity constraints to a given snapshot.

args()

Return a list of args of the __init__ function of a class

available_platforms()

base()

Return the most parent class actually derived from StorableObject

check_snapshot_type(snapshot)

count_weaks()

Return number of objects subclassed from StorableObject still in memory

descendants()

Return a list of all subclassed objects

fix_name()

Set the objects name to be immutable.

from_dict(dct)

Reconstruct an object from a dictionary representaiton

from_new_options([integrator, ...])

Create a new engine from existing, but different options or integrator

generate(snapshot[, running, direction])

Generate a trajectory consisting of ntau segments of tau_steps in between storage of Snapshots.

generate_n_frames([n_frames])

Generates n_frames, from but not including the current snapshot.

generate_next_frame()

get_uuid()

has_constraints()

idx(store)

Return the index which is used for the object in the given store.

initialize([platform])

Create the final OpenMMEngine

is_valid_snapshot(snapshot)

Test the snapshot to be valid.

iter_generate(initial[, running, direction, ...])

Return a generator that will generate a trajectory, returning the current trajectory in given intervals

minimize()

n_degrees_of_freedom()

named(name)

Name an unnamed object.

objects()

Returns a dictionary of all storable objects

reset()

Remove the simulation object and allow recreation.

reverse_uuid()

ruuid(uid)

set_as_default()

set_observer(active)

(De-)Activate observing creation of storable objects

start([snapshot])

stop(trajectory)

Nothing special needs to be done for direct-control simulations when you hit a stop condition.

stop_conditions(trajectory[, ...])

Test whether we can continue; called by generate a couple of times, so the logic is separated here.

to_dict()

Convert object into a dictionary representation

unload_context()

Unload the OpenMM context

Attributes

ACTIVE_LONG

BACKWARD

CREATION_COUNT

FORWARD

INSTANCE_UUID

base_cls

Return the base class

base_cls_name

Return the name of the base class

clear_snapshot_cache

cls

Return the class name as a string

current_snapshot

default_name

Return the default name.

default_options

dimensions

is_named

True if this object has a custom name.

mdtraj_topology

name

Return the current name of the object.

observe_objects

platform

Return the name of the currently used platform

simulation

snapshot_timestep

units