6 |
|
* redistribute this software in source and binary code form, provided |
7 |
|
* that the following conditions are met: |
8 |
|
* |
9 |
< |
* 1. Acknowledgement of the program authors must be made in any |
10 |
< |
* publication of scientific results based in part on use of the |
11 |
< |
* program. An acceptable form of acknowledgement is citation of |
12 |
< |
* the article in which the program was described (Matthew |
13 |
< |
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
14 |
< |
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
15 |
< |
* Parallel Simulation Engine for Molecular Dynamics," |
16 |
< |
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
17 |
< |
* |
18 |
< |
* 2. Redistributions of source code must retain the above copyright |
9 |
> |
* 1. Redistributions of source code must retain the above copyright |
10 |
|
* notice, this list of conditions and the following disclaimer. |
11 |
|
* |
12 |
< |
* 3. Redistributions in binary form must reproduce the above copyright |
12 |
> |
* 2. Redistributions in binary form must reproduce the above copyright |
13 |
|
* notice, this list of conditions and the following disclaimer in the |
14 |
|
* documentation and/or other materials provided with the |
15 |
|
* distribution. |
28 |
|
* arising out of the use of or inability to use software, even if the |
29 |
|
* University of Notre Dame has been advised of the possibility of |
30 |
|
* such damages. |
31 |
+ |
* |
32 |
+ |
* SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your |
33 |
+ |
* research, please cite the appropriate papers when you publish your |
34 |
+ |
* work. Good starting points are: |
35 |
+ |
* |
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). |
40 |
|
*/ |
41 |
|
|
42 |
|
/** |
50 |
|
#include "integrators/VelocityVerletIntegrator.hpp" |
51 |
|
#include "integrators/DLM.hpp" |
52 |
|
#include "utils/StringUtils.hpp" |
53 |
+ |
#include "utils/ProgressBar.hpp" |
54 |
|
|
55 |
< |
namespace oopse { |
55 |
> |
namespace OpenMD { |
56 |
|
VelocityVerletIntegrator::VelocityVerletIntegrator(SimInfo *info) : Integrator(info), rotAlgo(NULL) { |
57 |
|
dt2 = 0.5 * dt; |
58 |
|
rotAlgo = new DLM(); |
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(); |
142 |
|
void VelocityVerletIntegrator::preStep() { |
143 |
|
RealType difference = currentSnapshot_->getTime() + dt - currStatus; |
144 |
|
|
145 |
< |
if (difference > 0 || fabs(difference) < oopse::epsilon) { |
145 |
> |
if (difference > 0 || fabs(difference) < OpenMD::epsilon) { |
146 |
|
needPotential = true; |
147 |
|
needStress = true; |
148 |
|
} |
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() { |
281 |
|
} |
282 |
|
|
283 |
|
|
284 |
< |
} //end namespace oopse |
284 |
> |
} //end namespace OpenMD |