Changeset c87d6e for src/Actions
- Timestamp:
- Apr 10, 2018, 6:43:12 AM (7 years ago)
- Branches:
- AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, PythonUI_with_named_parameters, StoppableMakroAction, TremoloParser_IncreasedPrecision
- Children:
- 9bb8c8
- Parents:
- 6145577
- git-author:
- Frederik Heber <frederik.heber@…> (11/04/17 10:00:15)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/10/18 06:43:12)
- Location:
- src/Actions/MoleculeAction
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MoleculeAction/ForceAnnealingAction.cpp
r6145577 rc87d6e 90 90 iter != World::getInstance().endAtomSelection(); 91 91 ++iter) 92 UndoInfo[i].push_back(AtomicInfo(*(iter->second), CurrentStep-i));92 UndoInfo[i].push_back(AtomicInfo(*(iter->second), CurrentStep-i)); 93 93 } 94 94 } 95 std::vector<int> UndoTrajectorySize; 96 UndoTrajectorySize.reserve(set.size()); 97 for (World::AtomSelectionConstIterator iter = World::getInstance().beginAtomSelection(); 98 iter != World::getInstance().endAtomSelection(); 99 ++iter) 100 UndoTrajectorySize.push_back(iter->second->getTrajectorySize()); 95 101 96 102 // instantiate optimizer … … 129 135 130 136 MoleculeForceAnnealingState *UndoState = 131 new MoleculeForceAnnealingState(UndoInfo, RedoInfo, params);137 new MoleculeForceAnnealingState(UndoInfo, UndoTrajectorySize, RedoInfo, params); 132 138 133 139 return ActionState::ptr(UndoState); … … 139 145 const size_t CurrentStep = WorldTime::getInstance().getTime(); 140 146 141 // set stored old state 142 for (int i=0;i<2;++i) 143 SetAtomsFromAtomicInfo(state->UndoInfo[i], CurrentStep-i); 147 // set stored old state and remove current one from trajectory if we set it 148 for (int i=0;i<2;++i) { 149 for(size_t j=0;j<state->UndoInfo[i].size();++j) { 150 const AtomicInfo &_atominfo = state->UndoInfo[i][j]; 151 const atomId_t id = _atominfo.getId(); 152 atom * const _atom = World::getInstance().getAtom(AtomById(id)); 153 ASSERT( _atom != NULL, 154 "MoleCuilder::SetAtomsFromAtomicInfo() - cannot find atom with id " 155 +toString(id)+" in the world."); 156 if (state->UndoTrajectorySize[j] > CurrentStep-i) 157 _atominfo.setAtom( *_atom, CurrentStep-i ); 158 else 159 _atom->removeSteps(state->UndoTrajectorySize[j], CurrentStep-i); 160 } 161 } 144 162 145 163 return ActionState::ptr(_state); -
src/Actions/MoleculeAction/ForceAnnealingAction.def
r6145577 rc87d6e 32 32 (DummyValidator<bool>()) 33 33 34 #define statetypes (std::vector< std::vector<AtomicInfo> >)(std::vector< std::vector<AtomicInfo> >)35 #define statereferences (UndoInfo)( RedoInfo)34 #define statetypes (std::vector< std::vector<AtomicInfo> >)(std::vector<int>)(std::vector< std::vector<AtomicInfo> >) 35 #define statereferences (UndoInfo)(UndoTrajectorySize)(RedoInfo) 36 36 37 37 // some defines for all the names, you may use ACTION, STATE and PARAMS
Note:
See TracChangeset
for help on using the changeset viewer.