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

#include <gpr/neb/RgMinMode.h>

Public Types

enum class  Kind { Dimer = 0 , Lanczos = 1 }

Public Member Functions

 RgMinMode ()=default
 ~RgMinMode ()
 RgMinMode (const RgMinMode &)=delete
RgMinMode & operator= (const RgMinMode &)=delete
bool bind (RgsaddleClient &client, int64_t n_atoms, const double *position, const double *mode, double force_tol, Kind kind=Kind::Dimer, int32_t force_gate=2, int32_t max_rotations=16, double rotation_tol=1e-3)
bool step (rgsaddle_surface_fn surface, void *user, rgsaddle_report_t &report)
bool position (double *out)
int64_t nAtoms () const noexcept

Static Public Member Functions

static Kind indexTestKind (const char *name)
 gprn --index-test token. Unrecognised names are Lanczos.

Static Public Attributes

static constexpr Kind kOciBurstKind = Kind::Dimer

Detailed Description

RgMinMode (dimer / Lanczos) on a host surface (ActiveGP via activeGpRgsaddleSurface). Opt-in lowest-mode invert step.

Definition at line 17 of file RgMinMode.h.

Member Enumeration Documentation

◆ Kind

enum class gpr::neb::RgMinMode::Kind
strong
Enumerator
Dimer 
Lanczos 

Definition at line 19 of file RgMinMode.h.

19{ Dimer = 0, Lanczos = 1 };

Constructor & Destructor Documentation

◆ RgMinMode() [1/2]

gpr::neb::RgMinMode::RgMinMode ( )
default

◆ ~RgMinMode()

gpr::neb::RgMinMode::~RgMinMode ( )
inline

Definition at line 37 of file RgMinMode.h.

38 {
39 release();
40 }

◆ RgMinMode() [2/2]

gpr::neb::RgMinMode::RgMinMode ( const RgMinMode & )
delete

Member Function Documentation

◆ bind()

bool gpr::neb::RgMinMode::bind ( RgsaddleClient & client,
int64_t n_atoms,
const double * position,
const double * mode,
double force_tol,
Kind kind = Kind::Dimer,
int32_t force_gate = 2,
int32_t max_rotations = 16,
double rotation_tol = 1e-3 )
inline

Definition at line 44 of file RgMinMode.h.

48 {
49 if (!client.hasMinMode() || n_atoms < 1 || position == nullptr ||
50 mode == nullptr) {
51 return false;
52 }
53 release();
54 if (force_gate < RGSADDLE_FORCE_L2 ||
55 force_gate > RGSADDLE_FORCE_MAX_ATOM) {
56 return false;
57 }
58 rgsaddle_minmode_config_t cfg{};
59 cfg.version.major = RGSADDLE_ABI_MAJOR;
60 cfg.version.minor = 0;
61 cfg.kind = kind == Kind::Lanczos ? 1 : 0;
62 cfg.method = 0;
63 cfg.dr = 0.01;
64 cfg.rotation_tol = rotation_tol;
65 cfg.max_rotations = max_rotations;
66 cfg.krylov_dim = 8;
67 cfg.force_tol = force_tol > 0.0 ? force_tol : 1e-3;
68 cfg.max_move = 0.1;
69 sess_ = client.minModeCreate(&cfg, n_atoms, position, mode);
70 if (sess_ == nullptr) return false;
71 if (client.minModeSetForceGate(
72 sess_, static_cast<rgsaddle_force_gate_t>(force_gate)) !=
73 RGSADDLE_OK) {
74 client.minModeFree(sess_);
75 sess_ = nullptr;
76 return false;
77 }
78 client_ = &client;
79 n_atoms_ = n_atoms;
80 return true;
81 }
bool position(double *out)
Definition RgMinMode.h:91

◆ indexTestKind()

Kind gpr::neb::RgMinMode::indexTestKind ( const char * name)
inlinestatic

gprn --index-test token. Unrecognised names are Lanczos.

Definition at line 26 of file RgMinMode.h.

27 {
28 if (name != nullptr && name[0] == 'd' && name[1] == 'i' &&
29 name[2] == 'm' && name[3] == 'e' && name[4] == 'r' &&
30 name[5] == '\0') {
31 return Kind::Dimer;
32 }
33 return Kind::Lanczos;
34 }

◆ nAtoms()

int64_t gpr::neb::RgMinMode::nAtoms ( ) const
inlinenodiscardnoexcept

Definition at line 98 of file RgMinMode.h.

99 {
100 return n_atoms_;
101 }

◆ operator=()

RgMinMode & gpr::neb::RgMinMode::operator= ( const RgMinMode & )
delete

◆ position()

bool gpr::neb::RgMinMode::position ( double * out)
inline

Definition at line 91 of file RgMinMode.h.

92 {
93 if (client_ == nullptr || sess_ == nullptr || out == nullptr)
94 return false;
95 return client_->minModePosition(sess_, out) == 0;
96 }
eon_relax_band_t eon_relax_surface_fn void eon_relax_outcome_t * out

◆ step()

bool gpr::neb::RgMinMode::step ( rgsaddle_surface_fn surface,
void * user,
rgsaddle_report_t & report )
inline

Definition at line 83 of file RgMinMode.h.

85 {
86 if (client_ == nullptr || sess_ == nullptr || surface == nullptr)
87 return false;
88 return client_->minModeStep(sess_, surface, user, &report) == 0;
89 }
eon_relax_band_t eon_relax_surface_fn surface
eon_relax_band_t eon_relax_surface_fn void * user

Member Data Documentation

◆ kOciBurstKind

Kind gpr::neb::RgMinMode::kOciBurstKind = Kind::Dimer
staticconstexpr

OCINEB climbing-image burst. The burst is a dimer by contract; the gprn index test is a different seat and may use Lanczos.

Definition at line 23 of file RgMinMode.h.


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