OpenMM
|
A ForceImpl provides the internal implementation of a Force. More...
#include <ForceImpl.h>
Public Member Functions | |
virtual | ~ForceImpl () |
virtual void | initialize (ContextImpl &context)=0 |
This is called after the ForceImpl is created and before updateContextState(), calcForces(), or calcEnergy() is called on it. | |
virtual const Force & | getOwner () const =0 |
Get the Force object from which this ForceImpl was created. | |
virtual void | updateContextState (ContextImpl &context)=0 |
This method is called at the beginning of each time step. | |
virtual double | calcForcesAndEnergy (ContextImpl &context, bool includeForces, bool includeEnergy, int groups)=0 |
Calculate the force on each particle generated by this ForceImpl and/or this ForceImpl's contribution to the potential energy of the system. | |
virtual std::map< std::string, double > | getDefaultParameters ()=0 |
Get a map containing the default values for all adjustable parameters defined by this ForceImpl. | |
virtual std::vector< std::string > | getKernelNames ()=0 |
Get the names of all Kernels used by this Force. | |
virtual std::vector< std::pair < int, int > > | getBondedParticles () const |
Get pairs of particles connected by bonds by this force. | |
A ForceImpl provides the internal implementation of a Force.
When a Context is created for a System, it creates a ForceImpl for each Force in the System. The ForceImpl is permitted to cache information from the Force or System which is needed to apply the force efficiently. If the user calls reinitialize() on the Context, all ForceImpl objects it had previously created are deleted and recreated from scratch.
This is an abstract class. Each Force subclass is responsible for defining its own ForceImpl subclass.
|
inlinevirtual |
|
pure virtual |
Calculate the force on each particle generated by this ForceImpl and/or this ForceImpl's contribution to the potential energy of the system.
context | the context in which the system is being simulated |
includeForces | true if forces should be calculated |
includeEnergy | true if the energy should be calculated |
groups | a set of bit flags for which force groups to include. Group i should be included if (groups&(1<<i)) != 0. |
Implemented in GBVIForceImpl, CustomCompoundBondForceImpl, CustomHbondForceImpl, NonbondedForceImpl, CustomNonbondedForceImpl, CustomAngleForceImpl, CustomBondForceImpl, CustomExternalForceImpl, CustomGBForceImpl, CustomTorsionForceImpl, HarmonicAngleForceImpl, HarmonicBondForceImpl, PeriodicTorsionForceImpl, RBTorsionForceImpl, CMAPTorsionForceImpl, AndersenThermostatImpl, GBSAOBCForceImpl, MonteCarloAnisotropicBarostatImpl, MonteCarloBarostatImpl, and CMMotionRemoverImpl.
|
inlinevirtual |
Get pairs of particles connected by bonds by this force.
This is used to determine which particles are part of the same molecule.
Reimplemented in HarmonicBondForceImpl, and CustomBondForceImpl.
|
pure virtual |
Get a map containing the default values for all adjustable parameters defined by this ForceImpl.
These parameters and their default values will automatically be added to the Context.
Implemented in GBVIForceImpl, CustomCompoundBondForceImpl, CustomHbondForceImpl, NonbondedForceImpl, CustomNonbondedForceImpl, AndersenThermostatImpl, CustomAngleForceImpl, CustomBondForceImpl, CustomExternalForceImpl, CustomGBForceImpl, CustomTorsionForceImpl, HarmonicAngleForceImpl, HarmonicBondForceImpl, PeriodicTorsionForceImpl, RBTorsionForceImpl, CMAPTorsionForceImpl, MonteCarloAnisotropicBarostatImpl, MonteCarloBarostatImpl, CMMotionRemoverImpl, and GBSAOBCForceImpl.
|
pure virtual |
Get the names of all Kernels used by this Force.
Implemented in GBVIForceImpl, NonbondedForceImpl, CustomCompoundBondForceImpl, CustomHbondForceImpl, HarmonicAngleForceImpl, HarmonicBondForceImpl, PeriodicTorsionForceImpl, RBTorsionForceImpl, CMAPTorsionForceImpl, CustomNonbondedForceImpl, AndersenThermostatImpl, CustomAngleForceImpl, CustomBondForceImpl, CustomExternalForceImpl, CustomGBForceImpl, CustomTorsionForceImpl, CMMotionRemoverImpl, GBSAOBCForceImpl, MonteCarloAnisotropicBarostatImpl, and MonteCarloBarostatImpl.
|
pure virtual |
Get the Force object from which this ForceImpl was created.
Implemented in CustomCompoundBondForceImpl, CustomHbondForceImpl, NonbondedForceImpl, CustomNonbondedForceImpl, CustomAngleForceImpl, CustomBondForceImpl, CustomExternalForceImpl, CustomGBForceImpl, CustomTorsionForceImpl, HarmonicAngleForceImpl, HarmonicBondForceImpl, PeriodicTorsionForceImpl, RBTorsionForceImpl, AndersenThermostatImpl, CMAPTorsionForceImpl, MonteCarloAnisotropicBarostatImpl, MonteCarloBarostatImpl, GBSAOBCForceImpl, GBVIForceImpl, and CMMotionRemoverImpl.
|
pure virtual |
This is called after the ForceImpl is created and before updateContextState(), calcForces(), or calcEnergy() is called on it.
This allows it to do any necessary initialization.
Implemented in CustomCompoundBondForceImpl, CustomHbondForceImpl, NonbondedForceImpl, CustomNonbondedForceImpl, CustomAngleForceImpl, CustomBondForceImpl, CustomExternalForceImpl, CustomGBForceImpl, CustomTorsionForceImpl, HarmonicAngleForceImpl, HarmonicBondForceImpl, PeriodicTorsionForceImpl, RBTorsionForceImpl, AndersenThermostatImpl, CMAPTorsionForceImpl, MonteCarloAnisotropicBarostatImpl, MonteCarloBarostatImpl, GBSAOBCForceImpl, GBVIForceImpl, and CMMotionRemoverImpl.
|
pure virtual |
This method is called at the beginning of each time step.
It give the ForceImpl a chance to modify the state variables (positions, velocities, and parameters) stored in the Context in arbitrary ways before integration is performed.
context | the context in which the system is being simulated |
Implemented in GBVIForceImpl, CustomCompoundBondForceImpl, CustomHbondForceImpl, NonbondedForceImpl, CustomNonbondedForceImpl, CustomAngleForceImpl, CustomBondForceImpl, CustomExternalForceImpl, CustomGBForceImpl, CustomTorsionForceImpl, HarmonicAngleForceImpl, HarmonicBondForceImpl, PeriodicTorsionForceImpl, RBTorsionForceImpl, AndersenThermostatImpl, CMAPTorsionForceImpl, MonteCarloAnisotropicBarostatImpl, MonteCarloBarostatImpl, GBSAOBCForceImpl, and CMMotionRemoverImpl.