# | 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 | + | info_->getComAll(com, comvel); |
250 | + | comw = info_->getAngularMomentum(); |
251 | + | s->setCOMprops(com, comvel, comw); |
252 | + | } |
253 | + | |
254 | } | |
255 | ||
256 | void DumpReader::readSet(int whichFrame) { | |
# | Line 276 | Line 287 | namespace oopse { | |
287 | MPI_Bcast((void *)sendBuffer.c_str(), sendBufferSize, MPI_CHAR, masterNode, MPI_COMM_WORLD); | |
288 | ||
289 | sstream.str(sendBuffer); | |
279 | – | std::cerr << sendBuffer; |
290 | } else { | |
291 | int sendBufferSize; | |
292 | MPI_Bcast(&sendBufferSize, 1, MPI_INT, masterNode, MPI_COMM_WORLD); | |
# | Line 339 | Line 349 | namespace oopse { | |
349 | } | |
350 | std::string type = tokenizer.nextToken(); | |
351 | int size = type.size(); | |
352 | + | |
353 | for(int i = 0; i < size; ++i) { | |
354 | switch(type[i]) { | |
355 | ||
# | Line 399 | Line 410 | namespace oopse { | |
410 | integrableObject->setJ(ji); | |
411 | } | |
412 | } | |
413 | + | break; |
414 | } | |
415 | case 'f': { | |
416 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |