1 #include "HMCIntegrator.h"
2 #include "Report.h"
3 #include "mathutilities.h"
4 #include "pmconstants.h"
5 #include "Vector3DBlock.h"
6 #include "ScalarStructure.h"
7 #include "topologyutilities.h"
8 
9 using namespace ProtoMol::Report;
10 using std::vector;
11 using std::string;
12 
13 namespace ProtoMol {
14   //____________________________________________________________ HMCIntegrator
15 
16   const string HMCIntegrator::keyword("HybridMC");
17 
18   const int HMCIntegrator::myNumParameters(3);
19 
20   //  ---------------------------------------------------------------------  //
21 
HMCIntegrator()22   HMCIntegrator::HMCIntegrator()
23     : MCIntegrator() {}
24 
25   //  ---------------------------------------------------------------------  //
26 
HMCIntegrator(int cycles,bool randomCycLen,Real initialTemperature,ForceGroup * overloadedForces,StandardIntegrator * nextIntegrator)27   HMCIntegrator::HMCIntegrator(int cycles,
28 			       bool randomCycLen,
29 			       Real initialTemperature,
30 			       ForceGroup *overloadedForces,
31 			       StandardIntegrator *nextIntegrator)
32 
33     : MCIntegrator(cycles, randomCycLen, initialTemperature, overloadedForces,
34             nextIntegrator) {
35   }
36 
37   //  ---------------------------------------------------------------------  //
38 
initialize(GenericTopology * topo,Vector3DBlock * positions,Vector3DBlock * velocities,ScalarStructure * energies)39   void HMCIntegrator::initialize(GenericTopology *topo,
40 				 Vector3DBlock *positions,
41 				 Vector3DBlock *velocities,
42 				 ScalarStructure *energies){
43     MCIntegrator::initialize(topo,positions,velocities,energies);
44   }
45 
46   //  ---------------------------------------------------------------------  //
47 
doMake(string &,const vector<Value> & values,ForceGroup * fg,StandardIntegrator * nextIntegrator) const48   MTSIntegrator*  HMCIntegrator::doMake(string& , const vector<Value>& values,
49 					ForceGroup* fg, StandardIntegrator *nextIntegrator)const{
50 
51       return new HMCIntegrator(values[0],values[1],values[2],fg,nextIntegrator);
52 
53   }
54 
55   //  ---------------------------------------------------------------------  //
56 
perturbSystem()57   void HMCIntegrator::perturbSystem() {
58     randomVelocity(getInitialTemperature(), myTopo,myVelocities);
59     buildMolecularMomentum(myVelocities,myTopo);
60   }
61 
62   //  ---------------------------------------------------------------------  //
63 
saveValues()64   void HMCIntegrator::saveValues(){
65     MCIntegrator::saveValues();
66   }
67 
68   //  ---------------------------------------------------------------------  //
69 
restoreValues()70   void HMCIntegrator::restoreValues(){
71     MCIntegrator::restoreValues();
72   }
73 
74 }
75