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