86 {
88
89 QUILL_LOG_DEBUG(log,
90 "Triggering MMF. Force: {:.4f}, Threshold: {:.4f} "
91 "({:.2f}x baseline)",
94
95
96
99 const double previousWalkedForce =
102
103
105 const double savedEnergy = neb.
path[walked]->getPotentialEnergy();
106
107 double alignment = 0.0;
108 int mmfResult =
runDimer(neb, alignment);
109
110
114
115
116
117
119 QUILL_LOG_DEBUG(log, "NEB converged after MMF. Force: {:.4f}", newForce);
120 return {newForce, true, false};
121 }
122
123 const double walkedForce =
126 const bool mmfHelped =
127 walkHelped(walkedForce, previousWalkedForce, mmfResult);
128
129 if (mmfHelped) {
131 QUILL_LOG_DEBUG(log,
132 "MMF helped (status={}, walked={}, now_ci={}). "
133 "Walked force: {:.4f} -> {:.4f} ({:.2f}x baseline). "
134 "Band CI force: {:.4f}. New threshold: {:.4f}",
138 } else {
139
140
141
142
143
144 const bool restore =
cfg_.restore_unhelpful || mmfResult == -2;
145 if (restore) {
146 neb.
path[walked]->setPositions(savedPositions);
147 neb.
path[walked]->setEvaluation(savedForces, savedEnergy);
150 newForce = convForce;
151 }
153 QUILL_LOG_DEBUG(
154 log,
155 "MMF backoff (status={}, walked={}, now_ci={}). "
156 "Walked force: {:.4f} -> {:.4f}, band CI: {:.4f}, "
157 "Alignment: {:.3f}. {}New threshold: {:.4f} ({:.2f}x baseline)",
158 mmfResult, walked, neb.
climbingImage, previousWalkedForce, walkedForce,
161 }
162
163 if (mmfHelped) {
164
165
167 std::span{neb.
path.data(), neb.
path.size()});
169 }
170
171 bool shouldReset =
172 mmfHelped || (savedPositions - neb.
path[walked]->getPositions()).norm() >
175
176 if (shouldReset) {
177 QUILL_LOG_DEBUG(log, "Resetting optimization history.");
178 }
179
181
182 return {newForce, false, shouldReset};
183}
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
void updateForces(bool ci_active)
std::vector< std::shared_ptr< Matter > > path
double convergenceForce(void)
const neb_options_t & neb_options() const
const optimizer_options_t & optimizer_options() const
static bool walkHelped(double walkedForce, double convForce, int mmfStatus)
void updateThresholdSuccess(double convForce, double newForce)
int runDimer(eonc::NudgedElasticBand &neb, double &alignment)
static double forceMeasure(const AtomMatrix &freeForces, std::string_view metric)
Measure free-atom forces with the band's configured convergence metric.
void updateThresholdBackoff(double alignment)
static bool convergedClimb(double bandForce, double forceTolerance, int mmfStatus)
void resamplePathInPlace(std::span< std::shared_ptr< Matter > > path)
In-place path reparameterization for NEB shared_ptr paths.
quill::Logger * get() noexcept
Get or create the default "combi" logger.
std::string convergence_metric