- Timestamp:
- Nov 7, 2017, 7:34:56 AM (7 years ago)
- Branches:
- ForceAnnealing_with_BondGraph_continued_betteresults
- Children:
- 38ac25
- Parents:
- 5a289c
- git-author:
- Frederik Heber <frederik.heber@…> (08/03/17 10:46:48)
- git-committer:
- Frederik Heber <frederik.heber@…> (11/07/17 07:34:56)
- Location:
- src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MoleculeAction/VerletIntegrationAction.cpp
r5a289c r0f9726 134 134 135 135 // remove current step for all modified atoms 136 remove LastStep(getIdsFromAtomicInfo(state->UndoInfo), CurrentStep+1);136 removeSteps(getIdsFromAtomicInfo(state->UndoInfo), CurrentStep+1, CurrentStep+1); 137 137 138 138 // and set back the old step (forces have been changed) -
src/Actions/UndoRedoHelpers.cpp
r5a289c r0f9726 219 219 } 220 220 221 void MoleCuilder::removeLastStep(const std::vector<atomId_t> &_atoms, const unsigned int _step) 222 { 223 for (size_t i=0; i<_atoms.size(); ++i) { 224 atom * const _atom = World::getInstance().getAtom(AtomById(_atoms[i])); 225 _atom->removeStep(_step); 221 void MoleCuilder::removeSteps( 222 const std::vector<atomId_t> &movedatoms, 223 const unsigned int _firststep, 224 const unsigned int _laststep) 225 { 226 for (std::vector<atomId_t>::const_iterator iter = movedatoms.begin(); 227 iter != movedatoms.end(); ++iter) { 228 atom * const _atom = World::getInstance().getAtom(AtomById(*iter)); 229 _atom->removeSteps(_firststep, _laststep); 226 230 } 227 231 } -
src/Actions/UndoRedoHelpers.hpp
r5a289c r0f9726 111 111 void RemoveMoleculesWithAtomsByIds(const std::vector<moleculeId_t> &ids); 112 112 113 /** Removes the last time step for all \a movedatoms113 /** Removes the time steps in given interval for all \a movedatoms. 114 114 * 115 * @param movedatoms atoms whose last step in time to remove 116 * @param _step which trajectory to remove 115 * @param movedatoms atoms whose steps in [\a _firststep, \a _laststep] in time to remove 116 * @param _firststep first step in interval to be removed 117 * @param _laststep last step in interval to be removed 117 118 */ 118 void removeLastStep(const std::vector<atomId_t> &movedatoms, const unsigned int _step); 119 void removeSteps( 120 const std::vector<atomId_t> &movedatoms, 121 const unsigned int _firststep, 122 const unsigned int _laststep); 119 123 120 124 /** Adds another time step to all \a movedatoms. -
src/Atom/TesselPoint.cpp
r5a289c r0f9726 58 58 }; 59 59 60 void TesselPoint::removeStep (const unsigned int _step)60 void TesselPoint::removeSteps(const unsigned int _firststep, const unsigned int _laststep) 61 61 { 62 ASSERT(0, "TesselPoint::removeStep () should never be called, TesselPoints don't have trajectories.");63 AtomInfo::removeTrajectoryStep (_step);62 ASSERT(0, "TesselPoint::removeSteps() should never be called, TesselPoints don't have trajectories."); 63 AtomInfo::removeTrajectorySteps(_firststep, _laststep); 64 64 }; 65 65 -
src/Atom/TesselPoint.hpp
r5a289c r0f9726 43 43 * This allows to decrease all trajectories contained in different classes 44 44 * by one consistently. This is implemented by the topmost class which calls 45 * the real functions, \sa removeTrajectoryStep(), by all necessary subclasses. 45 * the real functions, \sa removeTrajectorySteps(), by all necessary subclasses. 46 * 47 * \param _firststep first step in interval to be removed 48 * \param _laststep last step in interval to be removed 46 49 */ 47 virtual void removeStep (const unsigned int _step);50 virtual void removeSteps(const unsigned int _firststep, const unsigned int _laststep); 48 51 49 52 /** Getter for this. -
src/Atom/atom.cpp
r5a289c r0f9726 108 108 } 109 109 110 void atom::removeStep (const unsigned int _step)111 { 112 LOG(4,"atom::removeStep () called.");110 void atom::removeSteps(const unsigned int _firststep, const unsigned int _laststep) 111 { 112 LOG(4,"atom::removeSteps() called."); 113 113 // append to position, velocity and force vector 114 AtomInfo::removeTrajectoryStep (_step);114 AtomInfo::removeTrajectorySteps(_firststep, _laststep); 115 115 // append to ListOfBonds vector 116 BondedParticleInfo::removeTrajectoryStep (_step);116 BondedParticleInfo::removeTrajectorySteps(_firststep, _laststep); 117 117 } 118 118 -
src/Atom/atom.hpp
r5a289c r0f9726 79 79 * This allows to decrease all trajectories contained in different classes 80 80 * by one consistently. This is implemented by the topmost class which calls 81 * the real functions, \sa removeTrajectoryStep(), by all necessary subclasses. 82 */ 83 virtual void removeStep(const unsigned int _step); 81 * the real functions, \sa removeTrajectorySteps(), by all necessary subclasses. 82 * 83 * \param _firststep first step in interval to be removed 84 * \param _laststep last step in interval to be removed 85 */ 86 virtual void removeSteps(const unsigned int _firststep, const unsigned int _laststep); 84 87 85 88 /** Output of a single atom with given numbering. -
src/Atom/atom_atominfo.cpp
r5a289c r0f9726 101 101 } 102 102 103 void AtomInfo::removeTrajectoryStep(const unsigned int _step) 103 void AtomInfo::eraseInTrajctory( 104 VectorTrajectory_t &_trajectory, 105 const unsigned int _firststep, const unsigned int _laststep) 106 { 107 const VectorTrajectory_t::iterator firstiter = _trajectory.lower_bound(_firststep); 108 const VectorTrajectory_t::iterator lastiter = _trajectory.upper_bound(_laststep); 109 _trajectory.erase(firstiter, lastiter); 110 } 111 112 void AtomInfo::removeTrajectorySteps(const unsigned int _firststep, const unsigned int _laststep) 104 113 { 105 114 NOTIFY(TrajectoryChanged); 106 AtomicPosition.erase(_step);107 AtomicVelocity.erase(_step);108 AtomicForce.erase(_step);109 LOG(5,"AtomInfo::removeTrajectoryStep () called, size is ("115 eraseInTrajctory(AtomicPosition, _firststep, _laststep); 116 eraseInTrajctory(AtomicVelocity, _firststep, _laststep); 117 eraseInTrajctory(AtomicForce, _firststep, _laststep); 118 LOG(5,"AtomInfo::removeTrajectorySteps() called, size is (" 110 119 << AtomicPosition.size() << "," 111 120 << AtomicVelocity.size() << "," -
src/Atom/atom_atominfo.hpp
r5a289c r0f9726 58 58 virtual void UpdateStep(const unsigned int _step)=0; 59 59 60 /** Pops the last stepin all trajectory vectors.60 /** Pops all steps in the interval [\a _firststep, \a _laststep] in all trajectory vectors. 61 61 * 62 62 * This allows to decrease all trajectories contained in different classes 63 63 * by one consistently. This is implemented by the topmost class which calls 64 * the real functions, \sa removeTrajectoryStep(), by all necessary subclasses. 65 */ 66 virtual void removeStep(const unsigned int _step)=0; 64 * the real functions, \sa removeTrajectorySteps(), by all necessary subclasses. 65 * 66 * \param _firststep first step in interval to be removed 67 * \param _laststep last step in interval to be removed 68 */ 69 virtual void removeSteps(const unsigned int _firststep, const unsigned int _laststep)=0; 67 70 68 71 /** DEPRECATED: Getter for element indicated by AtomicElement. … … 314 317 /** Function used by this and inheriting classes to decrease the trajectory 315 318 * vectors by one. 316 */ 317 void removeTrajectoryStep(const unsigned int _step); 319 * 320 * \param _firststep first step in interval to be removed 321 * \param _laststep last step in interval to be removed 322 */ 323 void removeTrajectorySteps(const unsigned int _firststep, const unsigned int _laststep); 318 324 319 325 // make these protected only such that deriving atom class still has full … … 325 331 VectorTrajectory_t AtomicVelocity; //!< velocity vector of atom, giving last velocity within cell 326 332 VectorTrajectory_t AtomicForce; //!< Force vector of atom, giving last force within cell 333 334 /** Helper function to avoid an interval of steps in VectorTrajectory_t. 335 * 336 * \param _trajectory trajectory to remove in 337 * \param _firststep first step in interval to be removed 338 * \param _laststep last step in interval to be removed 339 */ 340 static void eraseInTrajctory( 341 VectorTrajectory_t &_trajectory, 342 const unsigned int _firststep, const unsigned int _laststep); 327 343 328 344 private: -
src/Atom/atom_bondedparticleinfo.cpp
r5a289c r0f9726 51 51 } 52 52 53 void BondedParticleInfo::removeTrajectoryStep (const unsigned int _step)53 void BondedParticleInfo::removeTrajectorySteps(const unsigned int _firststep, const unsigned int _laststep) 54 54 { 55 ListOfBonds.erase(_step); 56 LOG(5,"BondedParticleInfo::removeTrajectoryStep() called, size is " << ListOfBonds.size()); 55 const BondTrajectory_t::iterator firstiter = ListOfBonds.lower_bound(_firststep); 56 const BondTrajectory_t::iterator lastiter = ListOfBonds.upper_bound(_laststep); 57 ListOfBonds.erase(firstiter, lastiter); 58 LOG(5,"BondedParticleInfo::removeTrajectorySteps() called, size is " << ListOfBonds.size()); 57 59 } 58 60 -
src/Atom/atom_bondedparticleinfo.hpp
r5a289c r0f9726 52 52 * This allows to decrease all trajectories contained in different classes 53 53 * by one consistently. This is implemented by the topmost class which calls 54 * the real functions, \sa removeTrajectoryStep(), by all necessary subclasses. 54 * the real functions, \sa removeTrajectorySteps(), by all necessary subclasses. 55 * 56 * \param _firststep first step in interval to be removed 57 * \param _laststep last step in interval to be removed 55 58 */ 56 virtual void removeStep (const unsigned int _step)=0;59 virtual void removeSteps(const unsigned int _firststep, const unsigned int _laststep)=0; 57 60 58 61 /** Const accessor to ListOfBonds of WorldTime::CurrentTime. … … 131 134 /** Function used by this and inheriting classes to reduce the ListOfBonds 132 135 * vector by one. 136 * 137 * \param _firststep first step in interval to be removed 138 * \param _laststep last step in interval to be removed 133 139 */ 134 void removeTrajectoryStep (const unsigned int _step);140 void removeTrajectorySteps(const unsigned int _firststep, const unsigned int _laststep); 135 141 136 142 typedef std::map<unsigned int, BondList> BondTrajectory_t;
Note:
See TracChangeset
for help on using the changeset viewer.