Changeset 67e885 for src/Parser/TremoloParser.cpp
- Timestamp:
- Jul 3, 2017, 3:07:28 PM (8 years ago)
- Branches:
- ForceAnnealing_oldresults, IndependentFragmentGrids_IntegrationTest
- Children:
- 092ede
- Parents:
- ef8667
- git-author:
- Frederik Heber <frederik.heber@…> (06/17/17 23:09:44)
- git-committer:
- Frederik Heber <frederik.heber@…> (07/03/17 15:07:28)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/TremoloParser.cpp
ref8667 r67e885 146 146 size_t timestep = 0; 147 147 atom *addedatom = NULL; 148 std:: vector<atom *> addedatoms;149 std:: vector<atom *>::iterator atomiter = addedatoms.begin();148 std::list<atom *> addedatoms; 149 std::list<atom *>::iterator atomiter = addedatoms.begin(); 150 150 while (file->good()) { 151 151 std::getline(*file, line, '\n'); … … 226 226 distributeContinuousIds(AtomList); 227 227 228 // store atomdata 229 save_AtomDataLine(file); 230 231 // store box 232 save_BoxLine(file); 233 234 // store particles 235 for (std::vector<const atom*>::const_iterator atomIt = AtomList.begin(); 236 atomIt != AtomList.end(); ++atomIt) 237 saveLine(file, *atomIt); 228 std::pair<size_t, size_t> minmax_trajectories = 229 getMinMaxTrajectories(AtomList); 230 LOG(2, "INFO: There are " << minmax_trajectories.second << " steps to save."); 231 232 for (size_t step = 0; (step < minmax_trajectories.second) || (step == 0); ++step) { 233 // store atomdata 234 save_AtomDataLine(file); 235 236 // store box only on first step 237 if (step == 0) 238 save_BoxLine(file); 239 240 // store particles 241 for (std::vector<const atom*>::const_iterator atomIt = AtomList.begin(); 242 atomIt != AtomList.end(); ++atomIt) 243 saveLine(file, *atomIt, step); 244 } 238 245 } 239 246 … … 495 502 void FormatParser< tremolo >::saveLine( 496 503 std::ostream* file, 497 const atom * const currentAtom) 504 const atom * const currentAtom, 505 const size_t _timestep) 498 506 { 499 507 TremoloKey::atomDataKey currentField; 500 508 501 LOG(4, "INFO: Saving atom " << *currentAtom << ", its father id is " << currentAtom->GetTrueFather()->getId()); 509 LOG(4, "INFO: Saving atom " << *currentAtom << ", its father id is " 510 << currentAtom->GetTrueFather()->getId() << " at time step " << _timestep); 502 511 503 512 for (usedFields_t::iterator it = usedFields_save.begin(); it != usedFields_save.end(); it++) { … … 506 515 case TremoloKey::x : 507 516 // for the moment, assume there are always three dimensions 508 LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getPosition ());509 *file << currentAtom->at (0) << "\t";510 *file << currentAtom->at (1) << "\t";511 *file << currentAtom->at (2) << "\t";517 LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getPositionAtStep(_timestep)); 518 *file << currentAtom->atStep(0, _timestep) << "\t"; 519 *file << currentAtom->atStep(1, _timestep) << "\t"; 520 *file << currentAtom->atStep(2, _timestep) << "\t"; 512 521 break; 513 522 case TremoloKey::u : 514 523 // for the moment, assume there are always three dimensions 515 LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getAtomicVelocity ());516 *file << currentAtom->getAtomicVelocity ()[0] << "\t";517 *file << currentAtom->getAtomicVelocity ()[1] << "\t";518 *file << currentAtom->getAtomicVelocity ()[2] << "\t";524 LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getAtomicVelocityAtStep(_timestep)); 525 *file << currentAtom->getAtomicVelocityAtStep(_timestep)[0] << "\t"; 526 *file << currentAtom->getAtomicVelocityAtStep(_timestep)[1] << "\t"; 527 *file << currentAtom->getAtomicVelocityAtStep(_timestep)[2] << "\t"; 519 528 break; 520 529 case TremoloKey::F : 521 530 // for the moment, assume there are always three dimensions 522 LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getAtomicForce ());523 *file << currentAtom->getAtomicForce ()[0] << "\t";524 *file << currentAtom->getAtomicForce ()[1] << "\t";525 *file << currentAtom->getAtomicForce ()[2] << "\t";531 LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getAtomicForceAtStep(_timestep)); 532 *file << currentAtom->getAtomicForceAtStep(_timestep)[0] << "\t"; 533 *file << currentAtom->getAtomicForceAtStep(_timestep)[1] << "\t"; 534 *file << currentAtom->getAtomicForceAtStep(_timestep)[2] << "\t"; 526 535 break; 527 536 case TremoloKey::type :
Note:
See TracChangeset
for help on using the changeset viewer.