Changeset 12f16c 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:
- efd020
- Parents:
- 2bb3be
- git-author:
- Frederik Heber <frederik.heber@…> (08/02/17 21:22:15)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/10/18 06:43:12)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MoleculeAction/ForceAnnealingAction.cpp
r2bb3be r12f16c 85 85 } 86 86 87 size_t CurrentStep = WorldTime::getInstance().getTime(); 88 { 89 // copy current time step to new one and and proceed on this one 90 for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); 91 iter != World::getInstance().endAtomSelection(); 92 ++iter) { 93 atom * const Walker = iter->second; 94 Walker->setPositionAtStep(CurrentStep+1, 95 Walker->getPositionAtStep(CurrentStep)); 96 if (!params.forcesfile.get().string().empty()) { 97 // don't use forces or velocities from old step 98 Walker->setAtomicVelocityAtStep(CurrentStep+1, zeroVec); 99 Walker->setAtomicForceAtStep(CurrentStep+1, zeroVec); 100 } else { 101 // force have already been calculated, hence copy them 102 Walker->setAtomicVelocityAtStep(CurrentStep+1, 103 Walker->getAtomicVelocityAtStep(CurrentStep)); 104 Walker->setAtomicForceAtStep(CurrentStep+1, 105 Walker->getAtomicForceAtStep(CurrentStep)); 106 } 107 } 108 // increment to next time step: re-creates bond graph 109 ++CurrentStep; 110 World::getInstance().setTime(CurrentStep); 111 } 87 // instantiate optimizer 112 88 ForceAnnealing<std::vector<atom *> > optimizer( 113 89 set, … … 117 93 params.MaxDistance.get(), 118 94 params.DampingFactor.get()); 119 // parse forces into next step 95 size_t CurrentStep = WorldTime::getInstance().getTime(); 96 97 // parse forces into current step 120 98 if (!params.forcesfile.get().string().empty()) { 121 99 LOG(1, "Parsing forces file."); … … 126 104 } 127 105 106 // copy current time step to new one and and proceed on this one 107 { 108 for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); 109 iter != World::getInstance().endAtomSelection(); 110 ++iter) { 111 atom * const Walker = iter->second; 112 Walker->setPositionAtStep(CurrentStep+1, 113 Walker->getPositionAtStep(CurrentStep)); 114 // force have already been calculated, hence copy them 115 Walker->setAtomicVelocityAtStep(CurrentStep+1, 116 Walker->getAtomicVelocityAtStep(CurrentStep)); 117 Walker->setAtomicForceAtStep(CurrentStep+1, 118 Walker->getAtomicForceAtStep(CurrentStep)); 119 } 120 // increment to next time step: re-creates bond graph 121 ++CurrentStep; 122 World::getInstance().setTime(CurrentStep); 123 } 124 128 125 // perform optimization step 129 126 LOG(1, "Structural optimization."); 130 127 optimizer(CurrentStep, 1, params.UseBondGraph.get()); 131 128 STATUS("Successfully optimized structure by one step."); 132 133 // // increment to next time step134 // World::getInstance().setTime(CurrentStep+1);135 129 136 130 std::vector<AtomicInfo> RedoInfo;
Note:
See TracChangeset
for help on using the changeset viewer.