This is the internal implementation of CustomNonbondedForce. More...
#include <CustomHbondForceImpl.h>
Public Member Functions | |
CustomHbondForceImpl (CustomHbondForce &owner) | |
~CustomHbondForceImpl () | |
void | initialize (ContextImpl &context) |
This is called after the ForceImpl is created and before updateContextState(), calcForces(), or calcEnergy() is called on it. | |
CustomHbondForce & | getOwner () |
Get the Force object from which this ForceImpl was created. | |
void | updateContextState (ContextImpl &context) |
This method is called at the beginning of each time step. | |
double | calcForcesAndEnergy (ContextImpl &context, bool includeForces, bool includeEnergy, int groups) |
Calculate the force on each particle generated by this ForceImpl and/or this ForceImpl's contribution to the potential energy of the system. | |
std::map< std::string, double > | getDefaultParameters () |
Get a map containing the default values for all adjustable parameters defined by this ForceImpl. | |
std::vector< std::string > | getKernelNames () |
Get the names of all Kernels used by this Force. | |
Static Public Member Functions | |
static Lepton::ParsedExpression | prepareExpression (const CustomHbondForce &force, const std::map< std::string, Lepton::CustomFunction * > &functions, std::map< std::string, std::vector< int > > &distances, std::map< std::string, std::vector< int > > &angles, std::map< std::string, std::vector< int > > &dihedrals) |
This is a utility routine that parses the energy expression, identifies the angles and dihedrals in it, and replaces them with variables. |
This is the internal implementation of CustomNonbondedForce.
CustomHbondForceImpl | ( | CustomHbondForce & | owner | ) |
~CustomHbondForceImpl | ( | ) |
double calcForcesAndEnergy | ( | ContextImpl & | context, | |
bool | includeForces, | |||
bool | includeEnergy, | |||
int | groups | |||
) | [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. |
Implements ForceImpl.
std::map<std::string, double> getDefaultParameters | ( | ) | [virtual] |
std::vector<std::string> getKernelNames | ( | ) | [virtual] |
CustomHbondForce& getOwner | ( | ) | [inline, virtual] |
void initialize | ( | ContextImpl & | context | ) | [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.
Implements ForceImpl.
static Lepton::ParsedExpression prepareExpression | ( | const CustomHbondForce & | force, | |
const std::map< std::string, Lepton::CustomFunction * > & | functions, | |||
std::map< std::string, std::vector< int > > & | distances, | |||
std::map< std::string, std::vector< int > > & | angles, | |||
std::map< std::string, std::vector< int > > & | dihedrals | |||
) | [static] |
This is a utility routine that parses the energy expression, identifies the angles and dihedrals in it, and replaces them with variables.
The particle indices returned in the maps are defined as follows: 0=a1, 1=a2, 2=a3, 3=d1, 4=d2, 5=d3.
force | the CustomHbondForce to process | |
functions | definitions of custom function that may appear in the expression | |
distances | on exit, this will contain an entry for each distance used in the expression. The key is the name of the corresponding variable, and the value is the list of particle indices. | |
angles | on exit, this will contain an entry for each angle used in the expression. The key is the name of the corresponding variable, and the value is the list of particle indices. | |
dihedrals | on exit, this will contain an entry for each dihedral used in the expression. The key is the name of the corresponding variable, and the value is the list of particle indices. |
void updateContextState | ( | ContextImpl & | context | ) | [inline, 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 |
Implements ForceImpl.