# | Line 75 | Line 75 | namespace OpenMD { | |
---|---|---|
75 | if (worldRank == 0) { | |
76 | #endif | |
77 | ||
78 | < | inFile_ = new std::ifstream(filename_.c_str()); |
78 | > | inFile_ = new std::ifstream(filename_.c_str(), |
79 | > | ifstream::in | ifstream::binary); |
80 | ||
81 | if (inFile_->fail()) { | |
82 | sprintf(painCave.errMsg, | |
# | Line 226 | Line 227 | namespace OpenMD { | |
227 | needVel_ = false; | |
228 | } | |
229 | ||
230 | < | if (storageLayout & DataStorage::dslAmat || storageLayout & DataStorage::dslElectroFrame) { |
230 | > | if (storageLayout & DataStorage::dslAmat || |
231 | > | storageLayout & DataStorage::dslDipole || |
232 | > | storageLayout & DataStorage::dslQuadrupole) { |
233 | needQuaternion_ = true; | |
234 | } else { | |
235 | needQuaternion_ = false; | |
# | Line 352 | Line 355 | namespace OpenMD { | |
355 | ||
356 | int index = tokenizer.nextTokenAsInt(); | |
357 | ||
358 | < | StuntDouble* integrableObject = info_->getIOIndexToIntegrableObject(index); |
358 | > | StuntDouble* sd = info_->getIOIndexToIntegrableObject(index); |
359 | ||
360 | < | if (integrableObject == NULL) { |
360 | > | if (sd == NULL) { |
361 | return; | |
362 | } | |
363 | std::string type = tokenizer.nextToken(); | |
# | Line 374 | Line 377 | namespace OpenMD { | |
377 | } | |
378 | } | |
379 | ||
380 | < | if (integrableObject->isDirectional()) { |
380 | > | if (sd->isDirectional()) { |
381 | if (needQuaternion_) { | |
382 | found = type.find("q"); | |
383 | if (found == std::string::npos) { | |
# | Line 397 | Line 400 | namespace OpenMD { | |
400 | pos[1] = tokenizer.nextTokenAsDouble(); | |
401 | pos[2] = tokenizer.nextTokenAsDouble(); | |
402 | if (needPos_) { | |
403 | < | integrableObject->setPos(pos); |
403 | > | sd->setPos(pos); |
404 | } | |
405 | break; | |
406 | } | |
# | Line 407 | Line 410 | namespace OpenMD { | |
410 | vel[1] = tokenizer.nextTokenAsDouble(); | |
411 | vel[2] = tokenizer.nextTokenAsDouble(); | |
412 | if (needVel_) { | |
413 | < | integrableObject->setVel(vel); |
413 | > | sd->setVel(vel); |
414 | } | |
415 | break; | |
416 | } | |
417 | ||
418 | case 'q' : { | |
419 | Quat4d q; | |
420 | < | if (integrableObject->isDirectional()) { |
420 | > | if (sd->isDirectional()) { |
421 | ||
422 | q[0] = tokenizer.nextTokenAsDouble(); | |
423 | q[1] = tokenizer.nextTokenAsDouble(); | |
# | Line 433 | Line 436 | namespace OpenMD { | |
436 | ||
437 | q.normalize(); | |
438 | if (needQuaternion_) { | |
439 | < | integrableObject->setQ(q); |
439 | > | sd->setQ(q); |
440 | } | |
441 | } | |
442 | break; | |
443 | } | |
444 | case 'j' : { | |
445 | Vector3d ji; | |
446 | < | if (integrableObject->isDirectional()) { |
446 | > | if (sd->isDirectional()) { |
447 | ji[0] = tokenizer.nextTokenAsDouble(); | |
448 | ji[1] = tokenizer.nextTokenAsDouble(); | |
449 | ji[2] = tokenizer.nextTokenAsDouble(); | |
450 | if (needAngMom_) { | |
451 | < | integrableObject->setJ(ji); |
451 | > | sd->setJ(ji); |
452 | } | |
453 | } | |
454 | break; | |
# | Line 456 | Line 459 | namespace OpenMD { | |
459 | force[0] = tokenizer.nextTokenAsDouble(); | |
460 | force[1] = tokenizer.nextTokenAsDouble(); | |
461 | force[2] = tokenizer.nextTokenAsDouble(); | |
462 | < | integrableObject->setFrc(force); |
462 | > | sd->setFrc(force); |
463 | break; | |
464 | } | |
465 | case 't' : { | |
# | Line 465 | Line 468 | namespace OpenMD { | |
468 | torque[0] = tokenizer.nextTokenAsDouble(); | |
469 | torque[1] = tokenizer.nextTokenAsDouble(); | |
470 | torque[2] = tokenizer.nextTokenAsDouble(); | |
471 | < | integrableObject->setTrq(torque); |
471 | > | sd->setTrq(torque); |
472 | break; | |
473 | } | |
474 | case 'u' : { | |
475 | ||
476 | RealType particlePot; | |
477 | particlePot = tokenizer.nextTokenAsDouble(); | |
478 | < | integrableObject->setParticlePot(particlePot); |
478 | > | sd->setParticlePot(particlePot); |
479 | break; | |
480 | } | |
481 | case 'c' : { | |
482 | ||
483 | RealType flucQPos; | |
484 | flucQPos = tokenizer.nextTokenAsDouble(); | |
485 | < | integrableObject->setFlucQPos(flucQPos); |
485 | > | sd->setFlucQPos(flucQPos); |
486 | break; | |
487 | } | |
488 | case 'w' : { | |
489 | ||
490 | RealType flucQVel; | |
491 | flucQVel = tokenizer.nextTokenAsDouble(); | |
492 | < | integrableObject->setFlucQVel(flucQVel); |
492 | > | sd->setFlucQVel(flucQVel); |
493 | break; | |
494 | } | |
495 | case 'g' : { | |
496 | ||
497 | RealType flucQFrc; | |
498 | flucQFrc = tokenizer.nextTokenAsDouble(); | |
499 | < | integrableObject->setFlucQFrc(flucQFrc); |
499 | > | sd->setFlucQFrc(flucQFrc); |
500 | break; | |
501 | } | |
502 | case 'e' : { | |
# | Line 502 | Line 505 | namespace OpenMD { | |
505 | eField[0] = tokenizer.nextTokenAsDouble(); | |
506 | eField[1] = tokenizer.nextTokenAsDouble(); | |
507 | eField[2] = tokenizer.nextTokenAsDouble(); | |
508 | < | integrableObject->setElectricField(eField); |
508 | > | sd->setElectricField(eField); |
509 | break; | |
510 | } | |
511 | default: { | |
# | Line 538 | Line 541 | namespace OpenMD { | |
541 | */ | |
542 | ||
543 | int index = tokenizer.nextTokenAsInt(); | |
544 | < | StuntDouble* integrableObject = info_->getIOIndexToIntegrableObject(index); |
545 | < | if (integrableObject == NULL) { |
544 | > | StuntDouble* sd = info_->getIOIndexToIntegrableObject(index); |
545 | > | if (sd == NULL) { |
546 | return; | |
547 | } | |
545 | – | StuntDouble* sd = integrableObject; |
548 | ||
549 | /** | |
550 | * Test to see if the next token is an integer or not. If not, | |
# | Line 556 | Line 558 | namespace OpenMD { | |
558 | if (i >> siteIndex) { | |
559 | // chew up this token and parse as an int: | |
560 | siteIndex = tokenizer.nextTokenAsInt(); | |
561 | < | RigidBody* rb = static_cast<RigidBody*>(integrableObject); |
561 | > | RigidBody* rb = static_cast<RigidBody*>(sd); |
562 | sd = rb->getAtoms()[siteIndex]; | |
563 | } | |
564 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |