ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Integrator.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/Integrator.cpp (file contents):
Revision 1113 by tim, Thu Apr 15 16:18:26 2004 UTC vs.
Revision 1221 by chrisfen, Wed Jun 2 14:56:18 2004 UTC

# 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   }
50  
51   template<typename T> Integrator<T>::~Integrator(){
# Line 160 | Line 161 | template<typename T> void Integrator<T>::integrate(voi
161    double thermalTime = info->thermalTime;
162    double resetTime = info->resetTime;
163  
164 <
164 >  double difference;
165    double currSample;
166    double currThermal;
167    double currStatus;
# Line 179 | Line 180 | template<typename T> void Integrator<T>::integrate(voi
180  
181    readyCheck();
182  
183 +  // remove center of mass drift velocity (in case we passed in a configuration
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);
# Line 211 | Line 221 | template<typename T> void Integrator<T>::integrate(voi
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      }
# Line 266 | Line 277 | template<typename T> void Integrator<T>::integrate(voi
277   #endif // is_mpi
278    }
279  
280 +  // dump out a file containing the omega values for the final configuration
281 +  if (info->useSolidThermInt && !info->useLiquidThermInt)
282 +    myFF->dumpzAngle();
283 +  
284 +
285    delete dumpOut;
286    delete statOut;
287   }
# Line 300 | Line 316 | template<typename T> void Integrator<T>::integrateStep
316    MPIcheckPoint();
317   #endif // is_mpi
318  
303
319    // calc forces
305
320    calcForce(calcPot, calcStress);
321  
322   #ifdef IS_MPI
# Line 337 | Line 351 | template<typename T> void Integrator<T>::moveA(void){
351    double Tb[3], ji[3];
352    double vel[3], pos[3], frc[3];
353    double mass;
354 +  double omega;
355  
356    for (i = 0; i < integrableObjects.size() ; i++){
357      integrableObjects[i]->getVel(vel);
# Line 687 | Line 702 | template<typename T> void Integrator<T>::rotationPropa
702  
703    double angle;
704    double A[3][3], I[3][3];
705 +  int i, j, k;
706  
707    // use the angular velocities to propagate the rotation matrix a
708    // full time step
# Line 694 | Line 710 | template<typename T> void Integrator<T>::rotationPropa
710    sd->getA(A);
711    sd->getI(I);
712  
713 <  // rotate about the x-axis
714 <  angle = dt2 * ji[0] / I[0][0];
715 <  this->rotate( 1, 2, angle, ji, A );
713 >  if (sd->isLinear()) {
714 >    i = sd->linearAxis();
715 >    j = (i+1)%3;
716 >    k = (i+2)%3;
717 >    
718 >    angle = dt2 * ji[j] / I[j][j];
719 >    this->rotate( k, i, angle, ji, A );
720  
721 <  // rotate about the y-axis
722 <  angle = dt2 * ji[1] / I[1][1];
703 <  this->rotate( 2, 0, angle, ji, A );
721 >    angle = dt * ji[k] / I[k][k];
722 >    this->rotate( i, j, angle, ji, A);
723  
724 <  // rotate about the z-axis
725 <  angle = dt * ji[2] / I[2][2];
707 <  this->rotate( 0, 1, angle, ji, A);
724 >    angle = dt2 * ji[j] / I[j][j];
725 >    this->rotate( k, i, angle, ji, A );
726  
727 <  // rotate about the y-axis
728 <  angle = dt2 * ji[1] / I[1][1];
729 <  this->rotate( 2, 0, angle, ji, A );
730 <
731 <  // rotate about the x-axis
732 <  angle = dt2 * ji[0] / I[0][0];
733 <  this->rotate( 1, 2, angle, ji, A );
734 <
727 >  } else {
728 >    // rotate about the x-axis
729 >    angle = dt2 * ji[0] / I[0][0];
730 >    this->rotate( 1, 2, angle, ji, A );
731 >    
732 >    // rotate about the y-axis
733 >    angle = dt2 * ji[1] / I[1][1];
734 >    this->rotate( 2, 0, angle, ji, A );
735 >    
736 >    // rotate about the z-axis
737 >    angle = dt * ji[2] / I[2][2];
738 >    sd->addZangle(angle);
739 >    this->rotate( 0, 1, angle, ji, A);
740 >    
741 >    // rotate about the y-axis
742 >    angle = dt2 * ji[1] / I[1][1];
743 >    this->rotate( 2, 0, angle, ji, A );
744 >    
745 >    // rotate about the x-axis
746 >    angle = dt2 * ji[0] / I[0][0];
747 >    this->rotate( 1, 2, angle, ji, A );
748 >    
749 >  }
750    sd->setA( A  );
751   }
752  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines