|
SSAGES
0.9.3
Software Suite for Advanced General Ensemble Simulations
|
Collective variable on a particle coordinate. More...
#include <ParticleCoordinateCV.h>

Public Member Functions | |
| ParticleCoordinateCV (const Label &atomids, Dimension dim) | |
| Constructor. More... | |
| void | Initialize (const Snapshot &snapshot) override |
| Initialize necessary variables. More... | |
| void | Evaluate (const Snapshot &snapshot) override |
| Evaluate the CV. More... | |
| double | GetPeriodicValue (double Location) const override |
| Return value taking periodic boundary conditions into account. More... | |
| double | GetDifference (const double Location) const override |
| Return difference considering periodic boundaries. 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... | |
| const std::vector< Vector3 > & | GetGradient () const |
| Get current gradient of the CV. More... | |
| const Matrix3 & | GetBoxGradient () const |
| Get gradient contribution to box. More... | |
| const std::array< double, 2 > & | GetBoundaries () |
| Get CV boundaries. More... | |
Static Public Member Functions | |
| static ParticleCoordinateCV * | Build (const Json::Value &json, const std::string &path) |
| Set up collective variable. More... | |
Static Public Member Functions inherited from SSAGES::CollectiveVariable | |
| static CollectiveVariable * | BuildCV (const Json::Value &json, const std::string &path) |
| Set up collective variable. More... | |
Private Attributes | |
| Label | atomids_ |
| IDs of atoms of interest. | |
| Dimension | dim_ |
| Index of dimension. | |
Additional Inherited Members | |
Protected Attributes inherited from SSAGES::CollectiveVariable | |
| std::vector< Vector3 > | grad_ |
| 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. | |
Collective variable on a particle coordinate.
This will return the value of either the x, y, or z coordinate, depending on the user specification for a defined particle, which is a collection of one or more atoms.
Definition at line 40 of file ParticleCoordinateCV.h.
Constructor.
| atomids | Atom ID's of interest. |
| dim | Index of dimension. |
Construct a particle coordinate CV. The atomids specify a vector of the atom ID's of interest, and index specifies the dimension to report (x,y,z).
Definition at line 60 of file ParticleCoordinateCV.h.
|
inlinestatic |
Set up collective variable.
nullptr in case of unknown error.Builds a CV from a JSON node. Returns a pointer to the built cv. If an unknown error is encountered, this function will return a nullptr, but generally it will throw a BuildException on failure.
Definition at line 168 of file ParticleCoordinateCV.h.
References Json::Requirement::GetErrors(), Json::Requirement::HasErrors(), Json::ObjectRequirement::Parse(), and Json::ObjectRequirement::Validate().
Referenced by SSAGES::CollectiveVariable::BuildCV().


|
inlineoverride |
Evaluate the CV.
| snapshot | Current simulation snapshot. |
Definition at line 97 of file ParticleCoordinateCV.h.
References atomids_, SSAGES::Snapshot::CenterOfMass(), dim_, SSAGES::Snapshot::GetLocalIndices(), SSAGES::Snapshot::GetMasses(), SSAGES::Snapshot::GetNumAtoms(), SSAGES::CollectiveVariable::grad_, and SSAGES::Snapshot::TotalMass().

|
inlineoverridevirtual |
Return difference considering periodic boundaries.
| Location | Calculate difference of CV value to this location. |
As the AtomCoordinate CV does not consider periodic boundary conditions, the difference between the current value of the CV and another value is always the direct difference.
Reimplemented from SSAGES::CollectiveVariable.
Definition at line 162 of file ParticleCoordinateCV.h.
References SSAGES::CollectiveVariable::val_.
|
inlineoverridevirtual |
Return value taking periodic boundary conditions into account.
| Location | Get wrapped value of this location. |
The AtomCoordinate CV does not consider periodic boundary conditions. Thus, this function always returns the input value.
Reimplemented from SSAGES::CollectiveVariable.
Definition at line 147 of file ParticleCoordinateCV.h.
|
inlineoverride |
Initialize necessary variables.
| snapshot | Current simulation snapshot. |
Definition at line 68 of file ParticleCoordinateCV.h.
References atomids_, SSAGES::Snapshot::GetCommunicator(), and SSAGES::Snapshot::GetLocalIndex().
