36 |
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
37 |
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
38 |
|
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
39 |
< |
* [4] Vardeman & Gezelter, in progress (2009). |
39 |
> |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
> |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
42 |
|
|
43 |
|
/** |
201 |
|
// electrostaticSummationMethod keyword. |
202 |
|
|
203 |
|
if (simParams_->haveElectrostaticSummationMethod()) { |
204 |
< |
std::string myMethod = simParams_->getElectrostaticSummationMethod(); |
204 |
> |
string myMethod = simParams_->getElectrostaticSummationMethod(); |
205 |
|
toUpper(myMethod); |
206 |
|
|
207 |
|
if (myMethod == "SHIFTED_POTENTIAL") { |
256 |
|
stringToCutoffPolicy["MAX"] = MAX; |
257 |
|
stringToCutoffPolicy["TRADITIONAL"] = TRADITIONAL; |
258 |
|
|
259 |
< |
std::string cutPolicy; |
259 |
> |
string cutPolicy; |
260 |
|
if (forceFieldOptions_.haveCutoffPolicy()){ |
261 |
|
cutPolicy = forceFieldOptions_.getCutoffPolicy(); |
262 |
|
}else if (simParams_->haveCutoffPolicy()) { |
318 |
|
simError(); |
319 |
|
} |
320 |
|
} else { |
321 |
< |
if (simParams_->haveSwitchingRadius()) { |
322 |
< |
map<string, CutoffMethod>::const_iterator it; |
323 |
< |
string theMeth; |
324 |
< |
for (it = stringToCutoffMethod.begin(); |
325 |
< |
it != stringToCutoffMethod.end(); ++it) { |
326 |
< |
if (it->second == cutoffMethod_) { |
327 |
< |
theMeth = it->first; |
328 |
< |
break; |
321 |
> |
if (mdFileVersion > 1) { |
322 |
> |
// throw an error if we define a switching radius and don't need one. |
323 |
> |
// older file versions should not do this. |
324 |
> |
if (simParams_->haveSwitchingRadius()) { |
325 |
> |
map<string, CutoffMethod>::const_iterator it; |
326 |
> |
string theMeth; |
327 |
> |
for (it = stringToCutoffMethod.begin(); |
328 |
> |
it != stringToCutoffMethod.end(); ++it) { |
329 |
> |
if (it->second == cutoffMethod_) { |
330 |
> |
theMeth = it->first; |
331 |
> |
break; |
332 |
> |
} |
333 |
|
} |
334 |
+ |
sprintf(painCave.errMsg, |
335 |
+ |
"ForceManager::setupCutoffs: the cutoffMethod (%s)\n" |
336 |
+ |
"\tis not set to SWITCHED, so switchingRadius value\n" |
337 |
+ |
"\twill be ignored for this simulation\n", theMeth.c_str()); |
338 |
+ |
painCave.isFatal = 0; |
339 |
+ |
painCave.severity = OPENMD_WARNING; |
340 |
+ |
simError(); |
341 |
|
} |
330 |
– |
sprintf(painCave.errMsg, |
331 |
– |
"ForceManager::setupCutoffs: the cutoffMethod (%s)\n" |
332 |
– |
"\tis not set to SWITCHED, so switchingRadius value\n" |
333 |
– |
"\twill be ignored for this simulation\n", theMeth.c_str()); |
334 |
– |
painCave.isFatal = 0; |
335 |
– |
painCave.severity = OPENMD_WARNING; |
336 |
– |
simError(); |
342 |
|
} |
338 |
– |
|
343 |
|
rSwitch_ = rCut_; |
344 |
|
} |
345 |
|
|
388 |
|
setupCutoffs(); |
389 |
|
|
390 |
|
info_->prepareTopology(); |
391 |
+ |
|
392 |
+ |
doParticlePot_ = info_->getSimParams()->getOutputParticlePotential(); |
393 |
+ |
|
394 |
|
} |
395 |
|
|
396 |
|
ForceFieldOptions& fopts = forceField_->getForceFieldOptions(); |
505 |
|
|
506 |
|
for (bond = mol->beginBond(bondIter); bond != NULL; |
507 |
|
bond = mol->nextBond(bondIter)) { |
508 |
< |
bond->calcForce(); |
508 |
> |
bond->calcForce(doParticlePot_); |
509 |
|
bondPotential += bond->getPotential(); |
510 |
|
} |
511 |
|
|
513 |
|
bend = mol->nextBend(bendIter)) { |
514 |
|
|
515 |
|
RealType angle; |
516 |
< |
bend->calcForce(angle); |
516 |
> |
bend->calcForce(angle, doParticlePot_); |
517 |
|
RealType currBendPot = bend->getPotential(); |
518 |
|
|
519 |
|
bendPotential += bend->getPotential(); |
538 |
|
for (torsion = mol->beginTorsion(torsionIter); torsion != NULL; |
539 |
|
torsion = mol->nextTorsion(torsionIter)) { |
540 |
|
RealType angle; |
541 |
< |
torsion->calcForce(angle); |
541 |
> |
torsion->calcForce(angle, doParticlePot_); |
542 |
|
RealType currTorsionPot = torsion->getPotential(); |
543 |
|
torsionPotential += torsion->getPotential(); |
544 |
|
map<Torsion*, TorsionDataSet>::iterator i = torsionDataSets.find(torsion); |
562 |
|
inversion != NULL; |
563 |
|
inversion = mol->nextInversion(inversionIter)) { |
564 |
|
RealType angle; |
565 |
< |
inversion->calcForce(angle); |
565 |
> |
inversion->calcForce(angle, doParticlePot_); |
566 |
|
RealType currInversionPot = inversion->getPotential(); |
567 |
|
inversionPotential += inversion->getPotential(); |
568 |
|
map<Inversion*, InversionDataSet>::iterator i = inversionDataSets.find(inversion); |
641 |
|
RealType vpair; |
642 |
|
potVec longRangePotential(0.0); |
643 |
|
potVec workPot(0.0); |
644 |
+ |
vector<int>::iterator ia, jb; |
645 |
|
|
646 |
|
int loopStart, loopEnd; |
647 |
|
|
654 |
|
idat.sw = &sw; |
655 |
|
idat.shiftedPot = (cutoffMethod_ == SHIFTED_POTENTIAL) ? true : false; |
656 |
|
idat.shiftedForce = (cutoffMethod_ == SHIFTED_FORCE) ? true : false; |
657 |
+ |
idat.doParticlePot = doParticlePot_; |
658 |
+ |
sdat.doParticlePot = doParticlePot_; |
659 |
|
|
660 |
|
loopEnd = PAIR_LOOP; |
661 |
|
if (info_->requiresPrepair() ) { |
699 |
|
atomListRow = fDecomp_->getAtomsInGroupRow(cg1); |
700 |
|
atomListColumn = fDecomp_->getAtomsInGroupColumn(cg2); |
701 |
|
|
702 |
< |
for (vector<int>::iterator ia = atomListRow.begin(); |
702 |
> |
for (ia = atomListRow.begin(); |
703 |
|
ia != atomListRow.end(); ++ia) { |
704 |
|
atom1 = (*ia); |
705 |
|
|
706 |
< |
for (vector<int>::iterator jb = atomListColumn.begin(); |
706 |
> |
for (jb = atomListColumn.begin(); |
707 |
|
jb != atomListColumn.end(); ++jb) { |
708 |
|
atom2 = (*jb); |
709 |
|
|
755 |
|
tau -= outProduct( *(idat.d), fg); |
756 |
|
} |
757 |
|
|
758 |
< |
for (vector<int>::iterator ia = atomListRow.begin(); |
758 |
> |
for (ia = atomListRow.begin(); |
759 |
|
ia != atomListRow.end(); ++ia) { |
760 |
|
atom1 = (*ia); |
761 |
|
mf = fDecomp_->getMassFactorRow(atom1); |
772 |
|
} |
773 |
|
} |
774 |
|
} |
775 |
< |
for (vector<int>::iterator jb = atomListColumn.begin(); |
775 |
> |
for (jb = atomListColumn.begin(); |
776 |
|
jb != atomListColumn.end(); ++jb) { |
777 |
|
atom2 = (*jb); |
778 |
|
mf = fDecomp_->getMassFactorColumn(atom2); |
860 |
|
MPI_Allreduce(tmpTau.getArrayPointer(), tau.getArrayPointer(), |
861 |
|
9, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); |
862 |
|
#endif |
863 |
< |
curSnapshot->statData.setTau(tau); |
863 |
> |
curSnapshot->setTau(tau); |
864 |
|
} |
865 |
|
|
866 |
|
} //end namespace OpenMD |