Changeset 1e4f0a for src/Dynamics/ForceAnnealing.hpp
- Timestamp:
- Sep 13, 2017, 5:20:45 PM (8 years ago)
- Children:
- 1db3520
- Parents:
- 15acdb
- File:
-
- 1 edited
-
src/Dynamics/ForceAnnealing.hpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Dynamics/ForceAnnealing.hpp
r15acdb r1e4f0a 78 78 maxSteps(_maxSteps), 79 79 max_distance(_max_distance), 80 damping_factor(_damping_factor) 80 damping_factor(_damping_factor), 81 FORCE_THRESHOLD(1e-8) 81 82 {} 82 83 … … 94 95 * \param _TimeStep current time step (i.e. \f$ t + \Delta t \f$ in the sense of the velocity verlet) 95 96 * \param offset offset in matrix file to the first force component 97 * \return false - need to continue annealing, true - may stop because forces very small 96 98 * \todo This is not yet checked if it is correctly working with DoConstrainedMD set >0. 97 99 */ 98 voidoperator()(100 bool operator()( 99 101 const int _TimeStep, 100 102 const size_t _offset, … … 134 136 << currentStep << " are " << maxComponents); 135 137 138 // check whether are smaller than threshold 139 bool AnnealingFinished = false; 140 double maxcomp = 0.; 141 for (size_t i=0;i<NDIM;++i) 142 maxcomp = std::max(maxcomp, fabs(maxComponents[i])); 143 if (maxcomp < FORCE_THRESHOLD) { 144 LOG(1, "STATUS: Force components are all less than " << FORCE_THRESHOLD 145 << ", stopping."); 146 currentStep = maxSteps; 147 AnnealingFinished = true; 148 } 149 136 150 // are we in final step? Remember to reset static entities 137 151 if (currentStep == maxSteps) { … … 139 153 reset(); 140 154 } 155 156 return AnnealingFinished; 141 157 } 142 158 … … 627 643 //!> the shifted is dampened by this factor with the power of the bond graph distance to the shift causing atom 628 644 const double damping_factor; 645 //!> threshold for force components to stop annealing 646 const double FORCE_THRESHOLD; 629 647 }; 630 648
Note:
See TracChangeset
for help on using the changeset viewer.
