Loading...
Searching...
No Matches
gpr::neb::AdaptiveSo3SessionPolicy Class Reference

Run-scoped adaptive SO(3) state. More...

#include <gpr/neb/GPNEB.h>

Public Member Functions

 AdaptiveSo3SessionPolicy (bool path_geometry_so3_sensitive, double component_force_tolerance, Eigen::Index degrees_of_freedom, ConvergenceNormType convergence_norm)
void setEvaluationContext (const NEBOracleEvaluationContext &context) noexcept
AdaptiveSo3EvaluationMode evaluationMode () const noexcept
void observeForceComponentRms (double component_rms) noexcept
void observeOptimizationOutcome (const NEBOracleOptimizationOutcome &outcome) noexcept
bool restartRequested () const noexcept
double triggerForceNoise () const noexcept
void beginAveragedSession () noexcept
bool averagedSession () const noexcept

Detailed Description

Run-scoped adaptive SO(3) state.

Force-critical contexts request scatter probes while the session uses the raw oracle. A scatter sample above the requested force resolution is adjudicated against comparable exact-force progress on the same image. Raw progress leases the cheap surface; unresolved scatter requests a clean session restart on one orbit-averaged oracle surface.

Definition at line 181 of file GPNEB.h.

Constructor & Destructor Documentation

◆ AdaptiveSo3SessionPolicy()

gpr::neb::AdaptiveSo3SessionPolicy::AdaptiveSo3SessionPolicy ( bool path_geometry_so3_sensitive,
double component_force_tolerance,
Eigen::Index degrees_of_freedom,
ConvergenceNormType convergence_norm )

Definition at line 198 of file GPNEB.cpp.

202{
203 const bool adjacent_recovery_owns_band =
204 ci_idx > 0 && adjacent_recovery_ci_idx == ci_idx &&
205 (adjacent_recovery_target_idx == ci_idx - 1 ||
206 adjacent_recovery_target_idx == ci_idx + 1);

Member Function Documentation

◆ averagedSession()

bool gpr::neb::AdaptiveSo3SessionPolicy::averagedSession ( ) const
nodiscardnoexcept

Definition at line 328 of file GPNEB.cpp.

◆ beginAveragedSession()

void gpr::neb::AdaptiveSo3SessionPolicy::beginAveragedSession ( )
noexcept

Definition at line 317 of file GPNEB.cpp.

319{
320 if (image_index <= 0 || image_index >= path.numImages() - 1 ||
321 positions.size() != path.image(image_index).positions.size() ||
322 gradient.size() != positions.size() || !positions.allFinite() ||
323 !gradient.allFinite() || !std::isfinite(energy) ||
324 positionsCoincide(positions, path.image(image_index).positions)) {
325 return std::nullopt;
326 }

◆ evaluationMode()

AdaptiveSo3EvaluationMode gpr::neb::AdaptiveSo3SessionPolicy::evaluationMode ( ) const
nodiscardnoexcept

Definition at line 230 of file GPNEB.cpp.

◆ observeForceComponentRms()

void gpr::neb::AdaptiveSo3SessionPolicy::observeForceComponentRms ( double component_rms)
noexcept

Definition at line 236 of file GPNEB.cpp.

237 {
238 return false;
239 }
240
241 std::vector<Eigen::VectorXd> positions;
242 positions.reserve(3);
243 for (int image = lease.image_index - 1; image <= lease.image_index + 1;
244 ++image) {
245 const Eigen::VectorXd& image_positions = path.image(image).positions;
246 if (image_positions.size() == 0 || !image_positions.allFinite()) {
247 const bool changed = active();
248 clear();
249 return changed;
250 }
251 positions.push_back(image_positions);
252 }
253 owner_image_ = lease.image_index;
254 positions_ = std::move(positions);
255 committed_handoff_pending_ = false;
256 release_after_restore_ = false;
257 return true;
258}
259
260bool OieRecoveryStencilAnchor::reanchor(const NEBPath& path,
261 const OieFixedImageLease& lease)

◆ observeOptimizationOutcome()

void gpr::neb::AdaptiveSo3SessionPolicy::observeOptimizationOutcome ( const NEBOracleOptimizationOutcome & outcome)
noexcept

Definition at line 263 of file GPNEB.cpp.

270{
271 if (!active() || positions_.size() != 3 || owner_image_ <= 0 ||
272 owner_image_ >= path.numImages() - 1) {
273 if (release_after_restore_) clear();
274 return false;
275 }
276 for (int image = owner_image_ - 1; image <= owner_image_ + 1; ++image) {
277 const Eigen::VectorXd& anchored =
278 positions_[static_cast<std::size_t>(image - owner_image_ + 1)];
279 if (anchored.size() != path.image(image).positions.size()) {
280 if (release_after_restore_) clear();
281 return false;
282 }
283 }
284 for (int image = owner_image_ - 1; image <= owner_image_ + 1; ++image) {
285 path.image(image).positions =
286 positions_[static_cast<std::size_t>(image - owner_image_ + 1)];
287 if (image > 0 && image < path.numImages() - 1) {
288 path.image(image).evaluated = false;
289 }
290 }
291 if (release_after_restore_) clear();
292 return true;
293}
294
295void OieRecoveryStencilAnchor::applyActiveImageMask(
296 std::vector<char>& active_images, int n_images) const
297{
298 if (!active() || n_images <= 2 || owner_image_ >= n_images - 1) return;
299 if (active_images.empty()) {
300 active_images.assign(static_cast<std::size_t>(n_images), 1);
301 }
302 if (active_images.size() != static_cast<std::size_t>(n_images)) return;
303 for (int image = owner_image_ - 1; image <= owner_image_ + 1; ++image) {
304 if (image > 0 && image < n_images - 1) {
305 active_images[static_cast<std::size_t>(image)] = 0;

◆ restartRequested()

bool gpr::neb::AdaptiveSo3SessionPolicy::restartRequested ( ) const
nodiscardnoexcept

Definition at line 307 of file GPNEB.cpp.

◆ setEvaluationContext()

void gpr::neb::AdaptiveSo3SessionPolicy::setEvaluationContext ( const NEBOracleEvaluationContext & context)
noexcept

Definition at line 208 of file GPNEB.cpp.

208 : local_recovery_lease;
209}
210
211void OieRecoveryStencilAnchor::clear()
212{
213 owner_image_ = -1;
214 positions_.clear();
215 committed_handoff_pending_ = false;
216 release_after_restore_ = false;
217}
218
219bool OieRecoveryStencilAnchor::update(const NEBPath& path,
220 const OieFixedImageLease& lease)
221{
222 const bool valid_lease = lease.model_growth_required &&
223 lease.image_index > 0 &&
224 lease.image_index < path.numImages() - 1;
225 if (!valid_lease) {
226 if (active() &&
227 (committed_handoff_pending_ || release_after_restore_)) {
228 const bool changed = !release_after_restore_;

◆ triggerForceNoise()

double gpr::neb::AdaptiveSo3SessionPolicy::triggerForceNoise ( ) const
nodiscardnoexcept

Definition at line 312 of file GPNEB.cpp.


The documentation for this class was generated from the following files: