46 |
|
|
47 |
|
void VelocityVerletIntegrator::initialize(){ |
48 |
|
|
49 |
– |
currSample = 0.0; |
50 |
– |
currStatus = 0.0; |
51 |
– |
currThermal = 0.0; |
52 |
– |
needPotential = false; |
53 |
– |
needStress = false; |
54 |
– |
|
49 |
|
// remove center of mass drift velocity (in case we passed in a configuration |
50 |
|
// that was drifting |
51 |
|
velocitizer_->removeComDrift(); |
69 |
|
|
70 |
|
dumpWriter->writeDump(); |
71 |
|
|
72 |
< |
//save statistics |
72 |
> |
//save statistics, before writeStat, we must save statistics |
73 |
|
thermo.saveStat(); |
74 |
|
saveConservedQuantity(); |
81 |
– |
|
82 |
– |
//before writeStat, we must save statistics |
75 |
|
statWriter->writeStat(currentSnapshot_->statData); |
76 |
+ |
|
77 |
+ |
currSample = sampleTime + currentSnapshot_->getTime(); |
78 |
+ |
currStatus = statusTime + currentSnapshot_->getTime();; |
79 |
+ |
currThermal = thermalTime + + currentSnapshot_->getTime(); |
80 |
+ |
needPotential = false; |
81 |
+ |
needStress = false; |
82 |
|
|
83 |
|
} |
84 |
|
|
119 |
|
|
120 |
|
//increase time |
121 |
|
currentSnapshot_->increaseTime(dt); |
124 |
– |
|
125 |
– |
//save statistics |
126 |
– |
thermo.saveStat(); |
127 |
– |
saveConservedQuantity(); |
122 |
|
|
123 |
|
if (needVelocityScaling) { |
124 |
|
if (currentSnapshot_->getTime() >= currThermal) { |
133 |
|
} |
134 |
|
|
135 |
|
if (currentSnapshot_->getTime() >= currStatus) { |
136 |
+ |
//save statistics, before writeStat, we must save statistics |
137 |
+ |
thermo.saveStat(); |
138 |
+ |
saveConservedQuantity(); |
139 |
|
statWriter->writeStat(currentSnapshot_->statData); |
140 |
+ |
|
141 |
|
needPotential = false; |
142 |
|
needStress = false; |
143 |
|
currStatus += statusTime; |