SSAGES  0.9.3
Software Suite for Advanced General Ensemble Simulations
MockCV.h
1 
21 #pragma once
22 
23 #include <array>
24 #include <cmath>
25 #include "CollectiveVariable.h"
26 #include "Snapshot.h"
27 
28 namespace SSAGES
29 {
31  class MockCV : public CollectiveVariable
32  {
33  private:
36 
37  public:
38 
40 
48  MockCV(double value, const Vector3& grad, double upper, double lower) :
49  usergrad_(grad)
50  {
51  val_ = value;
52  bounds_ = {{upper, lower}};
53  }
54 
56 
59  void Initialize(const Snapshot& snapshot) override
60  {
61  // Initialize gradient
62  auto n = snapshot.GetPositions().size();
63  grad_.resize(n, usergrad_);
64  }
65 
67 
70  void Evaluate(const Snapshot& snapshot) override
71  {
72 
73  }
74  };
75 }
Abstract class for a collective variable.
std::vector< Vector3 > grad_
Gradient vector dCv/dxi.
double val_
Current value of CV.
std::array< double, 2 > bounds_
Bounds on CV.
Mock collective variable for testing purposes.
Definition: MockCV.h:32
void Evaluate(const Snapshot &snapshot) override
Evaluate the CV.
Definition: MockCV.h:70
MockCV(double value, const Vector3 &grad, double upper, double lower)
Constructor.
Definition: MockCV.h:48
Vector3 usergrad_
User defined gradient vector.
Definition: MockCV.h:35
void Initialize(const Snapshot &snapshot) override
Initialize necessary variables.
Definition: MockCV.h:59
Class containing a snapshot of the current simulation in time.
Definition: Snapshot.h:48
const std::vector< Vector3 > & GetPositions() const
Access the particle positions.
Definition: Snapshot.h:325
Eigen::Vector3d Vector3
Three-dimensional vector.
Definition: types.h:33