43 |
|
#include "brains/Snapshot.hpp" |
44 |
|
#include "integrators/Integrator.hpp" |
45 |
|
#include "integrators/DLM.hpp" |
46 |
< |
#include "integrators/FluctuatingChargeNVT.hpp" |
46 |
> |
#include "flucq/FluctuatingChargeNVT.hpp" |
47 |
|
#include "utils/simError.h" |
48 |
|
|
49 |
|
namespace OpenMD { |
52 |
|
needReset(false), velocitizer_(NULL), needVelocityScaling(false), |
53 |
|
rnemd_(NULL), useRNEMD(false), rotAlgo_(NULL), flucQ_(NULL), |
54 |
|
rattle_(NULL), dumpWriter(NULL), statWriter(NULL), thermo(info), |
55 |
< |
currentSnapshot_(info->getSnapshotManager()->getCurrentSnapshot()) { |
55 |
> |
snap(info->getSnapshotManager()->getCurrentSnapshot()) { |
56 |
|
|
57 |
|
simParams = info->getSimParams(); |
58 |
|
|
73 |
|
painCave.isFatal = 1; |
74 |
|
simError(); |
75 |
|
} |
76 |
+ |
|
77 |
|
// set the status, sample, and thermal kick times |
78 |
|
if (simParams->haveSampleTime()){ |
79 |
|
sampleTime = simParams->getSampleTime(); |
82 |
|
sampleTime = simParams->getRunTime(); |
83 |
|
statusTime = sampleTime; |
84 |
|
} |
85 |
< |
|
85 |
> |
|
86 |
|
if (simParams->haveStatusTime()){ |
87 |
|
statusTime = simParams->getStatusTime(); |
88 |
|
} |
89 |
< |
|
89 |
> |
|
90 |
|
if (simParams->haveThermalTime()){ |
91 |
|
thermalTime = simParams->getThermalTime(); |
92 |
|
} else { |
93 |
|
thermalTime = simParams->getRunTime(); |
94 |
|
} |
95 |
< |
|
95 |
> |
|
96 |
|
if (!simParams->getUseInitalTime()) { |
97 |
< |
currentSnapshot_->setTime(0.0); |
97 |
> |
snap->setTime(0.0); |
98 |
|
} |
99 |
< |
|
99 |
> |
|
100 |
|
if (simParams->haveResetTime()) { |
101 |
|
needReset = true; |
102 |
|
resetTime = simParams->getResetTime(); |
103 |
|
} |
104 |
< |
|
104 |
> |
|
105 |
|
// Create a default ForceManager: If the subclass wants to use |
106 |
|
// a different ForceManager, use setForceManager |
106 |
– |
|
107 |
|
forceMan_ = new ForceManager(info); |
108 |
< |
|
108 |
> |
|
109 |
|
// check for the temperature set flag (velocity scaling) |
110 |
+ |
needVelocityScaling = false; |
111 |
|
if (simParams->haveTempSet()) { |
112 |
|
needVelocityScaling = simParams->getTempSet(); |
113 |
+ |
} |
114 |
|
|
115 |
+ |
if (needVelocityScaling) { |
116 |
|
if (simParams->haveTargetTemp()) { |
117 |
|
targetScalingTemp = simParams->getTargetTemp(); |
118 |
|
} |
119 |
|
else { |
120 |
|
sprintf(painCave.errMsg, |
121 |
< |
"Integrator Error: Target Temperature is not set\n"); |
121 |
> |
"Integrator Error: Target Temperature must be set to turn on tempSet\n"); |
122 |
|
painCave.isFatal = 1; |
123 |
|
simError(); |
124 |
|
|
125 |
|
} |
126 |
|
} |
127 |
< |
|
127 |
> |
|
128 |
|
// Create a default a velocitizer: If the subclass wants to use |
129 |
|
// a different velocitizer, use setVelocitizer |
130 |
|
velocitizer_ = new Velocitizer(info); |
131 |
< |
|
132 |
< |
if (simParams->haveUseRNEMD()) { |
133 |
< |
if (simParams->getUseRNEMD()) { |
131 |
> |
|
132 |
> |
if (simParams->getRNEMDParameters()->haveUseRNEMD()) { |
133 |
> |
if (simParams->getRNEMDParameters()->getUseRNEMD()) { |
134 |
|
// Create a default a RNEMD. |
135 |
|
rnemd_ = new RNEMD(info); |
136 |
< |
useRNEMD = simParams->getUseRNEMD(); |
137 |
< |
if (simParams->haveRNEMD_exchangeTime()) { |
138 |
< |
RNEMD_exchangeTime = simParams->getRNEMD_exchangeTime(); |
136 |
> |
useRNEMD = simParams->getRNEMDParameters()->getUseRNEMD(); |
137 |
> |
if (simParams->getRNEMDParameters()->haveExchangeTime()) { |
138 |
> |
RNEMD_exchangeTime = simParams->getRNEMDParameters()->getExchangeTime(); |
139 |
|
} |
140 |
|
} |
141 |
|
} |
142 |
< |
|
142 |
> |
|
143 |
|
rotAlgo_ = new DLM(); |
144 |
|
rattle_ = new Rattle(info); |
145 |
|
flucQ_ = new FluctuatingChargeNVT(info); |
146 |
+ |
flucQ_->setForceManager(forceMan_); |
147 |
|
} |
148 |
|
|
149 |
|
Integrator::~Integrator(){ |