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 841 by mmeineke, Wed Oct 29 17:55:28 2003 UTC vs.
Revision 1057 by tim, Tue Feb 17 19:23:44 2004 UTC

# Line 7 | Line 7
7   #include <unistd.h>
8   #endif //is_mpi
9  
10 + #ifdef PROFILE
11 + #include "mdProfile.hpp"
12 + #endif // profile
13 +
14   #include "Integrator.hpp"
15   #include "simError.h"
16  
# Line 64 | Line 68 | template<typename T> void Integrator<T>::checkConstrai
68  
69    SRI** theArray;
70    for (int i = 0; i < nMols; i++){
71 <    theArray = (SRI * *) molecules[i].getMyBonds();
71 >
72 >          theArray = (SRI * *) molecules[i].getMyBonds();
73      for (int j = 0; j < molecules[i].getNBonds(); j++){
74        constrained = theArray[j]->is_constrained();
75  
# Line 110 | Line 115 | template<typename T> void Integrator<T>::checkConstrai
115      }
116    }
117  
118 +
119    if (nConstrained > 0){
120      isConstrained = 1;
121  
# Line 131 | Line 137 | template<typename T> void Integrator<T>::checkConstrai
137      }
138  
139  
140 <    // save oldAtoms to check for lode balanceing later on.
140 >    // save oldAtoms to check for lode balancing later on.
141  
142      oldAtoms = nAtoms;
143  
# Line 174 | Line 180 | template<typename T> void Integrator<T>::integrate(voi
180  
181    // initialize the forces before the first step
182  
177  std::cerr << "Before initial Force calc\n";
178
183    calcForce(1, 1);
184  
185 +  //temp test
186 +  tStats->getPotential();
187 +  
188    if (nConstrained){
189      preMove();
190      constrainA();
191      calcForce(1, 1);
192      constrainB();
186    std::cerr << "premove done\n";
193    }
194 <
189 <
190 <
194 >  
195    if (info->setTemp){
196      thermalize();
197    }
# Line 203 | Line 207 | template<typename T> void Integrator<T>::integrate(voi
207    statOut->writeStat(info->getTime());
208  
209  
206
210   #ifdef IS_MPI
211    strcpy(checkPointMsg, "The integrator is ready to go.");
212    MPIcheckPoint();
# Line 215 | Line 218 | template<typename T> void Integrator<T>::integrate(voi
218        calcStress = 1;
219      }
220  
221 + #ifdef PROFILE
222 +    startProfile( pro1 );
223 + #endif
224 +    
225      integrateStep(calcPot, calcStress);
226  
227 + #ifdef PROFILE
228 +    endProfile( pro1 );
229 +
230 +    startProfile( pro2 );
231 + #endif // profile
232 +
233      info->incrTime(dt);
234  
235      if (info->setTemp){
# Line 244 | Line 257 | template<typename T> void Integrator<T>::integrate(voi
257          currReset += resetTime;
258        }
259      }
260 <
261 <    std::cerr << "done with time = " << info->getTime() << "\n";
260 >    
261 > #ifdef PROFILE
262 >    endProfile( pro2 );
263 > #endif //profile
264  
265   #ifdef IS_MPI
266      strcpy(checkPointMsg, "successfully took a time step.");
# Line 253 | Line 268 | template<typename T> void Integrator<T>::integrate(voi
268   #endif // is_mpi
269    }
270  
256
257  // write the last frame
258  dumpOut->writeDump(info->getTime());
259
271    delete dumpOut;
272    delete statOut;
273   }
# Line 264 | Line 275 | template<typename T> void Integrator<T>::integrateStep
275   template<typename T> void Integrator<T>::integrateStep(int calcPot,
276                                                         int calcStress){
277    // Position full step, and velocity half step
278 +
279 + #ifdef PROFILE
280 +  startProfile(pro3);
281 + #endif //profile
282 +
283    preMove();
284  
285 <  moveA();
285 > #ifdef PROFILE
286 >  endProfile(pro3);
287  
288 +  startProfile(pro4);
289 + #endif // profile
290  
291 +  moveA();
292  
293 + #ifdef PROFILE
294 +  endProfile(pro4);
295 +  
296 +  startProfile(pro5);
297 + #endif//profile
298  
299 +
300   #ifdef IS_MPI
301    strcpy(checkPointMsg, "Succesful moveA\n");
302    MPIcheckPoint();
# Line 285 | Line 311 | template<typename T> void Integrator<T>::integrateStep
311    strcpy(checkPointMsg, "Succesful doForces\n");
312    MPIcheckPoint();
313   #endif // is_mpi
314 +
315 + #ifdef PROFILE
316 +  endProfile( pro5 );
317  
318 +  startProfile( pro6 );
319 + #endif //profile
320  
321    // finish the velocity  half step
322  
323    moveB();
324  
325 <
325 > #ifdef PROFILE
326 >  endProfile(pro6);
327 > #endif // profile
328  
329   #ifdef IS_MPI
330    strcpy(checkPointMsg, "Succesful moveB\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines