Changeset efd020 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:
- 8c6b68
- Parents:
- 12f16c
- git-author:
- Frederik Heber <frederik.heber@…> (09/11/17 17:03:27)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/10/18 06:43:12)
- Location:
- src/Actions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/StructuralOptimizationAction.cpp
r12f16c refd020 69 69 prototype_actions.addAction(AR.getActionByName(std::string("fragment-automation")).clone()); 70 70 prototype_actions.addAction(AR.getActionByName(std::string("analyse-fragment-results")).clone()); 71 prototype_actions.addAction(AR.getActionByName(std::string("step-world-time")).clone()); 71 72 prototype_actions.addAction(AR.getActionByName(std::string("force-annealing")).clone()); 72 73 prototype_actions.addAction(AR.getActionByName(std::string("output")).clone()); -
src/Actions/MoleculeAction/ForceAnnealingAction.cpp
r12f16c refd020 94 94 params.DampingFactor.get()); 95 95 size_t CurrentStep = WorldTime::getInstance().getTime(); 96 if (CurrentStep == 0) { 97 ELOG(1, "WorldTime must be at least at step 1 already, use step-world-time if necessary."); 98 return Action::failure; 99 } 96 100 97 // parse forces into current step101 // parse forces into last step (assuming we stepped on already) 98 102 if (!params.forcesfile.get().string().empty()) { 99 103 LOG(1, "Parsing forces file."); 100 if (!optimizer.parseForcesFile(params.forcesfile.get().string().c_str(), CurrentStep ))104 if (!optimizer.parseForcesFile(params.forcesfile.get().string().c_str(), CurrentStep-1)) 101 105 LOG(2, "File " << params.forcesfile.get() << " not found."); 102 106 else … … 104 108 } 105 109 106 // copy current time step to new one and and proceed on this one107 {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 them115 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 graph121 ++CurrentStep;122 World::getInstance().setTime(CurrentStep);123 }124 125 110 // perform optimization step 126 111 LOG(1, "Structural optimization."); 127 optimizer(CurrentStep , 1, params.UseBondGraph.get());112 optimizer(CurrentStep-1, 1, params.UseBondGraph.get()); 128 113 STATUS("Successfully optimized structure by one step."); 129 114
Note:
See TracChangeset
for help on using the changeset viewer.