22 #include "CollectiveVariable.h"
23 #include "Validator/ObjectRequirement.h"
24 #include "Drivers/DriverException.h"
69 Json::CharReaderBuilder rbuilder;
70 Json::CharReader* reader = rbuilder.newCharReader();
72 reader->parse(JsonSchema::BoxVolumeCV.c_str(),
73 JsonSchema::BoxVolumeCV.c_str() + JsonSchema::BoxVolumeCV.size(),
75 validator.
Parse(schema, path);
Requirements on an object.
virtual void Parse(Value json, const std::string &path) override
Parse JSON value to generate Requirement(s).
virtual void Validate(const Value &json, const std::string &path) override
Validate JSON value.
std::vector< std::string > GetErrors()
Get list of error messages.
bool HasErrors()
Check if errors have occured.
Collective variable on the volume of a box.
void Initialize(const Snapshot &) override
Initialize the CV.
void Evaluate(const Snapshot &snapshot) override
Evaluate the CV.
static BoxVolumeCV * Build(const Json::Value &json, const std::string &path)
Set up collective variable.
BoxVolumeCV()
Constructor.
Exception to be thrown when building the Driver fails.
Abstract class for a collective variable.
Matrix3 boxgrad_
Gradient w.r.t box vectors dCv/dHij.
std::vector< Vector3 > grad_
Gradient vector dCv/dxi.
double val_
Current value of CV.
Class containing a snapshot of the current simulation in time.
unsigned GetNumAtoms() const
Get number of atoms in this snapshot.
double GetVolume() const
Get system volume.
const mxx::comm & GetCommunicator() const
Get communicator for walker.
Eigen::Vector3d Vector3
Three-dimensional vector.