--- trunk/src/io/DumpReader.cpp 2009/11/25 20:02:06 1390 +++ branches/development/src/io/DumpReader.cpp 2011/11/22 20:38:56 1665 @@ -36,7 +36,8 @@ * [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). - * [4] Vardeman & Gezelter, in progress (2009). + * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). + * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ #define _LARGEFILE_SOURCE64 @@ -341,7 +342,7 @@ namespace OpenMD { nTokens = tokenizer.countTokens(); - if (nTokens < 2) { + if (nTokens < 2) { sprintf(painCave.errMsg, "DumpReader Error: Not enough Tokens.\n%s\n", line.c_str()); painCave.isFatal = 1; @@ -357,6 +358,34 @@ namespace OpenMD { } std::string type = tokenizer.nextToken(); int size = type.size(); + + size_t found; + + if (needPos_) { + found = type.find("p"); + if (found == std::string::npos) { + sprintf(painCave.errMsg, + "DumpReader Error: StuntDouble %d has no Position\n" + "\tField (\"p\") specified.\n%s\n", index, + line.c_str()); + painCave.isFatal = 1; + simError(); + } + } + + if (integrableObject->isDirectional()) { + if (needQuaternion_) { + found = type.find("q"); + if (found == std::string::npos) { + sprintf(painCave.errMsg, + "DumpReader Error: Directional StuntDouble %d has no\n" + "\tQuaternion Field (\"q\") specified.\n%s\n", index, + line.c_str()); + painCave.isFatal = 1; + simError(); + } + } + } for(int i = 0; i < size; ++i) { switch(type[i]) { @@ -438,6 +467,13 @@ namespace OpenMD { integrableObject->setTrq(torque); break; } + case 'u' : { + + RealType particlePot; + particlePot = tokenizer.nextTokenAsDouble(); + integrableObject->setParticlePot(particlePot); + break; + } default: { sprintf(painCave.errMsg, "DumpReader Error: %s is an unrecognized type\n", type.c_str());