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). |
39 |
< |
* [4] Vardeman & Gezelter, in progress (2009). |
39 |
> |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
> |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
42 |
|
|
43 |
|
#define _LARGEFILE_SOURCE64 |
342 |
|
|
343 |
|
nTokens = tokenizer.countTokens(); |
344 |
|
|
345 |
< |
if (nTokens < 2) { |
345 |
> |
if (nTokens < 2) { |
346 |
|
sprintf(painCave.errMsg, |
347 |
|
"DumpReader Error: Not enough Tokens.\n%s\n", line.c_str()); |
348 |
|
painCave.isFatal = 1; |
358 |
|
} |
359 |
|
std::string type = tokenizer.nextToken(); |
360 |
|
int size = type.size(); |
361 |
+ |
|
362 |
+ |
size_t found; |
363 |
+ |
|
364 |
+ |
if (needPos_) { |
365 |
+ |
found = type.find("p"); |
366 |
+ |
if (found == std::string::npos) { |
367 |
+ |
sprintf(painCave.errMsg, |
368 |
+ |
"DumpReader Error: StuntDouble %d has no Position\n" |
369 |
+ |
"\tField (\"p\") specified.\n%s\n", index, |
370 |
+ |
line.c_str()); |
371 |
+ |
painCave.isFatal = 1; |
372 |
+ |
simError(); |
373 |
+ |
} |
374 |
+ |
} |
375 |
+ |
|
376 |
+ |
if (integrableObject->isDirectional()) { |
377 |
+ |
if (needQuaternion_) { |
378 |
+ |
found = type.find("q"); |
379 |
+ |
if (found == std::string::npos) { |
380 |
+ |
sprintf(painCave.errMsg, |
381 |
+ |
"DumpReader Error: Directional StuntDouble %d has no\n" |
382 |
+ |
"\tQuaternion Field (\"q\") specified.\n%s\n", index, |
383 |
+ |
line.c_str()); |
384 |
+ |
painCave.isFatal = 1; |
385 |
+ |
simError(); |
386 |
+ |
} |
387 |
+ |
} |
388 |
+ |
} |
389 |
|
|
390 |
|
for(int i = 0; i < size; ++i) { |
391 |
|
switch(type[i]) { |
467 |
|
integrableObject->setTrq(torque); |
468 |
|
break; |
469 |
|
} |
470 |
+ |
case 'u' : { |
471 |
+ |
|
472 |
+ |
RealType particlePot; |
473 |
+ |
particlePot = tokenizer.nextTokenAsDouble(); |
474 |
+ |
integrableObject->setParticlePot(particlePot); |
475 |
+ |
break; |
476 |
+ |
} |
477 |
|
default: { |
478 |
|
sprintf(painCave.errMsg, |
479 |
|
"DumpReader Error: %s is an unrecognized type\n", type.c_str()); |