- 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
- Files:
-
- 3 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 -
src/Dynamics/ForceAnnealing.hpp
r12f16c refd020 139 139 iter != AtomicForceManipulator<T>::atoms.end(); ++iter) { 140 140 // atom's force vector gives steepest descent direction 141 const Vector oldPosition = (*iter)->getPositionAtStep(CurrentTimeStep- 2 >= 0 ? CurrentTimeStep - 2: 0);142 const Vector currentPosition = (*iter)->getPosition ();143 const Vector oldGradient = (*iter)->getAtomicForceAtStep(CurrentTimeStep- 2 >= 0 ? CurrentTimeStep - 2: 0);144 const Vector currentGradient = (*iter)->getAtomicForce ();141 const Vector oldPosition = (*iter)->getPositionAtStep(CurrentTimeStep-1 >= 0 ? CurrentTimeStep - 1 : 0); 142 const Vector currentPosition = (*iter)->getPositionAtStep(CurrentTimeStep); 143 const Vector oldGradient = (*iter)->getAtomicForceAtStep(CurrentTimeStep-1 >= 0 ? CurrentTimeStep - 1 : 0); 144 const Vector currentGradient = (*iter)->getAtomicForceAtStep(CurrentTimeStep); 145 145 LOG(4, "DEBUG: oldPosition for atom " << **iter << " is " << oldPosition); 146 146 LOG(4, "DEBUG: currentPosition for atom " << **iter << " is " << currentPosition); … … 197 197 * 198 198 * 199 * \param CurrentTimeStep current time step (i.e. \f$ t + \Delta t \f$in the sense of the velocity verlet)199 * \param CurrentTimeStep current time step (i.e. t where \f$ t + \Delta t \f$ is in the sense of the velocity verlet) 200 200 * \param offset offset in matrix file to the first force component 201 201 * \param maxComponents to be filled with maximum force component over all atoms … … 226 226 iter != AtomicForceManipulator<T>::atoms.end(); ++iter) { 227 227 // atom's force vector gives steepest descent direction 228 const Vector oldPosition = (*iter)->getPositionAtStep(CurrentTimeStep- 2 >= 0 ? CurrentTimeStep - 2: 0);229 const Vector currentPosition = (*iter)->getPosition ();230 const Vector oldGradient = (*iter)->getAtomicForceAtStep(CurrentTimeStep- 2 >= 0 ? CurrentTimeStep - 2: 0);231 const Vector currentGradient = (*iter)->getAtomicForce ();228 const Vector oldPosition = (*iter)->getPositionAtStep(CurrentTimeStep-1 >= 0 ? CurrentTimeStep - 1 : 0); 229 const Vector currentPosition = (*iter)->getPositionAtStep(CurrentTimeStep); 230 const Vector oldGradient = (*iter)->getAtomicForceAtStep(CurrentTimeStep-1 >= 0 ? CurrentTimeStep - 1 : 0); 231 const Vector currentGradient = (*iter)->getAtomicForceAtStep(CurrentTimeStep); 232 232 LOG(4, "DEBUG: Force for atom " << **iter << " is " << currentGradient); 233 233 … … 269 269 const bond ¤t_bond = *(*bonditer); 270 270 LOG(2, "DEBUG: Looking at bond " << current_bond); 271 Vector BondVector = (*iter)->getPosition ();271 Vector BondVector = (*iter)->getPositionAtStep(CurrentTimeStep); 272 272 BondVector -= ((*iter)->getId() == current_bond.rightatom->getId()) 273 ? current_bond.rightatom->getPosition () : current_bond.leftatom->getPosition();273 ? current_bond.rightatom->getPositionAtStep(CurrentTimeStep) : current_bond.leftatom->getPositionAtStep(CurrentTimeStep); 274 274 BondVector.Normalize(); 275 275 if (BondVector.ScalarProduct(currentGradient) < 0) {
Note:
See TracChangeset
for help on using the changeset viewer.