ForceImpl Class Reference

A ForceImpl provides the internal implementation of a Force. More...

#include <ForceImpl.h>

Inheritance diagram for ForceImpl:
AndersenThermostatImpl CMMotionRemoverImpl CustomBondForceImpl CustomExternalForceImpl CustomGBForceImpl CustomNonbondedForceImpl GBSAOBCForceImpl GBVIForceImpl HarmonicAngleForceImpl HarmonicBondForceImpl NonbondedForceImpl PeriodicTorsionForceImpl RBTorsionForceImpl

List of all members.

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 ForcegetOwner ()=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 void calcForces (ContextImpl &context)=0
 Calculate the force on each particle generated by this ForceImpl.
virtual double calcEnergy (ContextImpl &context)=0
 Calculate 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.

Detailed Description

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.


Constructor & Destructor Documentation

virtual ~ForceImpl (  )  [inline, virtual]

Member Function Documentation

virtual double calcEnergy ( ContextImpl context  )  [pure virtual]

Calculate this ForceImpl's contribution to the potential energy of the system.

Parameters:
context the context in which the system is being simulated
Returns:
this force's contribution to the potential energy of the system, or 0 if this force does not contribute to potential energy

Implemented in AndersenThermostatImpl, CMMotionRemoverImpl, CustomBondForceImpl, CustomExternalForceImpl, CustomGBForceImpl, CustomNonbondedForceImpl, GBSAOBCForceImpl, GBVIForceImpl, HarmonicAngleForceImpl, HarmonicBondForceImpl, NonbondedForceImpl, PeriodicTorsionForceImpl, and RBTorsionForceImpl.

virtual void calcForces ( ContextImpl context  )  [pure virtual]

Calculate the force on each particle generated by this ForceImpl.

The forces should be added to the values already present in the array that is passed in. If this ForceImpl does not generate any new forces, it should simply return without modifying the array.

Parameters:
context the context in which the system is being simulated
forces new forces should be added to the value already stored in this

Implemented in AndersenThermostatImpl, CMMotionRemoverImpl, CustomBondForceImpl, CustomExternalForceImpl, CustomGBForceImpl, CustomNonbondedForceImpl, GBSAOBCForceImpl, GBVIForceImpl, HarmonicAngleForceImpl, HarmonicBondForceImpl, NonbondedForceImpl, PeriodicTorsionForceImpl, and RBTorsionForceImpl.

virtual std::map<std::string, double> getDefaultParameters (  )  [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 AndersenThermostatImpl, CMMotionRemoverImpl, CustomBondForceImpl, CustomExternalForceImpl, CustomGBForceImpl, CustomNonbondedForceImpl, GBSAOBCForceImpl, GBVIForceImpl, HarmonicAngleForceImpl, HarmonicBondForceImpl, NonbondedForceImpl, PeriodicTorsionForceImpl, and RBTorsionForceImpl.

virtual std::vector<std::string> getKernelNames (  )  [pure virtual]
virtual Force& getOwner (  )  [pure virtual]
virtual void initialize ( ContextImpl context  )  [pure virtual]
virtual void updateContextState ( ContextImpl context  )  [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.

Parameters:
context the context in which the system is being simulated

Implemented in AndersenThermostatImpl, CMMotionRemoverImpl, CustomBondForceImpl, CustomExternalForceImpl, CustomGBForceImpl, CustomNonbondedForceImpl, GBSAOBCForceImpl, GBVIForceImpl, HarmonicAngleForceImpl, HarmonicBondForceImpl, NonbondedForceImpl, PeriodicTorsionForceImpl, and RBTorsionForceImpl.


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

Generated by  doxygen 1.6.2