metadynamics
Public Member Functions | Protected Attributes
CollectiveVariable Class Reference

Detailed Description

Abstract interface for a collective variable

All C++ implementations of collective variables inherit from this class. A CollectiveVariable is an extension of a ForceCompute, and can compute forces.

The force generated by a collective variable (i.e. its negative derivative with respect to particle positions) must be multiplied by a bias factor (the partial derivative of the biasing potential with respect to the collective variable). The bias factor is set using the method setBiasFactor().

Collective variables should have a potential energy of zero, since they are not directly added to the Hamiltonian (only via the biasing potential). Instead, the value of the collective variable can be queried using getCurrentValue().

Inheritance diagram for CollectiveVariable:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CollectiveVariable (boost::shared_ptr< SystemDefinition > sysdef, const std::string &name)
virtual void computeForces (unsigned int timestep)=0
virtual Scalar getCurrentValue (unsigned int timestep)=0
virtual void setBiasFactor (Scalar bias)
std::string getName ()

Protected Attributes

Scalar m_bias
std::string m_cv_name

Constructor & Destructor Documentation

CollectiveVariable ( boost::shared_ptr< SystemDefinition >  sysdef,
const std::string &  name 
)

Constructs a collective variable

Parameters:
sysdefThe system definition
nameThe name of this collective variable

Member Function Documentation

virtual void computeForces ( unsigned int  timestep)
pure virtual

Compute the forces for this collective variable. The force that is written to the force arrays must be multiplied by the bias factor.

Parameters:
timestepThe current value of the time step

Implemented in LamellarOrderParameter, and CollectiveVariableWrap.

virtual Scalar getCurrentValue ( unsigned int  timestep)
pure virtual

Returns the current value of the collective variable

Parameters:
timestepThe currnt value of the timestep

Implemented in LamellarOrderParameter, and CollectiveVariableWrap.

std::string getName ( )
inline

Returns the name of the collective variable

virtual void setBiasFactor ( Scalar  bias)
inlinevirtual

Set the current value of the bias factor. This routine has to be called before force evaluation by the integrator.

Parameters:
biasThe value that multiplies the force

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