- Timestamp:
- Apr 4, 2018, 4:59:48 PM (7 years ago)
- Branches:
- AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, PythonUI_with_named_parameters, StoppableMakroAction, TremoloParser_IncreasedPrecision
- Children:
- 322d58
- Parents:
- 9b32071
- git-author:
- Frederik Heber <heber@…> (04/05/17 15:10:22)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/04/18 16:59:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Dynamics/ForceAnnealing.hpp
r9b32071 r1e49e6 85 85 } 86 86 87 // are we in initial step? Then don't check against velocity88 87 Vector maxComponents(zeroVec); 89 88 for(typename AtomSetMixin<T>::iterator iter = AtomicForceManipulator<T>::atoms.begin(); … … 93 92 const Vector currentGradient = (*iter)->getAtomicForce(); 94 93 LOG(4, "DEBUG: Force for atom " << **iter << " is " << currentGradient); 94 95 // artificial update: deltat may be considered as 1/2 s^2 units, mass 96 // is neglected deliberately as this makes all atoms equally fast or 97 // hydrogens slower (and they need to wait for other atoms to arrive at 98 // final position). 95 99 Vector PositionUpdate = currentDeltat * currentGradient; 96 100 LOG(3, "DEBUG: Update would be " << PositionUpdate); … … 101 105 maxComponents[i] = currentGradient[i]; 102 106 103 // update with currentDelta tells us how the current gradient relates to 104 // the last one: If it has become larger, reduce currentDelta 107 // are we in initial step? Then don't check against velocity 105 108 if ((currentStep > 1) && (!(*iter)->getAtomicVelocity().IsZero())) 109 // update with currentDelta tells us how the current gradient relates to 110 // the last one: If it has become larger, reduce currentDelta 106 111 if ((PositionUpdate.ScalarProduct((*iter)->getAtomicVelocity()) < 0) 107 112 && (currentDeltat > MinimumDeltat)) { … … 130 135 if (currentStep == maxSteps) { 131 136 LOG(2, "DEBUG: Final step, resetting values"); 132 currentDeltat = 0.; 133 currentStep = 0; 137 reset(); 138 } 139 } 134 140 135 // reset (artifical) velocities 136 for(typename AtomSetMixin<T>::iterator iter = AtomicForceManipulator<T>::atoms.begin(); 137 iter != AtomicForceManipulator<T>::atoms.end(); ++iter) 138 (*iter)->setAtomicVelocity(zeroVec); 139 } 141 /** Reset function to unset static entities and artificial velocities. 142 * 143 */ 144 void reset() 145 { 146 currentDeltat = 0.; 147 currentStep = 0; 148 149 // reset (artifical) velocities 150 for(typename AtomSetMixin<T>::iterator iter = AtomicForceManipulator<T>::atoms.begin(); 151 iter != AtomicForceManipulator<T>::atoms.end(); ++iter) 152 (*iter)->setAtomicVelocity(zeroVec); 140 153 } 141 154
Note:
See TracChangeset
for help on using the changeset viewer.