Changeset 84f449
- Timestamp:
- Jul 5, 2017, 7:45:46 PM (8 years ago)
- Branches:
- ForceAnnealing_oldresults
- Children:
- bd0159
- Parents:
- 8ab061f
- git-author:
- Frederik Heber <heber@…> (04/05/17 15:10:22)
- git-committer:
- Frederik Heber <frederik.heber@…> (07/05/17 19:45:46)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Dynamics/ForceAnnealing.hpp
r8ab061f r84f449 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.