32 |
|
|
33 |
|
nAtoms = info->n_atoms; |
34 |
|
integrableObjects = info->integrableObjects; |
35 |
< |
|
35 |
> |
|
36 |
|
// check for constraints |
37 |
|
|
38 |
|
constrainedA = NULL; |
45 |
|
nConstrained = 0; |
46 |
|
|
47 |
|
checkConstraints(); |
48 |
+ |
|
49 |
|
} |
50 |
|
|
51 |
|
template<typename T> Integrator<T>::~Integrator(){ |
161 |
|
double thermalTime = info->thermalTime; |
162 |
|
double resetTime = info->resetTime; |
163 |
|
|
164 |
< |
|
164 |
> |
double difference; |
165 |
|
double currSample; |
166 |
|
double currThermal; |
167 |
|
double currStatus; |
184 |
|
// that was drifting |
185 |
|
tStats->removeCOMdrift(); |
186 |
|
|
187 |
+ |
// initialize the retraints if necessary |
188 |
+ |
if (info->useSolidThermInt && !info->useLiquidThermInt) { |
189 |
+ |
myFF->initRestraints(); |
190 |
+ |
} |
191 |
+ |
|
192 |
|
// initialize the forces before the first step |
193 |
|
|
194 |
|
calcForce(1, 1); |
221 |
|
#endif // is_mpi |
222 |
|
|
223 |
|
while (info->getTime() < runTime && !stopIntegrator()){ |
224 |
< |
if ((info->getTime() + dt) >= currStatus){ |
224 |
> |
difference = info->getTime() + dt - currStatus; |
225 |
> |
if (difference > 0 || fabs(difference) < 1e-4 ){ |
226 |
|
calcPot = 1; |
227 |
|
calcStress = 1; |
228 |
|
} |
255 |
|
|
256 |
|
if (info->getTime() >= currStatus){ |
257 |
|
statOut->writeStat(info->getTime()); |
258 |
+ |
if (info->useSolidThermInt || info->useLiquidThermInt) |
259 |
+ |
statOut->writeRaw(info->getTime()); |
260 |
|
calcPot = 0; |
261 |
|
calcStress = 0; |
262 |
|
currStatus += statusTime; |
279 |
|
#endif // is_mpi |
280 |
|
} |
281 |
|
|
282 |
+ |
// dump out a file containing the omega values for the final configuration |
283 |
+ |
if (info->useSolidThermInt && !info->useLiquidThermInt) |
284 |
+ |
myFF->dumpzAngle(); |
285 |
+ |
|
286 |
+ |
|
287 |
|
delete dumpOut; |
288 |
|
delete statOut; |
289 |
|
} |
318 |
|
MPIcheckPoint(); |
319 |
|
#endif // is_mpi |
320 |
|
|
307 |
– |
|
321 |
|
// calc forces |
309 |
– |
|
322 |
|
calcForce(calcPot, calcStress); |
323 |
|
|
324 |
|
#ifdef IS_MPI |
353 |
|
double Tb[3], ji[3]; |
354 |
|
double vel[3], pos[3], frc[3]; |
355 |
|
double mass; |
356 |
+ |
double omega; |
357 |
|
|
358 |
|
for (i = 0; i < integrableObjects.size() ; i++){ |
359 |
|
integrableObjects[i]->getVel(vel); |
360 |
|
integrableObjects[i]->getPos(pos); |
361 |
|
integrableObjects[i]->getFrc(frc); |
349 |
– |
|
350 |
– |
std::cerr << "i =\t" << i << "\t" << frc[0] << "\t" << frc[1]<< "\t" << frc[2] << "\n"; |
362 |
|
|
363 |
|
mass = integrableObjects[i]->getMass(); |
364 |
|
|
737 |
|
|
738 |
|
// rotate about the z-axis |
739 |
|
angle = dt * ji[2] / I[2][2]; |
740 |
+ |
sd->addZangle(angle); |
741 |
|
this->rotate( 0, 1, angle, ji, A); |
742 |
|
|
743 |
|
// rotate about the y-axis |