| 153 |
|
double sampleTime = info->sampleTime; |
| 154 |
|
double statusTime = info->statusTime; |
| 155 |
|
double thermalTime = info->thermalTime; |
| 156 |
+ |
double resetTime = info->resetTime; |
| 157 |
|
|
| 158 |
+ |
|
| 159 |
|
double currSample; |
| 160 |
|
double currThermal; |
| 161 |
|
double currStatus; |
| 162 |
< |
|
| 162 |
> |
double currReset; |
| 163 |
> |
|
| 164 |
|
int calcPot, calcStress; |
| 165 |
|
int isError; |
| 166 |
|
|
| 182 |
|
thermalize(); |
| 183 |
|
} |
| 184 |
|
|
| 182 |
– |
calcPot = 0; |
| 183 |
– |
calcStress = 0; |
| 184 |
– |
currSample = sampleTime; |
| 185 |
– |
currThermal = thermalTime; |
| 186 |
– |
currStatus = statusTime; |
| 187 |
– |
|
| 185 |
|
calcPot = 0; |
| 186 |
|
calcStress = 0; |
| 187 |
|
currSample = sampleTime + info->getTime(); |
| 188 |
|
currThermal = thermalTime+ info->getTime(); |
| 189 |
|
currStatus = statusTime + info->getTime(); |
| 190 |
+ |
currReset = resetTime + info->getTime(); |
| 191 |
|
|
| 192 |
|
dumpOut->writeDump(info->getTime()); |
| 193 |
|
statOut->writeStat(info->getTime()); |
| 228 |
|
currStatus += statusTime; |
| 229 |
|
} |
| 230 |
|
|
| 231 |
+ |
if (info->resetIntegrator){ |
| 232 |
+ |
if (info->getTime() >= currReset){ |
| 233 |
+ |
this->resetIntegrator(); |
| 234 |
+ |
currReset += resetTime; |
| 235 |
+ |
} |
| 236 |
+ |
} |
| 237 |
+ |
|
| 238 |
|
#ifdef IS_MPI |
| 239 |
|
strcpy(checkPointMsg, "successfully took a time step."); |
| 240 |
|
MPIcheckPoint(); |
| 254 |
|
|
| 255 |
|
moveA(); |
| 256 |
|
|
| 252 |
– |
if (nConstrained){ |
| 253 |
– |
constrainA(); |
| 254 |
– |
} |
| 257 |
|
|
| 258 |
|
|
| 259 |
+ |
|
| 260 |
|
#ifdef IS_MPI |
| 261 |
|
strcpy(checkPointMsg, "Succesful moveA\n"); |
| 262 |
|
MPIcheckPoint(); |
| 277 |
|
|
| 278 |
|
moveB(); |
| 279 |
|
|
| 277 |
– |
if (nConstrained){ |
| 278 |
– |
constrainB(); |
| 279 |
– |
} |
| 280 |
|
|
| 281 |
+ |
|
| 282 |
|
#ifdef IS_MPI |
| 283 |
|
strcpy(checkPointMsg, "Succesful moveB\n"); |
| 284 |
|
MPIcheckPoint(); |
| 290 |
|
int i, j; |
| 291 |
|
DirectionalAtom* dAtom; |
| 292 |
|
double Tb[3], ji[3]; |
| 292 |
– |
double A[3][3], I[3][3]; |
| 293 |
– |
double angle; |
| 293 |
|
double vel[3], pos[3], frc[3]; |
| 294 |
|
double mass; |
| 295 |
|
|
| 325 |
|
for (j = 0; j < 3; j++) |
| 326 |
|
ji[j] += (dt2 * Tb[j]) * eConvert; |
| 327 |
|
|
| 328 |
< |
// use the angular velocities to propagate the rotation matrix a |
| 330 |
< |
// full time step |
| 331 |
< |
|
| 332 |
< |
dAtom->getA(A); |
| 333 |
< |
dAtom->getI(I); |
| 334 |
< |
|
| 335 |
< |
// rotate about the x-axis |
| 336 |
< |
angle = dt2 * ji[0] / I[0][0]; |
| 337 |
< |
this->rotate(1, 2, angle, ji, A); |
| 338 |
< |
|
| 339 |
< |
// rotate about the y-axis |
| 340 |
< |
angle = dt2 * ji[1] / I[1][1]; |
| 341 |
< |
this->rotate(2, 0, angle, ji, A); |
| 342 |
< |
|
| 343 |
< |
// rotate about the z-axis |
| 344 |
< |
angle = dt * ji[2] / I[2][2]; |
| 345 |
< |
this->rotate(0, 1, angle, ji, A); |
| 346 |
< |
|
| 347 |
< |
// rotate about the y-axis |
| 348 |
< |
angle = dt2 * ji[1] / I[1][1]; |
| 349 |
< |
this->rotate(2, 0, angle, ji, A); |
| 350 |
< |
|
| 351 |
< |
// rotate about the x-axis |
| 352 |
< |
angle = dt2 * ji[0] / I[0][0]; |
| 353 |
< |
this->rotate(1, 2, angle, ji, A); |
| 328 |
> |
this->rotationPropagation( dAtom, ji ); |
| 329 |
|
|
| 355 |
– |
|
| 330 |
|
dAtom->setJ(ji); |
| 357 |
– |
dAtom->setA(A); |
| 331 |
|
} |
| 332 |
+ |
} |
| 333 |
+ |
|
| 334 |
+ |
if (nConstrained){ |
| 335 |
+ |
constrainA(); |
| 336 |
|
} |
| 337 |
|
} |
| 338 |
|
|
| 375 |
|
dAtom->setJ(ji); |
| 376 |
|
} |
| 377 |
|
} |
| 378 |
+ |
|
| 379 |
+ |
if (nConstrained){ |
| 380 |
+ |
constrainB(); |
| 381 |
+ |
} |
| 382 |
|
} |
| 383 |
|
|
| 384 |
|
template<typename T> void Integrator<T>::preMove(void){ |
| 537 |
|
painCave.isFatal = 1; |
| 538 |
|
simError(); |
| 539 |
|
} |
| 540 |
+ |
|
| 541 |
|
} |
| 542 |
|
|
| 543 |
|
template<typename T> void Integrator<T>::constrainB(void){ |
| 641 |
|
} |
| 642 |
|
} |
| 643 |
|
|
| 644 |
+ |
template<typename T> void Integrator<T>::rotationPropagation |
| 645 |
+ |
( DirectionalAtom* dAtom, double ji[3] ){ |
| 646 |
+ |
|
| 647 |
+ |
double angle; |
| 648 |
+ |
double A[3][3], I[3][3]; |
| 649 |
+ |
|
| 650 |
+ |
// use the angular velocities to propagate the rotation matrix a |
| 651 |
+ |
// full time step |
| 652 |
+ |
|
| 653 |
+ |
dAtom->getA(A); |
| 654 |
+ |
dAtom->getI(I); |
| 655 |
+ |
|
| 656 |
+ |
// rotate about the x-axis |
| 657 |
+ |
angle = dt2 * ji[0] / I[0][0]; |
| 658 |
+ |
this->rotate( 1, 2, angle, ji, A ); |
| 659 |
+ |
|
| 660 |
+ |
// rotate about the y-axis |
| 661 |
+ |
angle = dt2 * ji[1] / I[1][1]; |
| 662 |
+ |
this->rotate( 2, 0, angle, ji, A ); |
| 663 |
+ |
|
| 664 |
+ |
// rotate about the z-axis |
| 665 |
+ |
angle = dt * ji[2] / I[2][2]; |
| 666 |
+ |
this->rotate( 0, 1, angle, ji, A); |
| 667 |
+ |
|
| 668 |
+ |
// rotate about the y-axis |
| 669 |
+ |
angle = dt2 * ji[1] / I[1][1]; |
| 670 |
+ |
this->rotate( 2, 0, angle, ji, A ); |
| 671 |
+ |
|
| 672 |
+ |
// rotate about the x-axis |
| 673 |
+ |
angle = dt2 * ji[0] / I[0][0]; |
| 674 |
+ |
this->rotate( 1, 2, angle, ji, A ); |
| 675 |
+ |
|
| 676 |
+ |
dAtom->setA( A ); |
| 677 |
+ |
} |
| 678 |
+ |
|
| 679 |
|
template<typename T> void Integrator<T>::rotate(int axes1, int axes2, |
| 680 |
|
double angle, double ji[3], |
| 681 |
|
double A[3][3]){ |
| 766 |
|
template<typename T> void Integrator<T>::thermalize(){ |
| 767 |
|
tStats->velocitize(); |
| 768 |
|
} |
| 769 |
+ |
|
| 770 |
+ |
template<typename T> double Integrator<T>::getConservedQuantity(void){ |
| 771 |
+ |
return tStats->getTotalE(); |
| 772 |
+ |
} |