SSAGES
0.9.3
Software Suite for Advanced General Ensemble Simulations
|
Collective variable is a Rouse mode for a polymer chain comprised of N particle groups. More...
#include <RouseModeCV.h>
Public Member Functions | |
RouseModeCV (const std::vector< Label > &groups, int p) | |
Basic Constructor for Rouse Mode CV. More... | |
void | setMasses (const std::vector< Label > &groups, const Snapshot &snapshot) |
Helper function to determine masses of each group. 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 Matrix3 & | GetBoxGradient () const |
Get gradient contribution to box. More... | |
const std::array< double, 2 > & | GetBoundaries () |
Get CV boundaries. More... | |
virtual double | GetDifference (double location) const |
Static Public Member Functions | |
static RouseModeCV * | 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 | |
std::vector< Label > | groups_ |
vector of groups of indices to define the particle groups | |
std::vector< double > | massg_ |
vector of the total mass for each particle group | |
size_t | p_ |
index of mode of interest as CV | |
size_t | N_ |
number of Rouse beads in polymer chain | |
Vector3 | xp_ |
3d vector for containing vectorial rouse amplitude | |
std::vector< Vector3 > | r_ |
vector of coordinate positions for each bead | |
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 is a Rouse mode for a polymer chain comprised of N particle groups.
This CV returns the value for the p'th Rouse mode, computed as Xp(t) ~ (1/N) sum_{i=1}^{N} ri(t)*cos[pi(n-0.5)p/N], where N is the number of particle groups, p is the mode index, ri is the center-of-mass position of a collection of atoms comprising the i'th bead in the N-bead polymer chain
Definition at line 39 of file RouseModeCV.h.
|
inline |
Basic Constructor for Rouse Mode CV.
groups | - vector of vector of atom IDs, each group comprising a bead in the Rouse chain |
p | - index for relevant Rouse mode |
Definition at line 55 of file RouseModeCV.h.
References groups_, and massg_.
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 192 of file RouseModeCV.h.
References Json::Requirement::GetErrors(), Json::Requirement::HasErrors(), Json::ObjectRequirement::Parse(), RouseModeCV(), and Json::ObjectRequirement::Validate().
Referenced by SSAGES::CollectiveVariable::BuildCV().
|
inlineoverride |
Evaluate the CV.
snapshot | Current simulation snapshot. |
Definition at line 121 of file RouseModeCV.h.
References SSAGES::Snapshot::ApplyMinimumImage(), SSAGES::Snapshot::CenterOfMass(), SSAGES::Snapshot::GetLocalIndices(), SSAGES::Snapshot::GetMasses(), SSAGES::Snapshot::GetNumAtoms(), SSAGES::CollectiveVariable::grad_, groups_, massg_, N_, p_, r_, SSAGES::CollectiveVariable::val_, and xp_.
|
inlineoverride |
Initialize necessary variables.
snapshot | Current simulation snapshot. |
Definition at line 80 of file RouseModeCV.h.
References SSAGES::Snapshot::GetCommunicator(), SSAGES::Snapshot::GetLocalIndex(), groups_, p_, and setMasses().
|
inline |
Helper function to determine masses of each group.
Note: this here assumes that the masses of each group are not changing during the simulation, which is likely typical...
snapshot | Current simulation snapshot. |
groups | - vector of vector of atom IDs, each group comprising a bead in the Rouse chain |
Definition at line 65 of file RouseModeCV.h.
References SSAGES::Snapshot::GetLocalIndices(), massg_, N_, and SSAGES::Snapshot::TotalMass().
Referenced by Initialize().