eOn 3.2.0
Long-timescale dynamics: aKMC, NEB, parallel replica
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
NEBOcinebController.h
Go to the documentation of this file.
1
/*
2
** This file is part of eOn.
3
**
4
** SPDX-License-Identifier: BSD-3-Clause
5
**
6
** Copyright (c) 2010--present, eOn Development Team
7
** All rights reserved.
8
**
9
** Repo:
10
** https://github.com/TheochemUI/eOn
11
*/
12
#pragma once
13
14
#include "
Eigen.h
"
15
#include "
Parameters.h
"
16
17
namespace
eonc
{
18
class
NudgedElasticBand
;
// forward declaration
19
}
20
21
namespace
eonc::neb
{
22
26
class
OCINEBController
{
27
public
:
28
struct
Config
{
29
bool
use_mmf
;
30
double
trigger_force
;
31
double
trigger_factor
;
32
long
max_steps
;
33
long
ci_stability_count
;
34
double
angle_tol
;
35
double
force_tolerance
;
36
bool
restore_unhelpful
;
37
};
38
39
static
Config
fromParams
(
const
Parameters
¶ms);
40
explicit
OCINEBController
(
const
Config
&cfg);
41
42
void
initBaseline
(
double
baseline_force);
43
44
bool
shouldTrigger
(
double
convForce,
bool
ci_active,
long
climbingImage,
45
long
numImages,
int
ciStabilityCounter)
const
;
46
47
struct
MMFResult
{
48
double
newForce
;
49
bool
convergedAfterMMF
;
50
bool
shouldResetOptimizer
;
51
};
52
53
MMFResult
run
(
eonc::NudgedElasticBand
&
neb
,
double
convForce);
54
55
// Help is the walked image's raw force, not band convergenceForce().
56
// After a downhill dimer step maxEnergyImage can hop; the band CI
57
// force is then a neighbor and is the wrong score for restore.
58
static
bool
walkHelped
(
double
walkedForce,
double
convForce,
int
mmfStatus) {
59
return
walkedForce < convForce && mmfStatus != -2;
60
}
61
62
// Positive curvature (status -2) is a well, not a saddle. A band
63
// force under tolerance after that walk is not convergence; run()
64
// restores the climbing image first.
65
static
bool
convergedClimb
(
double
bandForce,
double
forceTolerance,
66
int
mmfStatus) {
67
return
bandForce < forceTolerance && mmfStatus != -2;
68
}
69
70
void
resetStability
() {
ciStabilityCounter_
= 0; }
71
void
updateStability
(
long
climbingImage);
72
int
stabilityCount
()
const
{
return
ciStabilityCounter_
; }
73
double
threshold
()
const
{
return
current_threshold_
; }
74
75
private
:
76
Config
cfg_
;
77
double
current_threshold_
{-1.0};
78
double
baseline_force_
{-1.0};
79
long
previousClimbingImage_
{-1};
80
int
ciStabilityCounter_
{0};
81
int
mmf_iterations_used_
{0};
82
83
// Warm-start: cache converged eigenvector for next dimer call
84
bool
has_cached_mode_
{
false
};
85
AtomMatrix
cached_mode_
;
86
87
int
runDimer
(
eonc::NudgedElasticBand
&
neb
,
double
&alignment);
88
void
updateThresholdSuccess
(
double
convForce,
double
newForce);
89
void
updateThresholdBackoff
(
double
alignment);
90
};
91
92
}
// namespace eonc::neb
Eigen.h
AtomMatrix
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
Definition
Eigen.h:37
Parameters.h
eonc::NudgedElasticBand
Definition
NudgedElasticBand.h:38
eonc::Parameters
Definition
Parameters.h:35
eonc::neb::OCINEBController::baseline_force_
double baseline_force_
Definition
NEBOcinebController.h:78
eonc::neb::OCINEBController::walkHelped
static bool walkHelped(double walkedForce, double convForce, int mmfStatus)
Definition
NEBOcinebController.h:58
eonc::neb::OCINEBController::shouldTrigger
bool shouldTrigger(double convForce, bool ci_active, long climbingImage, long numImages, int ciStabilityCounter) const
Definition
NEBOcinebController.cpp:47
eonc::neb::OCINEBController::fromParams
static Config fromParams(const Parameters ¶ms)
Definition
NEBOcinebController.cpp:23
eonc::neb::OCINEBController::OCINEBController
OCINEBController(const Config &cfg)
Definition
NEBOcinebController.cpp:38
eonc::neb::OCINEBController::resetStability
void resetStability()
Definition
NEBOcinebController.h:70
eonc::neb::OCINEBController::has_cached_mode_
bool has_cached_mode_
Definition
NEBOcinebController.h:84
eonc::neb::OCINEBController::updateThresholdSuccess
void updateThresholdSuccess(double convForce, double newForce)
Definition
NEBOcinebController.cpp:245
eonc::neb::OCINEBController::updateStability
void updateStability(long climbingImage)
Definition
NEBOcinebController.cpp:61
eonc::neb::OCINEBController::mmf_iterations_used_
int mmf_iterations_used_
Definition
NEBOcinebController.h:81
eonc::neb::OCINEBController::previousClimbingImage_
long previousClimbingImage_
Definition
NEBOcinebController.h:79
eonc::neb::OCINEBController::cached_mode_
AtomMatrix cached_mode_
Definition
NEBOcinebController.h:85
eonc::neb::OCINEBController::run
MMFResult run(eonc::NudgedElasticBand &neb, double convForce)
Definition
NEBOcinebController.cpp:71
eonc::neb::OCINEBController::ciStabilityCounter_
int ciStabilityCounter_
Definition
NEBOcinebController.h:80
eonc::neb::OCINEBController::threshold
double threshold() const
Definition
NEBOcinebController.h:73
eonc::neb::OCINEBController::runDimer
int runDimer(eonc::NudgedElasticBand &neb, double &alignment)
Definition
NEBOcinebController.cpp:157
eonc::neb::OCINEBController::initBaseline
void initBaseline(double baseline_force)
Definition
NEBOcinebController.cpp:41
eonc::neb::OCINEBController::current_threshold_
double current_threshold_
Definition
NEBOcinebController.h:77
eonc::neb::OCINEBController::stabilityCount
int stabilityCount() const
Definition
NEBOcinebController.h:72
eonc::neb::OCINEBController::updateThresholdBackoff
void updateThresholdBackoff(double alignment)
Definition
NEBOcinebController.cpp:253
eonc::neb::OCINEBController::convergedClimb
static bool convergedClimb(double bandForce, double forceTolerance, int mmfStatus)
Definition
NEBOcinebController.h:65
eonc::neb::OCINEBController::cfg_
Config cfg_
Definition
NEBOcinebController.h:76
eonc::neb
Definition
NEBForceProjection.cpp:18
eonc
RAII resource manager for the ARTn C library with global synchronization.
Definition
ARTnSaddleSearch.cpp:23
eonc::neb::OCINEBController::Config
Definition
NEBOcinebController.h:28
eonc::neb::OCINEBController::Config::angle_tol
double angle_tol
Definition
NEBOcinebController.h:34
eonc::neb::OCINEBController::Config::restore_unhelpful
bool restore_unhelpful
Definition
NEBOcinebController.h:36
eonc::neb::OCINEBController::Config::force_tolerance
double force_tolerance
Definition
NEBOcinebController.h:35
eonc::neb::OCINEBController::Config::max_steps
long max_steps
Definition
NEBOcinebController.h:32
eonc::neb::OCINEBController::Config::trigger_force
double trigger_force
Definition
NEBOcinebController.h:30
eonc::neb::OCINEBController::Config::ci_stability_count
long ci_stability_count
Definition
NEBOcinebController.h:33
eonc::neb::OCINEBController::Config::use_mmf
bool use_mmf
Definition
NEBOcinebController.h:29
eonc::neb::OCINEBController::Config::trigger_factor
double trigger_factor
Definition
NEBOcinebController.h:31
eonc::neb::OCINEBController::MMFResult
Definition
NEBOcinebController.h:47
eonc::neb::OCINEBController::MMFResult::shouldResetOptimizer
bool shouldResetOptimizer
Definition
NEBOcinebController.h:50
eonc::neb::OCINEBController::MMFResult::newForce
double newForce
Definition
NEBOcinebController.h:48
eonc::neb::OCINEBController::MMFResult::convergedAfterMMF
bool convergedAfterMMF
Definition
NEBOcinebController.h:49
include
eon
NEBOcinebController.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf