ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/io/DumpReader.cpp
(Generate patch)

Comparing trunk/src/io/DumpReader.cpp (file contents):
Revision 1024 by tim, Wed Aug 30 18:42:29 2006 UTC vs.
Revision 1112 by chuckv, Wed Jan 3 20:47:00 2007 UTC

# Line 70 | Line 70 | namespace oopse {
70   namespace oopse {
71    
72    DumpReader::DumpReader(SimInfo* info, const std::string& filename)
73 <    : info_(info), filename_(filename), isScanned_(false), nframes_(0) {
73 >    : info_(info), filename_(filename), isScanned_(false), nframes_(0), needCOMprops_(false) {
74      
75   #ifdef IS_MPI
76      
# Line 240 | Line 240 | namespace oopse {
240      }
241      
242      readSet(whichFrame);
243 +
244 +    if (needCOMprops_) {
245 +      Snapshot* s = info_->getSnapshotManager()->getCurrentSnapshot();
246 +      Vector3d com;
247 +      Vector3d comvel;
248 +      Vector3d comw;
249 +      if (needPos_ && needVel_){
250 +        info_->getComAll(com, comvel);
251 +        comw = info_->getAngularMomentum();
252 +      }else{
253 +        com = info_->getCom();
254 +        comvel = 0.0;
255 +        comw   = 0.0;
256 +      }
257 +      s->setCOMprops(com, comvel, comw);      
258 +    }
259 +
260    }
261    
262    void DumpReader::readSet(int whichFrame) {    
# Line 276 | Line 293 | namespace oopse {
293        MPI_Bcast((void *)sendBuffer.c_str(), sendBufferSize, MPI_CHAR, masterNode, MPI_COMM_WORLD);    
294        
295        sstream.str(sendBuffer);
279      std::cerr << sendBuffer;
296      } else {
297        int sendBufferSize;
298        MPI_Bcast(&sendBufferSize, 1, MPI_INT, masterNode, MPI_COMM_WORLD);    
# Line 339 | Line 355 | namespace oopse {
355      }
356      std::string type = tokenizer.nextToken();
357      int size = type.size();
358 +
359      for(int i = 0; i < size; ++i) {
360        switch(type[i]) {
361          
# Line 399 | Line 416 | namespace oopse {
416                 integrableObject->setJ(ji);
417               }
418            }
419 +          break;
420          }  
421          case 'f': {
422  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines