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 |
|
/** |
51 |
|
#include "integrators/DLM.hpp" |
52 |
|
#include "utils/StringUtils.hpp" |
53 |
|
|
54 |
< |
namespace oopse { |
54 |
> |
namespace OpenMD { |
55 |
|
VelocityVerletIntegrator::VelocityVerletIntegrator(SimInfo *info) : Integrator(info), rotAlgo(NULL) { |
56 |
|
dt2 = 0.5 * dt; |
57 |
|
rotAlgo = new DLM(); |
94 |
|
|
95 |
|
dumpWriter->writeDumpAndEor(); |
96 |
|
|
97 |
– |
if (simParams->getUseSolidThermInt()) { |
98 |
– |
restWriter = createRestWriter(); |
99 |
– |
restWriter->writeZAngFile(); |
100 |
– |
} |
101 |
– |
|
97 |
|
//save statistics, before writeStat, we must save statistics |
98 |
|
thermo.saveStat(); |
99 |
|
saveConservedQuantity(); |
100 |
|
if (simParams->getUseRNEMD()) |
101 |
< |
rnemd_->getStatus(); |
101 |
> |
rnemd_->getStarted(); |
102 |
|
|
103 |
|
statWriter->writeStat(currentSnapshot_->statData); |
104 |
|
|
109 |
|
currReset = resetTime + currentSnapshot_->getTime(); |
110 |
|
} |
111 |
|
if (simParams->getUseRNEMD()){ |
112 |
< |
currRNEMD = RNEMD_swapTime + currentSnapshot_->getTime(); |
112 |
> |
currRNEMD = RNEMD_exchangeTime + currentSnapshot_->getTime(); |
113 |
|
} |
114 |
|
needPotential = false; |
115 |
|
needStress = false; |
139 |
|
void VelocityVerletIntegrator::preStep() { |
140 |
|
RealType difference = currentSnapshot_->getTime() + dt - currStatus; |
141 |
|
|
142 |
< |
if (difference > 0 || fabs(difference) < oopse::epsilon) { |
142 |
> |
if (difference > 0 || fabs(difference) < OpenMD::epsilon) { |
143 |
|
needPotential = true; |
144 |
|
needStress = true; |
145 |
|
} |
160 |
|
} |
161 |
|
} |
162 |
|
if (useRNEMD) { |
163 |
+ |
rnemd_->collectData(); |
164 |
|
if (currentSnapshot_->getTime() >= currRNEMD) { |
165 |
< |
rnemd_->doSwap(); |
166 |
< |
currRNEMD += RNEMD_swapTime; |
165 |
> |
rnemd_->doRNEMD(); |
166 |
> |
currRNEMD += RNEMD_exchangeTime; |
167 |
|
} |
168 |
|
} |
169 |
|
|
170 |
|
if (currentSnapshot_->getTime() >= currSample) { |
171 |
|
dumpWriter->writeDumpAndEor(); |
172 |
|
|
177 |
– |
if (simParams->getUseSolidThermInt()) |
178 |
– |
restWriter->writeZAngFile(); |
179 |
– |
|
173 |
|
currSample += sampleTime; |
174 |
|
} |
175 |
|
|
178 |
|
thermo.saveStat(); |
179 |
|
saveConservedQuantity(); |
180 |
|
|
181 |
< |
if (simParams->getUseRNEMD()) |
181 |
> |
if (simParams->getUseRNEMD()) { |
182 |
|
rnemd_->getStatus(); |
183 |
+ |
} |
184 |
|
|
185 |
|
statWriter->writeStat(currentSnapshot_->statData); |
186 |
|
|
199 |
|
void VelocityVerletIntegrator::finalize() { |
200 |
|
dumpWriter->writeEor(); |
201 |
|
|
208 |
– |
if (simParams->getUseSolidThermInt()) { |
209 |
– |
restWriter->writeZAngFile(); |
210 |
– |
delete restWriter; |
211 |
– |
restWriter = NULL; |
212 |
– |
} |
213 |
– |
|
202 |
|
delete dumpWriter; |
203 |
|
delete statWriter; |
204 |
|
|
228 |
|
|
229 |
|
std::string statFileFormatString = simParams->getStatFileFormat(); |
230 |
|
StatsBitSet mask = parseStatFileFormat(statFileFormatString); |
231 |
< |
|
232 |
< |
// if solidThermInt is true, add extra information to the statfile |
233 |
< |
if (simParams->getUseSolidThermInt()){ |
231 |
> |
|
232 |
> |
// if we're doing a thermodynamic integration, we'll want the raw |
233 |
> |
// potential as well as the full potential: |
234 |
> |
|
235 |
> |
|
236 |
> |
if (simParams->getUseThermodynamicIntegration()) |
237 |
|
mask.set(Stats::VRAW); |
238 |
+ |
|
239 |
+ |
// if we've got restraints turned on, we'll also want a report of the |
240 |
+ |
// total harmonic restraints |
241 |
+ |
if (simParams->getUseRestraints()){ |
242 |
|
mask.set(Stats::VHARM); |
243 |
|
} |
244 |
|
|
268 |
|
} |
269 |
|
|
270 |
|
if (simParams->getUseRNEMD()) { |
271 |
< |
mask.set(Stats::RNEMD_SWAP_TOTAL); |
271 |
> |
mask.set(Stats::RNEMD_EXCHANGE_TOTAL); |
272 |
|
} |
273 |
< |
|
273 |
> |
|
274 |
|
|
275 |
< |
return new StatWriter(info_->getStatFileName(), mask); |
275 |
> |
return new StatWriter(info_->getStatFileName(), mask); |
276 |
|
} |
277 |
|
|
283 |
– |
RestWriter* VelocityVerletIntegrator::createRestWriter(){ |
284 |
– |
return new RestWriter(info_); |
285 |
– |
} |
278 |
|
|
279 |
< |
|
288 |
< |
} //end namespace oopse |
279 |
> |
} //end namespace OpenMD |