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 841 by mmeineke, Wed Oct 29 17:55:28 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 174 | Line 174 | template<typename T> void Integrator<T>::integrate(voi
174  
175    // initialize the forces before the first step
176  
177 +  std::cerr << "Before initial Force calc\n";
178 +
179    calcForce(1, 1);
180  
181    if (nConstrained){
182      preMove();
183      constrainA();
184 <    calcForce(1, 1);    
184 >    calcForce(1, 1);
185      constrainB();
186 +    std::cerr << "premove done\n";
187    }
188 <  
188 >
189 >
190 >
191    if (info->setTemp){
192      thermalize();
193    }
# Line 227 | Line 232 | template<typename T> void Integrator<T>::integrate(voi
232      }
233  
234      if (info->getTime() >= currStatus){
235 <      statOut->writeStat(info->getTime());
236 <      calcPot = 0;
235 >      statOut->writeStat(info->getTime());
236 >      calcPot = 0;
237        calcStress = 0;
238        currStatus += statusTime;
239 <    }
239 >    }
240  
241      if (info->resetIntegrator){
242        if (info->getTime() >= currReset){
# Line 240 | Line 245 | template<typename T> void Integrator<T>::integrate(voi
245        }
246      }
247  
248 +    std::cerr << "done with time = " << info->getTime() << "\n";
249 +
250   #ifdef IS_MPI
251      strcpy(checkPointMsg, "successfully took a time step.");
252      MPIcheckPoint();
# Line 366 | Line 373 | template<typename T> void Integrator<T>::moveB(void){
373      if (atoms[i]->isDirectional()){
374        dAtom = (DirectionalAtom *) atoms[i];
375  
376 <      // get and convert the torque to body frame      
376 >      // get and convert the torque to body frame
377  
378        dAtom->getTrq(Tb);
379        dAtom->lab2Body(Tb);
# Line 658 | Line 665 | template<typename T> void Integrator<T>::rotationPropa
665  
666    dAtom->getA(A);
667    dAtom->getI(I);
668 <  
669 <  // rotate about the x-axis      
668 >
669 >  // rotate about the x-axis
670    angle = dt2 * ji[0] / I[0][0];
671 <  this->rotate( 1, 2, angle, ji, A );
672 <  
671 >  this->rotate( 1, 2, angle, ji, A );
672 >
673    // rotate about the y-axis
674    angle = dt2 * ji[1] / I[1][1];
675    this->rotate( 2, 0, angle, ji, A );
676 <  
676 >
677    // rotate about the z-axis
678    angle = dt * ji[2] / I[2][2];
679    this->rotate( 0, 1, angle, ji, A);
680 <  
680 >
681    // rotate about the y-axis
682    angle = dt2 * ji[1] / I[1][1];
683    this->rotate( 2, 0, angle, ji, A );
684 <  
684 >
685    // rotate about the x-axis
686    angle = dt2 * ji[0] / I[0][0];
687    this->rotate( 1, 2, angle, ji, A );
688 <  
689 <  dAtom->setA( A  );    
688 >
689 >  dAtom->setA( A  );
690   }
691  
692   template<typename T> void Integrator<T>::rotate(int axes1, int axes2,
# Line 747 | Line 754 | template<typename T> void Integrator<T>::rotate(int ax
754      }
755    }
756  
757 <  // rotate the Rotation matrix acording to:
757 >  // rotate the Rotation matrix acording to:
758    //            A[][] = A[][] * transpose(rot[][])
759  
760  
# Line 776 | Line 783 | template<typename T> double Integrator<T>::getConserve
783   template<typename T> double Integrator<T>::getConservedQuantity(void){
784    return tStats->getTotalE();
785   }
786 + template<typename T> string Integrator<T>::getAdditionalParameters(void){
787 +  //By default, return a null string
788 +  //The reason we use string instead of char* is that if we use char*, we will
789 +  //return a pointer point to local variable which might cause problem
790 +  return string();
791 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines