| 35 |  | * | 
| 36 |  | * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). | 
| 37 |  | * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). | 
| 38 | < | * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). | 
| 38 | > | * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). | 
| 39 |  | * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010). | 
| 40 |  | * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). | 
| 41 |  | */ | 
| 43 |  | #define _LARGEFILE_SOURCE64 | 
| 44 |  | #define _FILE_OFFSET_BITS 64 | 
| 45 |  |  | 
| 46 | + | #ifdef IS_MPI | 
| 47 | + | #include <mpi.h> | 
| 48 | + | #endif | 
| 49 | + |  | 
| 50 |  | #include <sys/types.h> | 
| 51 |  | #include <sys/stat.h> | 
| 52 |  |  | 
| 63 |  | #include "utils/MemoryUtils.hpp" | 
| 64 |  | #include "utils/StringTokenizer.hpp" | 
| 65 |  | #include "brains/Thermo.hpp" | 
| 62 | – |  | 
| 63 | – | #ifdef IS_MPI | 
| 64 | – | #include <mpi.h> | 
| 65 | – | #endif | 
| 66 |  |  | 
| 67 |  |  | 
| 68 |  | namespace OpenMD { | 
| 128 |  | } | 
| 129 |  |  | 
| 130 |  | void DumpReader::scanFile(void) { | 
| 131 | < | int lineNo = 0; | 
| 131 | > |  | 
| 132 |  | std::streampos prevPos; | 
| 133 |  | std::streampos  currPos; | 
| 134 |  |  | 
| 142 |  | bool foundOpenSnapshotTag = false; | 
| 143 |  | bool foundClosedSnapshotTag = false; | 
| 144 |  |  | 
| 145 | + | int lineNo = 0; | 
| 146 |  | while(inFile_->getline(buffer, bufferSize)) { | 
| 147 |  | ++lineNo; | 
| 148 |  |  | 
| 228 |  | needVel_ = false; | 
| 229 |  | } | 
| 230 |  |  | 
| 231 | < | if (storageLayout & DataStorage::dslAmat || storageLayout & DataStorage::dslElectroFrame) { | 
| 231 | > | if (storageLayout & DataStorage::dslAmat || | 
| 232 | > | storageLayout & DataStorage::dslDipole || | 
| 233 | > | storageLayout & DataStorage::dslQuadrupole) { | 
| 234 |  | needQuaternion_ = true; | 
| 235 |  | } else { | 
| 236 |  | needQuaternion_ = false; | 
| 520 |  |  | 
| 521 |  | } | 
| 522 |  | } | 
| 520 | – |  | 
| 523 |  | } | 
| 524 |  |  | 
| 525 |  |  | 
| 527 |  |  | 
| 528 |  | StringTokenizer tokenizer(line); | 
| 529 |  | int nTokens; | 
| 530 | < |  | 
| 530 | > |  | 
| 531 |  | nTokens = tokenizer.countTokens(); | 
| 532 |  |  | 
| 533 |  | if (nTokens < 2) { | 
| 559 |  | if (i >> siteIndex) { | 
| 560 |  | // chew up this token and parse as an int: | 
| 561 |  | siteIndex = tokenizer.nextTokenAsInt(); | 
| 562 | < | RigidBody* rb = static_cast<RigidBody*>(sd); | 
| 563 | < | sd = rb->getAtoms()[siteIndex]; | 
| 562 | > |  | 
| 563 | > | if (sd->isRigidBody()) { | 
| 564 | > | RigidBody* rb = static_cast<RigidBody*>(sd); | 
| 565 | > | sd = rb->getAtoms()[siteIndex]; | 
| 566 | > | } | 
| 567 |  | } | 
| 568 |  |  | 
| 569 |  | /** | 
| 650 |  |  | 
| 651 |  | void  DumpReader::readSiteData(std::istream& inputStream) { | 
| 652 |  |  | 
| 648 | – | inputStream.getline(buffer, bufferSize); | 
| 653 |  | std::string line(buffer); | 
| 650 | – |  | 
| 651 | – | if (line.find("<SiteData>") == std::string::npos) { | 
| 652 | – | // site data isn't required for a simulation, so skip | 
| 653 | – | return; | 
| 654 | – | } | 
| 654 |  |  | 
| 655 | + | // We already found the starting <SiteData> tag or we wouldn't be | 
| 656 | + | // here, so just start parsing until we get to the ending | 
| 657 | + | // </SiteData> tag: | 
| 658 | + |  | 
| 659 |  | while(inputStream.getline(buffer, bufferSize)) { | 
| 660 |  | line = buffer; | 
| 661 |  |  |