--- trunk/src/io/RestReader.cpp 2012/09/10 18:38:44 1796 +++ trunk/src/io/RestReader.cpp 2013/10/31 15:32:17 1938 @@ -35,12 +35,15 @@ * * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). - * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ - +#ifdef IS_MPI +#include +#endif + #include #include @@ -59,16 +62,11 @@ #include "utils/StringTokenizer.hpp" #include "restraints/ObjectRestraint.hpp" #include "restraints/MolecularRestraint.hpp" - -#ifdef IS_MPI - -#include -#endif namespace OpenMD { void RestReader::scanFile(){ - int lineNo = 0; + std::streampos prevPos; std::streampos currPos; @@ -82,7 +80,7 @@ namespace OpenMD { prevPos = currPos; bool foundOpenSnapshotTag = false; - + int lineNo = 0; while(!foundOpenSnapshotTag && inFile_->getline(buffer, bufferSize)) { ++lineNo; @@ -368,7 +366,6 @@ namespace OpenMD { // is this io restrained? GenericData* data = sd->getPropertyByName("Restraint"); - ObjectRestraint* oRest; if (data != NULL) { // make sure we can reinterpret the generic data as restraint data: @@ -376,7 +373,7 @@ namespace OpenMD { if (restData != NULL) { // make sure we can reinterpet the restraint data as a pointer to // an ObjectRestraint: - oRest = dynamic_cast(restData->getData()); + ObjectRestraint* oRest = dynamic_cast(restData->getData()); if (oRest != NULL) { if (sd->isDirectional()) { oRest->setReferenceStructure(pos, q.toRotationMatrix3());