| 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 | 
  | 
     | 
| 92 | 
  | 
    }  | 
| 93 | 
  | 
     | 
| 94 | 
  | 
    strcpy(checkPointMsg, "Dump file opened for reading successfully.");  | 
| 95 | 
< | 
    MPIcheckPoint();  | 
| 95 | 
> | 
    errorCheckPoint();  | 
| 96 | 
  | 
     | 
| 97 | 
  | 
#endif  | 
| 98 | 
  | 
     | 
| 113 | 
  | 
    }  | 
| 114 | 
  | 
     | 
| 115 | 
  | 
    strcpy(checkPointMsg, "Dump file closed successfully.");  | 
| 116 | 
< | 
    MPIcheckPoint();  | 
| 116 | 
> | 
    errorCheckPoint();  | 
| 117 | 
  | 
     | 
| 118 | 
  | 
#endif  | 
| 119 | 
  | 
     | 
| 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) {      | 
| 263 | 
  | 
    std::string line; | 
| 264 | 
  | 
 | 
| 265 | 
  | 
#ifndef IS_MPI  | 
| 249 | 
– | 
 | 
| 266 | 
  | 
    inFile_->clear();   | 
| 267 | 
  | 
    inFile_->seekg(framePos_[whichFrame]);  | 
| 268 | 
  | 
 | 
| 292 | 
  | 
      MPI_Bcast((void *)sendBuffer.c_str(), sendBufferSize, MPI_CHAR, masterNode, MPI_COMM_WORLD);      | 
| 293 | 
  | 
       | 
| 294 | 
  | 
      sstream.str(sendBuffer); | 
| 279 | 
– | 
      std::cerr << sendBuffer; | 
| 295 | 
  | 
    } else { | 
| 296 | 
  | 
      int sendBufferSize; | 
| 297 | 
  | 
      MPI_Bcast(&sendBufferSize, 1, MPI_INT, masterNode, MPI_COMM_WORLD);      | 
| 298 | 
  | 
      char * recvBuffer = new char[sendBufferSize+1]; | 
| 299 | 
+ | 
      assert(recvBuffer); | 
| 300 | 
+ | 
      recvBuffer[sendBufferSize] = '\0'; | 
| 301 | 
  | 
      MPI_Bcast(recvBuffer, sendBufferSize, MPI_CHAR, masterNode, MPI_COMM_WORLD);      | 
| 302 | 
  | 
      sstream.str(recvBuffer); | 
| 303 | 
+ | 
      delete [] recvBuffer; | 
| 304 | 
  | 
    }       | 
| 305 | 
  | 
 | 
| 306 | 
  | 
    std::istream& inputStream = sstream;   | 
| 357 | 
  | 
    } | 
| 358 | 
  | 
    std::string type = tokenizer.nextToken();  | 
| 359 | 
  | 
    int size = type.size(); | 
| 360 | 
+ | 
 | 
| 361 | 
  | 
    for(int i = 0; i < size; ++i) { | 
| 362 | 
  | 
      switch(type[i]) { | 
| 363 | 
  | 
         | 
| 418 | 
  | 
               integrableObject->setJ(ji);  | 
| 419 | 
  | 
             }  | 
| 420 | 
  | 
          } | 
| 421 | 
+ | 
          break; | 
| 422 | 
  | 
        }   | 
| 423 | 
  | 
        case 'f': { | 
| 424 | 
  | 
 |