# | Line 32 | Line 32 | template<typename T> Integrator<T>::Integrator(SimInfo | |
---|---|---|
32 | ||
33 | nAtoms = info->n_atoms; | |
34 | integrableObjects = info->integrableObjects; | |
35 | < | |
35 | > | |
36 | // check for constraints | |
37 | ||
38 | constrainedA = NULL; | |
# | Line 45 | Line 45 | template<typename T> Integrator<T>::Integrator(SimInfo | |
45 | nConstrained = 0; | |
46 | ||
47 | checkConstraints(); | |
48 | + | |
49 | + | for (i=0; i<nMols; i++) |
50 | + | zAngle[i] = 0.0; |
51 | } | |
52 | ||
53 | template<typename T> Integrator<T>::~Integrator(){ | |
# | Line 160 | Line 163 | template<typename T> void Integrator<T>::integrate(voi | |
163 | double thermalTime = info->thermalTime; | |
164 | double resetTime = info->resetTime; | |
165 | ||
166 | < | |
166 | > | double difference; |
167 | double currSample; | |
168 | double currThermal; | |
169 | double currStatus; | |
# | Line 178 | Line 181 | template<typename T> void Integrator<T>::integrate(voi | |
181 | dt2 = 0.5 * dt; | |
182 | ||
183 | readyCheck(); | |
184 | + | |
185 | + | // remove center of mass drift velocity (in case we passed in a configuration |
186 | + | // that was drifting |
187 | + | tStats->removeCOMdrift(); |
188 | + | |
189 | + | // initialize the retraints if necessary |
190 | + | if (info->useThermInt) { |
191 | + | myFF->initRestraints(); |
192 | + | } |
193 | ||
194 | // initialize the forces before the first step | |
195 | ||
# | Line 211 | Line 223 | template<typename T> void Integrator<T>::integrate(voi | |
223 | #endif // is_mpi | |
224 | ||
225 | while (info->getTime() < runTime && !stopIntegrator()){ | |
226 | < | if ((info->getTime() + dt) >= currStatus){ |
226 | > | difference = info->getTime() + dt - currStatus; |
227 | > | if (difference > 0 || fabs(difference) < 1e-4 ){ |
228 | calcPot = 1; | |
229 | calcStress = 1; | |
230 | } | |
# | Line 244 | Line 257 | template<typename T> void Integrator<T>::integrate(voi | |
257 | ||
258 | if (info->getTime() >= currStatus){ | |
259 | statOut->writeStat(info->getTime()); | |
260 | + | statOut->writeRaw(info->getTime()); |
261 | calcPot = 0; | |
262 | calcStress = 0; | |
263 | currStatus += statusTime; | |
# | Line 265 | Line 279 | template<typename T> void Integrator<T>::integrate(voi | |
279 | MPIcheckPoint(); | |
280 | #endif // is_mpi | |
281 | } | |
282 | + | |
283 | + | // dump out a file containing the omega values for the final configuration |
284 | + | if (info->useThermInt) |
285 | + | myFF->dumpzAngle(); |
286 | + | |
287 | ||
288 | delete dumpOut; | |
289 | delete statOut; | |
# | Line 710 | Line 729 | template<typename T> void Integrator<T>::rotationPropa | |
729 | this->rotate( k, i, angle, ji, A ); | |
730 | ||
731 | } else { | |
732 | < | // rotate about the x-axis |
733 | < | angle = dt2 * ji[0] / I[0][0]; |
734 | < | this->rotate( 1, 2, angle, ji, A ); |
735 | < | |
736 | < | // rotate about the y-axis |
737 | < | angle = dt2 * ji[1] / I[1][1]; |
738 | < | this->rotate( 2, 0, angle, ji, A ); |
739 | < | |
740 | < | // rotate about the z-axis |
741 | < | angle = dt * ji[2] / I[2][2]; |
742 | < | this->rotate( 0, 1, angle, ji, A); |
743 | < | |
744 | < | // rotate about the y-axis |
745 | < | angle = dt2 * ji[1] / I[1][1]; |
746 | < | this->rotate( 2, 0, angle, ji, A ); |
747 | < | |
748 | < | // rotate about the x-axis |
749 | < | angle = dt2 * ji[0] / I[0][0]; |
750 | < | this->rotate( 1, 2, angle, ji, A ); |
751 | < | |
732 | > | // rotate about the x-axis |
733 | > | angle = dt2 * ji[0] / I[0][0]; |
734 | > | this->rotate( 1, 2, angle, ji, A ); |
735 | > | |
736 | > | // rotate about the y-axis |
737 | > | angle = dt2 * ji[1] / I[1][1]; |
738 | > | this->rotate( 2, 0, angle, ji, A ); |
739 | > | |
740 | > | // rotate about the z-axis |
741 | > | angle = dt * ji[2] / I[2][2]; |
742 | > | this->rotate( 0, 1, angle, ji, A); |
743 | > | |
744 | > | // rotate about the y-axis |
745 | > | angle = dt2 * ji[1] / I[1][1]; |
746 | > | this->rotate( 2, 0, angle, ji, A ); |
747 | > | |
748 | > | // rotate about the x-axis |
749 | > | angle = dt2 * ji[0] / I[0][0]; |
750 | > | this->rotate( 1, 2, angle, ji, A ); |
751 | > | |
752 | } | |
753 | sd->setA( A ); | |
754 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |