SSAGES  0.1
A MetaDynamics Package
Public Member Functions | Private Attributes | List of all members
SSAGES::MockCV Class Reference

Mock collective variable for testing purposes. More...

#include <MockCV.h>

Inheritance diagram for SSAGES::MockCV:
Inheritance graph
[legend]

Public Member Functions

 MockCV (double value, const Vector3 &grad, double upper, double lower)
 Constructor. More...
 
void Initialize (const Snapshot &snapshot) override
 Initialize necessary variables. More...
 
void Evaluate (const Snapshot &snapshot) override
 Evaluate the CV. More...
 
- Public Member Functions inherited from SSAGES::CollectiveVariable
 CollectiveVariable ()
 Constructor.
 
virtual ~CollectiveVariable ()
 Destructor.
 
virtual void Initialize (const class Snapshot &)
 Initialize CV. More...
 
virtual void Evaluate (const class Snapshot &)=0
 Evaluate CV. More...
 
double GetValue () const
 Get current value of the CV. More...
 
virtual double GetMinimumImage (double) const
 Returns the minimum image of a CV based on the input location. More...
 
virtual double GetPeriodicValue (double location) const
 Apply periodic boundaries to a given value. More...
 
const std::vector< Vector3 > & GetGradient () const
 Get current gradient of the CV. More...
 
const Matrix3GetBoxGradient () const
 Get gradient contribution to box.
 
const std::array< double, 2 > & GetBoundaries ()
 Get CV boundaries. More...
 
virtual double GetDifference (double location) const
 

Private Attributes

Vector3 usergrad_
 User defined gradient vector.
 

Additional Inherited Members

- Static Public Member Functions inherited from SSAGES::CollectiveVariable
static CollectiveVariableBuildCV (const Json::Value &json, const std::string &path)
 Set up collective variable. More...
 
- Protected Attributes inherited from SSAGES::CollectiveVariable
std::vector< Vector3grad_
 Gradient vector dCv/dxi.
 
Matrix3 boxgrad_
 Gradient w.r.t box vectors dCv/dHij.
 
double val_
 Current value of CV.
 
std::array< double, 2 > bounds_
 Bounds on CV.
 

Detailed Description

Mock collective variable for testing purposes.

Definition at line 31 of file MockCV.h.

Constructor & Destructor Documentation

SSAGES::MockCV::MockCV ( double  value,
const Vector3 grad,
double  upper,
double  lower 
)
inline

Constructor.

Parameters
valueValue the Mock CV will return.
gradGradient vector the Mock CV will return.
upperValue for the upper bound of the CV.
lowerValue for the lower bound of the CV.

Construct a mock CV

Definition at line 48 of file MockCV.h.

References SSAGES::CollectiveVariable::bounds_, and SSAGES::CollectiveVariable::val_.

48  :
49  usergrad_(grad)
50  {
51  val_ = value;
52  bounds_ = {{upper, lower}};
53  }
std::array< double, 2 > bounds_
Bounds on CV.
double val_
Current value of CV.
Vector3 usergrad_
User defined gradient vector.
Definition: MockCV.h:35

Member Function Documentation

void SSAGES::MockCV::Evaluate ( const Snapshot snapshot)
inlineoverride

Evaluate the CV.

Parameters
snapshotCurrent simulation snapshot.

Definition at line 70 of file MockCV.h.

71  {
72 
73  }
void SSAGES::MockCV::Initialize ( const Snapshot snapshot)
inlineoverride

Initialize necessary variables.

Parameters
snapshotCurrent simulation snapshot.

Definition at line 59 of file MockCV.h.

References SSAGES::Snapshot::GetPositions(), and SSAGES::CollectiveVariable::grad_.

60  {
61  // Initialize gradient
62  auto n = snapshot.GetPositions().size();
63  grad_.resize(n, usergrad_);
64  }
std::vector< Vector3 > grad_
Gradient vector dCv/dxi.
Vector3 usergrad_
User defined gradient vector.
Definition: MockCV.h:35

Here is the call graph for this function:


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