SSAGES
0.9.3
Software Suite for Advanced General Ensemble Simulations
|
Collective variable on the torsion angles. More...
#include <TorsionalCV.h>
Public Member Functions | |
TorsionalCV (int atomid1, int atomid2, int atomid3, int atomid4, bool periodic) | |
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 |
Get difference taking periodic boundary conditions into account. More... | |
double | GetMinimumImage (const double Location) const override |
Returns the minimum image of a CV based on the input location. 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... | |
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 TorsionalCV * | 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_ |
Vector of 4 atom ID's of interest. | |
bool | periodic_ |
If True , use periodic boundary conditions. | |
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 the torsion angles.
Collective variable on an proper dihedral. This will return the angle between two planes as defined in [4]. Singularities are avoided as described in [1].
Definition at line 42 of file TorsionalCV.h.
|
inline |
Constructor.
atomid1 | ID of the first atom defining the dihedral angle. |
atomid2 | ID of the second atom defining the dihedral angle. |
atomid3 | ID of the third atom defining the dihedral angle. |
atomid4 | ID of the forth atom defining the dihedral angle. |
periodic | If True consider periodic boundary conditions. |
Construct an dihedral CV.
Definition at line 64 of file TorsionalCV.h.
Referenced by Build().
|
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 229 of file TorsionalCV.h.
References Json::Requirement::GetErrors(), Json::Requirement::HasErrors(), Json::ObjectRequirement::Parse(), TorsionalCV(), and Json::ObjectRequirement::Validate().
Referenced by SSAGES::CollectiveVariable::BuildCV().
|
inlineoverride |
Evaluate the CV.
snapshot | Current simulation snapshot. |
Definition at line 95 of file TorsionalCV.h.
References SSAGES::Snapshot::ApplyMinimumImage(), atomids_, SSAGES::Snapshot::GetCommunicator(), SSAGES::Snapshot::GetLocalIndex(), SSAGES::Snapshot::GetNumAtoms(), SSAGES::Snapshot::GetPositions(), SSAGES::CollectiveVariable::grad_, and SSAGES::CollectiveVariable::val_.
|
inlineoverridevirtual |
Get difference taking periodic boundary conditions into account.
Location | Input value |
If periodic boundaries are used, this function calculates the difference and wraps the result into the range (-pi, pi). Otherwise, the simple difference is returned.
Reimplemented from SSAGES::CollectiveVariable.
Definition at line 188 of file TorsionalCV.h.
References GetPeriodicValue(), periodic_, and SSAGES::CollectiveVariable::val_.
|
inlineoverridevirtual |
Returns the minimum image of a CV based on the input location.
Location | Value against which the minimum image is calculated. |
Takes the input location and applies the periodic boundary conditions to return a minimum image of the CV.
Reimplemented from SSAGES::CollectiveVariable.
Definition at line 213 of file TorsionalCV.h.
References periodic_, and SSAGES::CollectiveVariable::val_.
|
inlineoverridevirtual |
Return value taking periodic boundary conditions into account.
Location | Input value. |
If periodic boundaries are used, this function wraps the input value into the range (-pi, pi). Otherwise the input value is returned unmodified.
Reimplemented from SSAGES::CollectiveVariable.
Definition at line 161 of file TorsionalCV.h.
References periodic_.
Referenced by GetDifference().
|
inlineoverride |
Initialize necessary variables.
snapshot | Current simulation snapshot. |
Definition at line 73 of file TorsionalCV.h.
References atomids_, SSAGES::Snapshot::GetCommunicator(), and SSAGES::Snapshot::GetLocalIndices().