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 |
|
/** |
51 |
|
#include "integrators/VelocityVerletIntegrator.hpp" |
52 |
|
#include "integrators/DLM.hpp" |
53 |
|
#include "utils/StringUtils.hpp" |
54 |
+ |
#include "utils/ProgressBar.hpp" |
55 |
|
|
56 |
|
namespace OpenMD { |
57 |
|
VelocityVerletIntegrator::VelocityVerletIntegrator(SimInfo *info) : Integrator(info), rotAlgo(NULL) { |
67 |
|
|
68 |
|
void VelocityVerletIntegrator::initialize(){ |
69 |
|
|
70 |
< |
forceMan_->init(); |
70 |
> |
forceMan_->initialize(); |
71 |
|
|
72 |
|
// remove center of mass drift velocity (in case we passed in a |
73 |
|
// configuration that was drifting) |
74 |
|
velocitizer_->removeComDrift(); |
75 |
|
|
76 |
|
// initialize the forces before the first step |
77 |
< |
calcForce(true, true); |
77 |
> |
calcForce(); |
78 |
|
|
79 |
|
// execute the constraint algorithm to make sure that the system is |
80 |
|
// constrained at the very beginning |
81 |
|
if (info_->getNGlobalConstraints() > 0) { |
82 |
|
rattle->constraintA(); |
83 |
< |
calcForce(true, true); |
83 |
> |
calcForce(); |
84 |
|
rattle->constraintB(); |
85 |
|
//copy the current snapshot to previous snapshot |
86 |
|
info_->getSnapshotManager()->advance(); |
96 |
|
|
97 |
|
dumpWriter->writeDumpAndEor(); |
98 |
|
|
99 |
+ |
progressBar = new ProgressBar(); |
100 |
+ |
|
101 |
|
//save statistics, before writeStat, we must save statistics |
102 |
|
thermo.saveStat(); |
103 |
|
saveConservedQuantity(); |
119 |
|
needStress = false; |
120 |
|
|
121 |
|
} |
122 |
< |
|
122 |
> |
|
123 |
|
void VelocityVerletIntegrator::doIntegrate() { |
124 |
|
|
125 |
|
|
132 |
|
integrateStep(); |
133 |
|
|
134 |
|
postStep(); |
135 |
< |
|
135 |
> |
|
136 |
|
} |
137 |
|
|
138 |
|
finalize(); |
164 |
|
} |
165 |
|
} |
166 |
|
if (useRNEMD) { |
163 |
– |
rnemd_->collectData(); |
167 |
|
if (currentSnapshot_->getTime() >= currRNEMD) { |
168 |
|
rnemd_->doRNEMD(); |
169 |
|
currRNEMD += RNEMD_exchangeTime; |
170 |
|
} |
171 |
+ |
rnemd_->collectData(); |
172 |
|
} |
173 |
|
|
174 |
|
if (currentSnapshot_->getTime() >= currSample) { |
187 |
|
} |
188 |
|
|
189 |
|
statWriter->writeStat(currentSnapshot_->statData); |
190 |
< |
|
190 |
> |
|
191 |
> |
progressBar->setStatus(currentSnapshot_->getTime(), runTime); |
192 |
> |
progressBar->update(); |
193 |
> |
|
194 |
|
needPotential = false; |
195 |
|
needStress = false; |
196 |
|
currStatus += statusTime; |
217 |
|
void VelocityVerletIntegrator::integrateStep() { |
218 |
|
|
219 |
|
moveA(); |
220 |
< |
calcForce(needPotential, needStress); |
220 |
> |
calcForce(); |
221 |
|
moveB(); |
222 |
|
} |
223 |
|
|
224 |
|
|
225 |
< |
void VelocityVerletIntegrator::calcForce(bool needPotential, |
226 |
< |
bool needStress) { |
220 |
< |
forceMan_->calcForces(needPotential, needStress); |
225 |
> |
void VelocityVerletIntegrator::calcForce() { |
226 |
> |
forceMan_->calcForces(); |
227 |
|
} |
228 |
|
|
229 |
|
DumpWriter* VelocityVerletIntegrator::createDumpWriter() { |