OpenMM
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
AmoebaStretchBendForce Class Reference

This class implements the Amoeba stretch-bend interaction. More...

#include <AmoebaStretchBendForce.h>

+ Inheritance diagram for AmoebaStretchBendForce:

Public Member Functions

 AmoebaStretchBendForce ()
 Create an AmoebaStretchBendForce. More...
 
int getNumStretchBends () const
 Get the number of stretch-bend terms in the potential function. More...
 
int addStretchBend (int particle1, int particle2, int particle3, double lengthAB, double lengthCB, double angle, double k1, double k2)
 Add a stretch-bend term to the force field. More...
 
void getStretchBendParameters (int index, int &particle1, int &particle2, int &particle3, double &lengthAB, double &lengthCB, double &angle, double &k1, double &k2) const
 Get the force field parameters for a stretch-bend term. More...
 
void setStretchBendParameters (int index, int particle1, int particle2, int particle3, double lengthAB, double lengthCB, double angle, double k1, double k2)
 Set the force field parameters for a stretch-bend term. More...
 
void updateParametersInContext (Context &context)
 Update the per-stretch-bend term parameters in a Context to match those stored in this Force object. More...
 
bool usesPeriodicBoundaryConditions () const
 Returns whether or not this force makes use of periodic boundary conditions. More...
 
- Public Member Functions inherited from Force
 Force ()
 
virtual ~Force ()
 
int getForceGroup () const
 Get the force group this Force belongs to. More...
 
void setForceGroup (int group)
 Set the force group this Force belongs to. More...
 

Protected Member Functions

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

Detailed Description

This class implements the Amoeba stretch-bend interaction.

To use it, create a StretchBendForce object then call addStretchBend() once for each stretch-bend. After a stretch-bend has been added, you can modify its force field parameters by calling setStretchBendParameters(). This will have no effect on Contexts that already exist unless you call updateParametersInContext().

Constructor & Destructor Documentation

Member Function Documentation

int addStretchBend ( int  particle1,
int  particle2,
int  particle3,
double  lengthAB,
double  lengthCB,
double  angle,
double  k1,
double  k2 
)

Add a stretch-bend term to the force field.

Parameters
particle1the index of the first particle connected by the stretch-bend
particle2the index of the second particle connected by the stretch-bend
particle3the index of the third particle connected by the stretch-bend
lengthABthe equilibrium length of the stretch-bend in bond ab [particle1, particle2], measured in nm
lengthCBthe equilibrium length of the stretch-bend in bond cb [particle3, particle2], measured in nm
anglethe equilibrium angle in radians
k1the force constant of the product of bond ab and angle a-b-c
k2the force constant of the product of bond bc and angle a-b-c (optional, default is the same as k1)
Returns
the index of the stretch-bend 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.

int getNumStretchBends ( ) const
inline

Get the number of stretch-bend terms in the potential function.

void getStretchBendParameters ( int  index,
int &  particle1,
int &  particle2,
int &  particle3,
double &  lengthAB,
double &  lengthCB,
double &  angle,
double &  k1,
double &  k2 
) const

Get the force field parameters for a stretch-bend term.

Parameters
indexthe index of the stretch-bend for which to get parameters
particle1the index of the first particle connected by the stretch-bend
particle2the index of the second particle connected by the stretch-bend
particle3the index of the third particle connected by the stretch-bend
lengthABthe equilibrium length of the stretch-bend in bond ab [particle1, particle2], measured in nm
lengthCBthe equilibrium length of the stretch-bend in bond cb [particle3, particle2], measured in nm
anglethe equilibrium angle in radians
k1the force constant of the product of bond ab and angle a-b-c
k2the force constant of the product of bond bc and angle a-b-c
void setStretchBendParameters ( int  index,
int  particle1,
int  particle2,
int  particle3,
double  lengthAB,
double  lengthCB,
double  angle,
double  k1,
double  k2 
)

Set the force field parameters for a stretch-bend term.

Parameters
indexthe index of the stretch-bend for which to set parameters
particle1the index of the first particle connected by the stretch-bend
particle2the index of the second particle connected by the stretch-bend
particle3the index of the third particle connected by the stretch-bend
lengthABthe equilibrium length of the stretch-bend in bond ab [particle1, particle2], measured in nm
lengthCBthe equilibrium length of the stretch-bend in bond cb [particle3, particle2], measured in nm
anglethe equilibrium angle in radians
k1the force constant of the product of bond ab and angle a-b-c
k2the force constant of the product of bond bc and angle a-b-c (optional, default is the same as k1)
void updateParametersInContext ( Context context)

Update the per-stretch-bend term parameters in a Context to match those stored in this Force object.

This method provides an efficient method to update certain parameters in an existing Context without needing to reinitialize it. Simply call setStretchBendParameters() to modify this object's parameters, then call updateParametersInContext() to copy them over to the Context.

The only information this method updates is the values of per-stretch-bend term parameters. The set of particles involved in a term cannot be changed, nor can new terms be added.

bool usesPeriodicBoundaryConditions ( ) const
inlinevirtual

Returns whether or not this force makes use of periodic boundary conditions.

Returns
true if nonbondedMethod uses PBC and false otherwise

Reimplemented from Force.


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