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 829 by gezelter, Tue Oct 28 16:03:37 2003 UTC vs.
Revision 837 by tim, Wed Oct 29 00:19:10 2003 UTC

# Line 25 | Line 25 | template<typename T> Integrator<T>::Integrator(SimInfo
25    if (info->the_integrator != NULL){
26      delete info->the_integrator;
27    }
28 <  
28 >
29    nAtoms = info->n_atoms;
30  
31    // check for constraints
# Line 158 | Line 158 | template<typename T> void Integrator<T>::integrate(voi
158    double currThermal;
159    double currStatus;
160    double currReset;
161 <  
161 >
162    int calcPot, calcStress;
163  
164    tStats = new Thermo(info);
# Line 179 | Line 179 | template<typename T> void Integrator<T>::integrate(voi
179    if (nConstrained){
180      preMove();
181      constrainA();
182 <    calcForce(1, 1);    
182 >    calcForce(1, 1);
183      constrainB();
184    }
185 <  
185 >
186    if (info->setTemp){
187      thermalize();
188    }
# Line 227 | Line 227 | template<typename T> void Integrator<T>::integrate(voi
227      }
228  
229      if (info->getTime() >= currStatus){
230 <      statOut->writeStat(info->getTime());
231 <      calcPot = 0;
230 >      statOut->writeStat(info->getTime());
231 >      calcPot = 0;
232        calcStress = 0;
233        currStatus += statusTime;
234 <    }
234 >    }
235  
236      if (info->resetIntegrator){
237        if (info->getTime() >= currReset){
# Line 366 | Line 366 | template<typename T> void Integrator<T>::moveB(void){
366      if (atoms[i]->isDirectional()){
367        dAtom = (DirectionalAtom *) atoms[i];
368  
369 <      // get and convert the torque to body frame      
369 >      // get and convert the torque to body frame
370  
371        dAtom->getTrq(Tb);
372        dAtom->lab2Body(Tb);
# Line 658 | Line 658 | template<typename T> void Integrator<T>::rotationPropa
658  
659    dAtom->getA(A);
660    dAtom->getI(I);
661 <  
662 <  // rotate about the x-axis      
661 >
662 >  // rotate about the x-axis
663    angle = dt2 * ji[0] / I[0][0];
664 <  this->rotate( 1, 2, angle, ji, A );
665 <  
664 >  this->rotate( 1, 2, angle, ji, A );
665 >
666    // rotate about the y-axis
667    angle = dt2 * ji[1] / I[1][1];
668    this->rotate( 2, 0, angle, ji, A );
669 <  
669 >
670    // rotate about the z-axis
671    angle = dt * ji[2] / I[2][2];
672    this->rotate( 0, 1, angle, ji, A);
673 <  
673 >
674    // rotate about the y-axis
675    angle = dt2 * ji[1] / I[1][1];
676    this->rotate( 2, 0, angle, ji, A );
677 <  
677 >
678    // rotate about the x-axis
679    angle = dt2 * ji[0] / I[0][0];
680    this->rotate( 1, 2, angle, ji, A );
681 <  
682 <  dAtom->setA( A  );    
681 >
682 >  dAtom->setA( A  );
683   }
684  
685   template<typename T> void Integrator<T>::rotate(int axes1, int axes2,
# Line 747 | Line 747 | template<typename T> void Integrator<T>::rotate(int ax
747      }
748    }
749  
750 <  // rotate the Rotation matrix acording to:
750 >  // rotate the Rotation matrix acording to:
751    //            A[][] = A[][] * transpose(rot[][])
752  
753  
# Line 776 | Line 776 | template<typename T> double Integrator<T>::getConserve
776   template<typename T> double Integrator<T>::getConservedQuantity(void){
777    return tStats->getTotalE();
778   }
779 + template<typename T> string Integrator<T>::getAdditionalParameters(void){
780 +  //By default, return a null string
781 +  //The reason we use string instead of char* is that if we use char*, we will
782 +  //return a pointer point to local variable which might cause problem
783 +  return string();
784 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines