OpenMM
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends
CMAPTorsionForce Class Reference

This class implements an interaction between pairs of dihedral angles. More...

#include <CMAPTorsionForce.h>

+ Inheritance diagram for CMAPTorsionForce:

Public Member Functions

 CMAPTorsionForce ()
 Create a CMAPTorsionForce.
 
int getNumMaps () const
 Get the number of maps that have been defined.
 
int getNumTorsions () const
 Get the number of CMAP torsion terms in the potential function.
 
int addMap (int size, const std::vector< double > &energy)
 Create a new map that can be used for torsion pairs.
 
void getMapParameters (int index, int &size, std::vector< double > &energy) const
 Get the energy values of a map.
 
void setMapParameters (int index, int size, const std::vector< double > &energy)
 Set the energy values of a map.
 
int addTorsion (int map, int a1, int a2, int a3, int a4, int b1, int b2, int b3, int b4)
 Add a CMAP torsion term to the force field.
 
void getTorsionParameters (int index, int &map, int &a1, int &a2, int &a3, int &a4, int &b1, int &b2, int &b3, int &b4) const
 Get the force field parameters for a CMAP torsion term.
 
void setTorsionParameters (int index, int map, int a1, int a2, int a3, int a4, int b1, int b2, int b3, int b4)
 Set the force field parameters for a CMAP torsion term.
 
- Public Member Functions inherited from Force
 Force ()
 
virtual ~Force ()
 
int getForceGroup () const
 Get the force group this Force belongs to.
 
void setForceGroup (int group)
 Set the force group this Force belongs to.
 

Protected Member Functions

ForceImplcreateImpl () const
 When a Context is created, it invokes this method on each Force in the System.
 
- Protected Member Functions inherited from Force
ForceImplgetImplInContext (Context &context)
 Get the ForceImpl corresponding to this Force in a Context.
 
ContextImplgetContextImpl (Context &context)
 Get the ContextImpl corresponding to a Context.
 

Detailed Description

This class implements an interaction between pairs of dihedral angles.

The interaction energy is defined by an "energy correction map" (CMAP), which is simply a set of tabulated energy values on a regular grid of (phi, psi) angles. Natural cubic spline interpolation is used to compute forces and energies at arbitrary values of the two angles.

To use this class, first create one or more energy correction maps by calling addMap(). For each one, you provide an array of energies at uniformly spaced values of the two angles. Next, add interactions by calling addTorsion(). For each one, you specify the sequence of particles used to calculate each of the two dihedral angles, and the index of the map used to calculate their interaction energy.

Constructor & Destructor Documentation

Member Function Documentation

int addMap ( int  size,
const std::vector< double > &  energy 
)

Create a new map that can be used for torsion pairs.

Parameters
sizethe size of the map along each dimension
energythe energy values for the map. This must be of length size*size. The element energy[i+size*j] contains the energy when the first torsion angle equals i*2*PI/size and the second torsion angle equals j*2*PI/size.
Returns
the index of the map that was added
int addTorsion ( int  map,
int  a1,
int  a2,
int  a3,
int  a4,
int  b1,
int  b2,
int  b3,
int  b4 
)

Add a CMAP torsion term to the force field.

Parameters
mapthe index of the map to use for this term
a1the index of the first particle forming the first torsion
a2the index of the second particle forming the first torsion
a3the index of the third particle forming the first torsion
a4the index of the fourth particle forming the first torsion
b1the index of the first particle forming the second torsion
b2the index of the second particle forming the second torsion
b3the index of the third particle forming the second torsion
b4the index of the fourth particle forming the second torsion
Returns
the index of the torsion that was added
ForceImpl* createImpl ( ) const
protectedvirtual

When a Context is created, it invokes this method on each Force in the System.

It should create a new ForceImpl object which can be used by the context for calculating forces. The ForceImpl will be deleted automatically when the Context is deleted.

Implements Force.

void getMapParameters ( int  index,
int &  size,
std::vector< double > &  energy 
) const

Get the energy values of a map.

Parameters
indexthe index of the map for which to get energy values
sizethe size of the map along each dimension
energythe energy values for the map. This must be of length size*size. The element energy[i+size*j] contains the energy when the first torsion angle equals i*2*PI/size and the second torsion angle equals j*2*PI/size.
int getNumMaps ( ) const
inline

Get the number of maps that have been defined.

int getNumTorsions ( ) const
inline

Get the number of CMAP torsion terms in the potential function.

void getTorsionParameters ( int  index,
int &  map,
int &  a1,
int &  a2,
int &  a3,
int &  a4,
int &  b1,
int &  b2,
int &  b3,
int &  b4 
) const

Get the force field parameters for a CMAP torsion term.

Parameters
indexthe index of the torsion for which to get parameters
mapthe index of the map to use for this term
a1the index of the first particle forming the first torsion
a2the index of the second particle forming the first torsion
a3the index of the third particle forming the first torsion
a4the index of the fourth particle forming the first torsion
b1the index of the first particle forming the second torsion
b2the index of the second particle forming the second torsion
b3the index of the third particle forming the second torsion
b4the index of the fourth particle forming the second torsion
void setMapParameters ( int  index,
int  size,
const std::vector< double > &  energy 
)

Set the energy values of a map.

Parameters
indexthe index of the map for which to set energy values
sizethe size of the map along each dimension
energythe energy values for the map. This must be of length size*size. The element energy[i+size*j] contains the energy when the first torsion angle equals i*2*PI/size and the second torsion angle equals j*2*PI/size.
void setTorsionParameters ( int  index,
int  map,
int  a1,
int  a2,
int  a3,
int  a4,
int  b1,
int  b2,
int  b3,
int  b4 
)

Set the force field parameters for a CMAP torsion term.

Parameters
indexthe index of the torsion for which to set parameters
mapthe index of the map to use for this term
a1the index of the first particle forming the first torsion
a2the index of the second particle forming the first torsion
a3the index of the third particle forming the first torsion
a4the index of the fourth particle forming the first torsion
b1the index of the first particle forming the second torsion
b2the index of the second particle forming the second torsion
b3the index of the third particle forming the second torsion
b4the index of the fourth particle forming the second torsion

The documentation for this class was generated from the following file: