| 171 |
|
double currReset; |
| 172 |
|
|
| 173 |
|
int calcPot, calcStress; |
| 174 |
+ |
int i; |
| 175 |
+ |
int localIndex; |
| 176 |
|
|
| 177 |
+ |
#ifdef IS_MPI |
| 178 |
+ |
int which_node; |
| 179 |
+ |
#endif // is_mpi |
| 180 |
+ |
|
| 181 |
+ |
vector<StuntDouble*> particles; |
| 182 |
+ |
string inAngle; |
| 183 |
+ |
|
| 184 |
|
tStats = new Thermo(info); |
| 185 |
|
statOut = new StatWriter(info); |
| 186 |
|
dumpOut = new DumpWriter(info); |
| 187 |
|
|
| 188 |
+ |
if (info->useSolidThermInt && !info->useLiquidThermInt) { |
| 189 |
+ |
restOut = new RestraintWriter(info); |
| 190 |
+ |
initRestraints = new RestraintReader(info); |
| 191 |
+ |
} |
| 192 |
+ |
|
| 193 |
|
atoms = info->atoms; |
| 194 |
|
|
| 195 |
|
dt = info->dt; |
| 203 |
|
|
| 204 |
|
// initialize the retraints if necessary |
| 205 |
|
if (info->useSolidThermInt && !info->useLiquidThermInt) { |
| 206 |
< |
myFF->initRestraints(); |
| 206 |
> |
initRestraints->zeroZangle(); |
| 207 |
> |
inAngle = info->zAngleName + "_in"; |
| 208 |
> |
initRestraints->readZangle(inAngle.c_str()); |
| 209 |
> |
initRestraints->readIdealCrystal(); |
| 210 |
|
} |
| 211 |
|
|
| 212 |
|
// initialize the forces before the first step |
| 196 |
– |
|
| 213 |
|
calcForce(1, 1); |
| 214 |
|
|
| 215 |
|
//execute constraint algorithm to make sure at the very beginning the system is constrained |
| 233 |
|
|
| 234 |
|
dumpOut->writeDump(info->getTime()); |
| 235 |
|
statOut->writeStat(info->getTime()); |
| 236 |
< |
|
| 236 |
> |
if (info->useSolidThermInt && !info->useLiquidThermInt) |
| 237 |
> |
restOut->writeZangle(info->getTime()); |
| 238 |
|
|
| 239 |
|
#ifdef IS_MPI |
| 240 |
|
strcpy(checkPointMsg, "The integrator is ready to go."); |
| 271 |
|
|
| 272 |
|
if (info->getTime() >= currSample){ |
| 273 |
|
dumpOut->writeDump(info->getTime()); |
| 274 |
+ |
// write a zAng file to coincide with each dump or eor file |
| 275 |
+ |
if (info->useSolidThermInt && !info->useLiquidThermInt) |
| 276 |
+ |
restOut->writeZangle(info->getTime()); |
| 277 |
|
currSample += sampleTime; |
| 278 |
|
} |
| 279 |
|
|
| 303 |
|
|
| 304 |
|
dumpOut->writeFinal(info->getTime()); |
| 305 |
|
|
| 306 |
< |
// dump out a file containing the omega values for the final configuration |
| 307 |
< |
if (info->useSolidThermInt && !info->useLiquidThermInt) |
| 308 |
< |
myFF->dumpzAngle(); |
| 309 |
< |
|
| 306 |
> |
// write the file containing the omega values of the final configuration |
| 307 |
> |
if (info->useSolidThermInt && !info->useLiquidThermInt){ |
| 308 |
> |
restOut->writeZangle(info->getTime()); |
| 309 |
> |
restOut->writeZangle(info->getTime(), inAngle.c_str()); |
| 310 |
> |
} |
| 311 |
|
|
| 312 |
|
delete dumpOut; |
| 313 |
|
delete statOut; |
| 384 |
|
integrableObjects[i]->getVel(vel); |
| 385 |
|
integrableObjects[i]->getPos(pos); |
| 386 |
|
integrableObjects[i]->getFrc(frc); |
| 387 |
+ |
// std::cerr << "f = " << frc[0] << "\t" << frc[1] << "\t" << frc[2] << "\n"; |
| 388 |
|
|
| 389 |
|
mass = integrableObjects[i]->getMass(); |
| 390 |
|
|
| 398 |
|
integrableObjects[i]->setVel(vel); |
| 399 |
|
integrableObjects[i]->setPos(pos); |
| 400 |
|
|
| 401 |
+ |
|
| 402 |
|
if (integrableObjects[i]->isDirectional()){ |
| 403 |
|
|
| 404 |
|
// get and convert the torque to body frame |
| 405 |
|
|
| 406 |
|
integrableObjects[i]->getTrq(Tb); |
| 407 |
+ |
|
| 408 |
+ |
// std::cerr << "t = " << Tb[0] << "\t" << Tb[1] << "\t" << Tb[2] << "\n"; |
| 409 |
|
integrableObjects[i]->lab2Body(Tb); |
| 410 |
|
|
| 411 |
|
// get the angular momentum, and propagate a half step |
| 741 |
|
sd->getI(I); |
| 742 |
|
|
| 743 |
|
if (sd->isLinear()) { |
| 744 |
+ |
|
| 745 |
|
i = sd->linearAxis(); |
| 746 |
|
j = (i+1)%3; |
| 747 |
|
k = (i+2)%3; |
| 748 |
< |
|
| 748 |
> |
|
| 749 |
|
angle = dt2 * ji[j] / I[j][j]; |
| 750 |
|
this->rotate( k, i, angle, ji, A ); |
| 751 |
|
|