40 |
|
*/ |
41 |
|
|
42 |
|
#include <cmath> |
43 |
< |
#include "integrators/RNEMD.hpp" |
43 |
> |
#include "rnemd/RNEMD.hpp" |
44 |
|
#include "math/Vector3.hpp" |
45 |
|
#include "math/Vector.hpp" |
46 |
|
#include "math/SquareMatrix3.hpp" |
70 |
|
|
71 |
|
int seedValue; |
72 |
|
Globals * simParams = info->getSimParams(); |
73 |
+ |
RNEMDParameters* rnemdParams = simParams->getRNEMDParameters(); |
74 |
|
|
75 |
|
stringToEnumMap_["KineticSwap"] = rnemdKineticSwap; |
76 |
|
stringToEnumMap_["KineticScale"] = rnemdKineticScale; |
89 |
|
runTime_ = simParams->getRunTime(); |
90 |
|
statusTime_ = simParams->getStatusTime(); |
91 |
|
|
92 |
< |
rnemdObjectSelection_ = simParams->getRNEMD_objectSelection(); |
92 |
> |
rnemdObjectSelection_ = rnemdParams->getObjectSelection(); |
93 |
|
evaluator_.loadScriptString(rnemdObjectSelection_); |
94 |
|
seleMan_.setSelectionSet(evaluator_.evaluate()); |
95 |
|
|
114 |
|
simError(); |
115 |
|
} |
116 |
|
|
117 |
< |
const string st = simParams->getRNEMD_exchangeType(); |
117 |
> |
const string st = rnemdParams->getExchangeType(); |
118 |
|
|
119 |
|
map<string, RNEMDTypeEnum>::iterator i; |
120 |
|
i = stringToEnumMap_.find(st); |
131 |
|
} |
132 |
|
|
133 |
|
outputTemp_ = false; |
134 |
< |
if (simParams->haveRNEMD_outputTemperature()) { |
135 |
< |
outputTemp_ = simParams->getRNEMD_outputTemperature(); |
134 |
> |
if (rnemdParams->haveOutputTemperature()) { |
135 |
> |
outputTemp_ = rnemdParams->getOutputTemperature(); |
136 |
|
} else if ((rnemdType_ == rnemdKineticSwap) || |
137 |
|
(rnemdType_ == rnemdKineticScale) || |
138 |
|
(rnemdType_ == rnemdKineticScaleVAM) || |
140 |
|
outputTemp_ = true; |
141 |
|
} |
142 |
|
outputVx_ = false; |
143 |
< |
if (simParams->haveRNEMD_outputVx()) { |
144 |
< |
outputVx_ = simParams->getRNEMD_outputVx(); |
143 |
> |
if (rnemdParams->haveOutputVx()) { |
144 |
> |
outputVx_ = rnemdParams->getOutputVx(); |
145 |
|
} else if ((rnemdType_ == rnemdPx) || (rnemdType_ == rnemdPxScale)) { |
146 |
|
outputVx_ = true; |
147 |
|
} |
148 |
|
outputVy_ = false; |
149 |
< |
if (simParams->haveRNEMD_outputVy()) { |
150 |
< |
outputVy_ = simParams->getRNEMD_outputVy(); |
149 |
> |
if (rnemdParams->haveOutputVy()) { |
150 |
> |
outputVy_ = rnemdParams->getOutputVy(); |
151 |
|
} else if ((rnemdType_ == rnemdPy) || (rnemdType_ == rnemdPyScale)) { |
152 |
|
outputVy_ = true; |
153 |
|
} |
154 |
|
output3DTemp_ = false; |
155 |
< |
if (simParams->haveRNEMD_outputXyzTemperature()) { |
156 |
< |
output3DTemp_ = simParams->getRNEMD_outputXyzTemperature(); |
155 |
> |
if (rnemdParams->haveOutputXyzTemperature()) { |
156 |
> |
output3DTemp_ = rnemdParams->getOutputXyzTemperature(); |
157 |
|
} |
158 |
|
outputRotTemp_ = false; |
159 |
< |
if (simParams->haveRNEMD_outputRotTemperature()) { |
160 |
< |
outputRotTemp_ = simParams->getRNEMD_outputRotTemperature(); |
159 |
> |
if (rnemdParams->haveOutputRotTemperature()) { |
160 |
> |
outputRotTemp_ = rnemdParams->getOutputRotTemperature(); |
161 |
|
} |
162 |
|
// James put this in. |
163 |
|
outputDen_ = false; |
164 |
< |
if (simParams->haveRNEMD_outputDen()) { |
165 |
< |
outputDen_ = simParams->getRNEMD_outputDen(); |
164 |
> |
if (rnemdParams->haveOutputDen()) { |
165 |
> |
outputDen_ = rnemdParams->getOutputDen(); |
166 |
|
} |
167 |
|
outputAh_ = false; |
168 |
< |
if (simParams->haveRNEMD_outputAh()) { |
169 |
< |
outputAh_ = simParams->getRNEMD_outputAh(); |
168 |
> |
if (rnemdParams->haveOutputAh()) { |
169 |
> |
outputAh_ = rnemdParams->getOutputAh(); |
170 |
|
} |
171 |
|
outputVz_ = false; |
172 |
< |
if (simParams->haveRNEMD_outputVz()) { |
173 |
< |
outputVz_ = simParams->getRNEMD_outputVz(); |
172 |
> |
if (rnemdParams->haveOutputVz()) { |
173 |
> |
outputVz_ = rnemdParams->getOutputVz(); |
174 |
|
} else if ((rnemdType_ == rnemdPz) || (rnemdType_ == rnemdPzScale)) { |
175 |
|
outputVz_ = true; |
176 |
|
} |
227 |
|
} |
228 |
|
#endif |
229 |
|
|
230 |
< |
set_RNEMD_exchange_time(simParams->getRNEMD_exchangeTime()); |
231 |
< |
set_RNEMD_nBins(simParams->getRNEMD_nBins()); |
230 |
> |
set_RNEMD_exchange_time(rnemdParams->getExchangeTime()); |
231 |
> |
set_RNEMD_nBins(rnemdParams->getNbins()); |
232 |
|
midBin_ = nBins_ / 2; |
233 |
< |
if (simParams->haveRNEMD_binShift()) { |
234 |
< |
if (simParams->getRNEMD_binShift()) { |
233 |
> |
if (rnemdParams->haveBinShift()) { |
234 |
> |
if (rnemdParams->getBinShift()) { |
235 |
|
zShift_ = 0.5 / (RealType)(nBins_); |
236 |
|
} else { |
237 |
|
zShift_ = 0.0; |
242 |
|
//cerr << "I shift slabs by " << zShift_ << " Lz\n"; |
243 |
|
//shift slabs by half slab width, maybe useful in heterogeneous systems |
244 |
|
//set to 0.0 if not using it; N/A in status output yet |
245 |
< |
if (simParams->haveRNEMD_logWidth()) { |
246 |
< |
set_RNEMD_logWidth(simParams->getRNEMD_logWidth()); |
245 |
> |
if (rnemdParams->haveLogWidth()) { |
246 |
> |
set_RNEMD_logWidth(rnemdParams->getLogWidth()); |
247 |
|
/*arbitary rnemdLogWidth_, no checking; |
248 |
|
if (rnemdLogWidth_ != nBins_ && rnemdLogWidth_ != midBin_ + 1) { |
249 |
|
cerr << "WARNING! RNEMD_logWidth has abnormal value!\n"; |
272 |
|
pzzHist_.resize(rnemdLogWidth_, 0.0); |
273 |
|
|
274 |
|
set_RNEMD_exchange_total(0.0); |
275 |
< |
if (simParams->haveRNEMD_targetFlux()) { |
276 |
< |
set_RNEMD_target_flux(simParams->getRNEMD_targetFlux()); |
275 |
> |
if (rnemdParams->haveTargetFlux()) { |
276 |
> |
set_RNEMD_target_flux(rnemdParams->getTargetFlux()); |
277 |
|
} else { |
278 |
|
set_RNEMD_target_flux(0.0); |
279 |
|
} |
280 |
< |
if (simParams->haveRNEMD_targetJzKE()) { |
281 |
< |
set_RNEMD_target_JzKE(simParams->getRNEMD_targetJzKE()); |
280 |
> |
if (rnemdParams->haveTargetJzKE()) { |
281 |
> |
set_RNEMD_target_JzKE(rnemdParams->getTargetJzKE()); |
282 |
|
} else { |
283 |
|
set_RNEMD_target_JzKE(0.0); |
284 |
|
} |
285 |
< |
if (simParams->haveRNEMD_targetJzpx()) { |
286 |
< |
set_RNEMD_target_jzpx(simParams->getRNEMD_targetJzpx()); |
285 |
> |
if (rnemdParams->haveTargetJzpx()) { |
286 |
> |
set_RNEMD_target_jzpx(rnemdParams->getTargetJzpx()); |
287 |
|
} else { |
288 |
|
set_RNEMD_target_jzpx(0.0); |
289 |
|
} |
290 |
|
jzp_.x() = targetJzpx_; |
291 |
|
njzp_.x() = -targetJzpx_; |
292 |
< |
if (simParams->haveRNEMD_targetJzpy()) { |
293 |
< |
set_RNEMD_target_jzpy(simParams->getRNEMD_targetJzpy()); |
292 |
> |
if (rnemdParams->haveTargetJzpy()) { |
293 |
> |
set_RNEMD_target_jzpy(rnemdParams->getTargetJzpy()); |
294 |
|
} else { |
295 |
|
set_RNEMD_target_jzpy(0.0); |
296 |
|
} |
297 |
|
jzp_.y() = targetJzpy_; |
298 |
|
njzp_.y() = -targetJzpy_; |
299 |
< |
if (simParams->haveRNEMD_targetJzpz()) { |
300 |
< |
set_RNEMD_target_jzpz(simParams->getRNEMD_targetJzpz()); |
299 |
> |
if (rnemdParams->haveTargetJzpz()) { |
300 |
> |
set_RNEMD_target_jzpz(rnemdParams->getTargetJzpz()); |
301 |
|
} else { |
302 |
|
set_RNEMD_target_jzpz(0.0); |
303 |
|
} |
1380 |
|
SimInfo::MoleculeIterator miter; |
1381 |
|
vector<StuntDouble*>::iterator iiter; |
1382 |
|
Molecule* mol; |
1383 |
< |
StuntDouble* integrableObject; |
1383 |
> |
StuntDouble* sd; |
1384 |
|
for (mol = info_->beginMolecule(miter); mol != NULL; |
1385 |
|
mol = info_->nextMolecule(miter)) |
1386 |
< |
integrableObject is essentially sd |
1387 |
< |
for (integrableObject = mol->beginIntegrableObject(iiter); |
1388 |
< |
integrableObject != NULL; |
1389 |
< |
integrableObject = mol->nextIntegrableObject(iiter)) |
1386 |
> |
sd is essentially sd |
1387 |
> |
for (sd = mol->beginIntegrableObject(iiter); |
1388 |
> |
sd != NULL; |
1389 |
> |
sd = mol->nextIntegrableObject(iiter)) |
1390 |
|
*/ |
1391 |
|
for (sd = seleMan_.beginSelected(selei); sd != NULL; |
1392 |
|
sd = seleMan_.nextSelected(selei)) { |
1512 |
|
void RNEMD::getStatus() { |
1513 |
|
|
1514 |
|
Snapshot* currentSnap_ = info_->getSnapshotManager()->getCurrentSnapshot(); |
1514 |
– |
Stats& stat = currentSnap_->statData; |
1515 |
|
RealType time = currentSnap_->getTime(); |
1516 |
– |
|
1517 |
– |
stat[Stats::RNEMD_EXCHANGE_TOTAL] = exchangeSum_; |
1516 |
|
//or to be more meaningful, define another item as exchangeSum_ / time |
1517 |
|
int j; |
1518 |
|
|