SSAGES  0.8.3
Software Suite for Advanced General Ensemble Simulations
CollectiveVariable.cpp
1 
22 #include "CollectiveVariable.h"
23 #include "AlphaRMSDCV.h"
24 #include "CVManager.h"
25 #include "AngleCV.h"
26 #include "AntiBetaRMSDCV.h"
27 #include "BoxVolumeCV.h"
28 #include "GyrationTensorCV.h"
29 #include "PairwiseCV.h"
30 #include "ParallelBetaRMSDCV.h"
31 #include "ParticleCoordinateCV.h"
32 #include "ParticlePositionCV.h"
33 #include "ParticleSeparationCV.h"
34 #include "RouseModeCV.h"
35 #include "TorsionalCV.h"
36 #include "json/json.h"
37 #include <stdexcept>
38 
39 namespace SSAGES
40 {
41  CollectiveVariable* CollectiveVariable::BuildCV(const Json::Value &json, const std::string& path)
42  {
43  // Get CV type.
44  auto type = json.get("type", "none").asString();
45 
46  if(type == "Angle")
47  return AngleCV::Build(json, path);
48  else if(type == "BoxVolume")
49  return BoxVolumeCV::Build(json, path);
50  else if(type == "GyrationTensor")
51  return GyrationTensorCV::Build(json, path);
52  else if(type == "Pairwise")
53  return PairwiseCV::Build(json, path);
54  else if(type == "ParticleCoordinate")
55  return ParticleCoordinateCV::Build(json, path);
56  else if(type == "ParticlePosition")
57  return ParticlePositionCV::Build(json, path);
58  else if(type == "ParticleSeparation")
59  return ParticleSeparationCV::Build(json, path);
60  else if(type == "RouseMode")
61  return RouseModeCV::Build(json, path);
62  else if(type == "Torsional")
63  return TorsionalCV::Build(json, path);
64  else if (type == "AlphaRMSD")
65  return AlphaRMSDCV::Build(json, path);
66  else if (type == "ParallelBetaRMSD")
67  return ParallelBetaRMSDCV::Build(json, path);
68  else if (type == "AntiBetaRMSD")
69  return AntiBetaRMSDCV::Build(json, path);
70  else
71  throw std::invalid_argument(path + ": Unknown CV type specified.");
72  }
73 
74  std::map<std::string, unsigned int> CVManager::cvmap_ = {};
75 }
static GyrationTensorCV * Build(const Json::Value &json, const std::string &path)
Set up collective variable.
static AntiBetaRMSDCV * Build(const Json::Value &json, const std::string &path)
Set up collective variable.
static ParticleSeparationCV * Build(const Json::Value &json, const std::string &path)
Set up collective variable.
static PairwiseCV * Build(const Json::Value &json, const std::string &path)
Set up collective variable.
Definition: PairwiseCV.h:200
static BoxVolumeCV * Build(const Json::Value &json, const std::string &path)
Set up collective variable.
Definition: BoxVolumeCV.h:65
static TorsionalCV * Build(const Json::Value &json, const std::string &path)
Set up collective variable.
Definition: TorsionalCV.h:229
static std::map< std::string, unsigned int > cvmap_
Map between CV names and ID&#39;s.
Definition: CVManager.h:47
static AngleCV * Build(const Json::Value &json, const std::string &path)
Set up collective variable.
Definition: AngleCV.h:136
static RouseModeCV * Build(const Json::Value &json, const std::string &path)
Set up collective variable.
Definition: RouseModeCV.h:192
static ParticlePositionCV * Build(const Json::Value &json, const std::string &path)
Set up collective variable.
Abstract class for a collective variable.
static AlphaRMSDCV * Build(const Json::Value &json, const std::string &path)
Set up collective variable.
Definition: AlphaRMSDCV.h:233
static ParallelBetaRMSDCV * Build(const Json::Value &json, const std::string &path)
Set up collective variable.
static CollectiveVariable * BuildCV(const Json::Value &json, const std::string &path)
Set up collective variable.
static ParticleCoordinateCV * Build(const Json::Value &json, const std::string &path)
Set up collective variable.