openpathsampling.engines.openmm.engine.OpenMMEngine
- class openpathsampling.engines.openmm.engine.OpenMMEngine(topology, system, integrator, openmm_properties=None, options=None, platform=None)[source]
OpenMM dynamics engine based on OpenMM system and integrator.
The engine will create a
openmm.app.Simulationinstance and uses this to generate new frames.- __init__(topology, system, integrator, openmm_properties=None, options=None, platform=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.
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
platform (str or
openmm.Platformor None) – optional default platform for creating the OpenMM simulation. This value is used byinitializeand serialization. The.platformproperty reflects the initialized simulation context and remainsNoneuntil initialization occurs.
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
export_trajectory(trajectory, filename, *[, ...])Export a trajectory to a file
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, openmm_properties])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_LONGBACKWARDCREATION_COUNTFORWARDINSTANCE_UUIDbase_clsReturn the base class
base_cls_nameReturn the name of the base class
clear_snapshot_cacheclsReturn the class name as a string
current_snapshotdefault_nameReturn the default name.
default_optionsdimensionsis_namedTrue if this object has a custom name.
mdtraj_topologynameReturn the current name of the object.
observe_objectsplatformReturn the name of the currently used platform.
simulationsnapshot_timestepunits