#include "eon/relax/eon_relax_engine.h"#include "eon/Eigen.h"#include "eon/Matter.h"#include "eon/MinModeSaddleSearch.h"#include "eon/NudgedElasticBand.h"#include "eon/Optimizer.h"#include "eon/Parameters.h"#include "eon_relax_engine.capnp.h"#include "relax/HostSurfacePotential.h"#include "version.h"#include <capnp/serialize.h>#include <kj/array.h>#include <kj/common.h>#include <algorithm>#include <cmath>#include <cstdio>#include <cstring>#include <memory>#include <new>#include <stdexcept>#include <string>#include <vector>Go to the source code of this file.
Classes | |
| struct | EonRelaxEngine |
| class | Matter |
| class | MinModeSaddleSearch |
| class | NEBObjectiveFunction |
| class | NudgedElasticBand |
| class | Optimizer |
| Abstract base of the structure optimizers. More... | |
| class | Parameters |
| struct | ParametersLoadAccess |
| Write hole for INI/JSON loaders and nanobind property setters. More... | |
Functions | |
| uint64_t | eon_relax_version_hash (void) |
| 64-bit FNV-1a hash of eon_relax_version_hash_str(). | |
| static int | stamp_rc (EonRelaxEngine *eng, int rc) |
| static int | fail_out (EonRelaxEngine *eng, eon_relax_outcome_t *out, int rc, eon_relax_kind_t kind, uint64_t epoch) |
| static void | clear_stepper (EonRelaxEngine *eng) |
| int | eon_relax_abi_version (void) |
| (major << 16) | minor. | |
| int | eon_relax_available (void) |
| int | eon_relax_abi_stamp (eon_relax_version_t *out) |
| const char * | eon_relax_version_hash_str (void) |
| Immortal dest identity string. | |
| EonRelaxEngine * | eon_relax_create (const void *config, size_t config_len, char *errbuf, size_t errlen) |
| Create. | |
| int | eon_relax_set_surface_epoch (EonRelaxEngine *eng, uint64_t epoch) |
| int | eon_relax_last_error (const EonRelaxEngine *eng) |
| Last named create/run/step/reset/set_epoch rc on this handle. | |
| int | eon_relax_run (EonRelaxEngine *eng, eon_relax_band_t *band, eon_relax_surface_fn surface, void *user, eon_relax_outcome_t *out) |
| Run the bound engine to completion. | |
| int | eon_relax_step (EonRelaxEngine *eng, eon_relax_band_t *band, eon_relax_surface_fn surface, void *user, eon_relax_outcome_t *out) |
| One band optimizer step (kind=NEB only). | |
| int | eon_relax_reset (EonRelaxEngine *eng) |
| Drop the stepper's band state and optimizer history; the next eon_relax_step reinitializes from the caller's band. | |
| void | eon_relax_destroy (EonRelaxEngine *eng) |
| const char * | eon_relax_status_name (eon_relax_kind_t kind, int status) |
| NULL if kind or status is unknown. | |
|
static |
Definition at line 243 of file RelaxEngineAbi.cpp.
| int eon_relax_abi_stamp | ( | eon_relax_version_t * | out | ) |
Definition at line 262 of file RelaxEngineAbi.cpp.
| int eon_relax_abi_version | ( | void | ) |
(major << 16) | minor.
Definition at line 256 of file RelaxEngineAbi.cpp.
| int eon_relax_available | ( | void | ) |
Definition at line 260 of file RelaxEngineAbi.cpp.
| EonRelaxEngine * eon_relax_create | ( | const void * | config, |
| size_t | config_len, | ||
| char * | errbuf, | ||
| size_t | errlen ) |
Create.
NULL config && config_len==0 selects Parameters NSDMI defaults and kind=NEB. A non-empty buffer is a Cap'n Proto flat-array whose root is RelaxEngineParams. kind tokens are "neb" and "saddle"; any other token fails closed (EON_RELAX_UNKNOWN_KIND). An unparseable buffer is EON_RELAX_CAPNP_ROOT. config!=NULL && config_len==0 is refused.
Definition at line 282 of file RelaxEngineAbi.cpp.
| void eon_relax_destroy | ( | EonRelaxEngine * | eng | ) |
Definition at line 637 of file RelaxEngineAbi.cpp.
| int eon_relax_last_error | ( | const EonRelaxEngine * | eng | ) |
Last named create/run/step/reset/set_epoch rc on this handle.
0 if none.
Definition at line 331 of file RelaxEngineAbi.cpp.
| int eon_relax_reset | ( | EonRelaxEngine * | eng | ) |
Drop the stepper's band state and optimizer history; the next eon_relax_step reinitializes from the caller's band.
This is the host's model-update hook: quasi-Newton memory taken on one surface epoch must not survive onto the next.
Definition at line 625 of file RelaxEngineAbi.cpp.
| int eon_relax_run | ( | EonRelaxEngine * | eng, |
| eon_relax_band_t * | band, | ||
| eon_relax_surface_fn | surface, | ||
| void * | user, | ||
| eon_relax_outcome_t * | out ) |
Run the bound engine to completion.
Writes updated interior coordinates into band->positions (caller-owned); endpoints stay in the caller frame. Endpoint minimization stays with the host (NudgedElasticBand::compute does not minimize endpoints). surface may not be NULL. Kind is bound at create (NULL config => NEB). Returns eon_relax_rc_t; on 0, out->status is the dest NEB or saddle table.
Definition at line 338 of file RelaxEngineAbi.cpp.
| int eon_relax_set_surface_epoch | ( | EonRelaxEngine * | eng, |
| uint64_t | epoch ) |
Definition at line 316 of file RelaxEngineAbi.cpp.
| const char * eon_relax_status_name | ( | eon_relax_kind_t | kind, |
| int | status ) |
NULL if kind or status is unknown.
Definition at line 641 of file RelaxEngineAbi.cpp.
| int eon_relax_step | ( | EonRelaxEngine * | eng, |
| eon_relax_band_t * | band, | ||
| eon_relax_surface_fn | surface, | ||
| void * | user, | ||
| eon_relax_outcome_t * | out ) |
One band optimizer step (kind=NEB only).
The first call on a fresh or reset engine initializes the band state from the caller's positions and captures the baseline force; every call syncs band->positions in (the host may have moved images between steps), assembles NEB forces on the host surface, takes ONE optimizer step, and writes the stepped INTERIOR positions back (endpoints are the caller's and are never rewritten, so the caller's frame survives eOn's own cell wrapping). Climbing-image activation follows the engine's own trigger rule; saddle POLICY (MMF bursts, resampling, acquisition) stays with the host. outcome.status is RUNNING until convergenceForce() reaches the configured tolerance (GOOD), host variance exceeds the GP-surrogate threshold (MAX_UNCERTAINTY), or neb.max_iterations is hit (BAD_MAX_ITERATIONS). surface and user must not change across steps without an eon_relax_reset.
Definition at line 460 of file RelaxEngineAbi.cpp.
| uint64_t eon_relax_version_hash | ( | void | ) |
64-bit FNV-1a hash of eon_relax_version_hash_str().
Copied to outcome.version_hash.
Definition at line 278 of file RelaxEngineAbi.cpp.
| const char * eon_relax_version_hash_str | ( | void | ) |
Immortal dest identity string.
Never NULL.
Definition at line 271 of file RelaxEngineAbi.cpp.
|
static |
Definition at line 234 of file RelaxEngineAbi.cpp.
|
static |
Definition at line 227 of file RelaxEngineAbi.cpp.