Tier-2 C ABI: eOn as a dlopen relaxation engine. More...
#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Classes | |
| struct | eon_relax_version_t |
| struct | eon_relax_band_t |
| struct | eon_relax_outcome_t |
| struct | eon_relax_surface_request_t |
Macros | |
| #define | EON_RELAX_API __attribute__((visibility("default"))) |
| #define | EON_RELAX_ABI_MAJOR 2u |
| #define | EON_RELAX_ABI_MINOR 1u |
| #define | EON_RELAX_VERSION_INIT |
| #define | EON_RELAX_KIND_IS_KNOWN(k) |
| #define | EON_RELAX_IMAGE_NONE INT64_C(-1) |
Typedefs | |
| typedef struct EonRelaxEngine | EonRelaxEngine |
| typedef int(* | eon_relax_surface_fn) (void *user, eon_relax_surface_request_t *req) |
Enumerations | |
| enum | eon_relax_kind_t { EON_RELAX_KIND_INVALID = 0 , EON_RELAX_KIND_NEB = 1 , EON_RELAX_KIND_SADDLE = 2 } |
| enum | eon_relax_rc_t { EON_RELAX_OK = 0 , EON_RELAX_NULL_ENGINE = -1 , EON_RELAX_NULL_BAND = -2 , EON_RELAX_NULL_SURFACE = -3 , EON_RELAX_NULL_OUTCOME = -4 , EON_RELAX_NULL_POSITIONS = -5 , EON_RELAX_NULL_ATOMIC_NRS = -6 , EON_RELAX_NULL_BOXES = -7 , EON_RELAX_NULL_MODE = -8 , EON_RELAX_BAND_TOO_SHORT = -9 , EON_RELAX_NATOMS = -10 , EON_RELAX_UNKNOWN_KIND = -11 , EON_RELAX_UNKNOWN_STATUS = -12 , EON_RELAX_CAPNP_ROOT = -13 , EON_RELAX_SURFACE_FATAL = -15 , EON_RELAX_SADDLE_NIMAGES = -17 , EON_RELAX_BAND_SIZE = -18 , EON_RELAX_ALLOC = -19 , EON_RELAX_UNAVAILABLE = -21 , EON_RELAX_INVALID_PARAMETER = -22 , EON_RELAX_ABI_MISMATCH = -23 } |
| enum | eon_relax_neb_status_t { EON_RELAX_NEB_GOOD = 0 , EON_RELAX_NEB_INIT = 1 , EON_RELAX_NEB_BAD_MAX_ITERATIONS = 2 , EON_RELAX_NEB_RUNNING = 3 , EON_RELAX_NEB_MAX_UNCERTAINTY = 4 } |
Functions | |
| __attribute__ ((visibility("default"))) int eon_relax_abi_version(void) | |
Variables | |
| size_t | config_len |
| size_t char * | errbuf |
| size_t char size_t | errlen |
| uint64_t | epoch |
| eon_relax_band_t * | band |
| eon_relax_band_t eon_relax_surface_fn | surface |
| eon_relax_band_t eon_relax_surface_fn void * | user |
| eon_relax_band_t eon_relax_surface_fn void eon_relax_outcome_t * | out |
| int | status |
Tier-2 C ABI: eOn as a dlopen relaxation engine.
Reverse of include/eon/potentials/Rgpot/engine_c_abi.h: the host supplies the surface (energy/forces/variance for a band), eOn owns NudgedElasticBand / MinModeSaddleSearch. Configuration is a Cap'n Proto flat-array whose root is RelaxEngineParams in schema/eon_params.capnp (NebParams / SaddleParams arms). NULL config selects Parameters NSDMI defaults and kind=NEB.
Units: positions Angstrom, energy eV, forces eV/Angstrom.
Plugin Matters use the Matter default (PBC on for a non-isolated pot). fill and endpoint dirty write positions with PBC off so the caller frame is kept (a 10 A box must not map x=-0.3 to 9.7).
Layout discipline (dlpack.h is the model):
Definition in file eon_relax_engine.h.
| #define EON_RELAX_ABI_MAJOR 2u |
Definition at line 70 of file eon_relax_engine.h.
| #define EON_RELAX_ABI_MINOR 1u |
Definition at line 71 of file eon_relax_engine.h.
| #define EON_RELAX_API __attribute__((visibility("default"))) |
Definition at line 65 of file eon_relax_engine.h.
| #define EON_RELAX_IMAGE_NONE INT64_C(-1) |
Definition at line 129 of file eon_relax_engine.h.
| #define EON_RELAX_KIND_IS_KNOWN | ( | k | ) |
Definition at line 90 of file eon_relax_engine.h.
| #define EON_RELAX_VERSION_INIT |
Definition at line 79 of file eon_relax_engine.h.
| typedef int(* eon_relax_surface_fn) (void *user, eon_relax_surface_request_t *req) |
Return 0 on success, positive recoverable, negative fatal.
Definition at line 199 of file eon_relax_engine.h.
| typedef struct EonRelaxEngine EonRelaxEngine |
Definition at line 68 of file eon_relax_engine.h.
| enum eon_relax_kind_t |
| Enumerator | |
|---|---|
| EON_RELAX_KIND_INVALID | |
| EON_RELAX_KIND_NEB | |
| EON_RELAX_KIND_SADDLE | |
Definition at line 84 of file eon_relax_engine.h.
NudgedElasticBand::NEBStatus integers. Written to outcome.status for NEB.
| Enumerator | |
|---|---|
| EON_RELAX_NEB_GOOD | |
| EON_RELAX_NEB_INIT | |
| EON_RELAX_NEB_BAD_MAX_ITERATIONS | |
| EON_RELAX_NEB_RUNNING | |
| EON_RELAX_NEB_MAX_UNCERTAINTY | |
Definition at line 121 of file eon_relax_engine.h.
| enum eon_relax_rc_t |
Call rc: 0 success (read outcome), positive recoverable, negative a named fail. SURFACE_FATAL makes the instance unusable. Every other named fail leaves the handle reusable.
Definition at line 96 of file eon_relax_engine.h.
| __attribute__ | ( | (visibility("default")) | ) |
(major << 16) | minor.
Immortal dest identity string. Never NULL.
FNV-1a 64-bit hash of eon_relax_version_hash_str(). Copied to outcome.version_hash.
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.
Last named create/run/step/reset/set_epoch rc on this handle. 0 if none.
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 eOn NEB or saddle table.
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.
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.
NULL if kind or status is unknown.
| eon_relax_band_t * band |
Definition at line 238 of file eon_relax_engine.h.
| size_t config_len |
Definition at line 221 of file eon_relax_engine.h.
| uint64_t epoch |
Definition at line 225 of file eon_relax_engine.h.
| size_t char* errbuf |
Definition at line 221 of file eon_relax_engine.h.
| size_t char size_t errlen |
Definition at line 222 of file eon_relax_engine.h.
Definition at line 240 of file eon_relax_engine.h.
| int status |
Definition at line 275 of file eon_relax_engine.h.
| eon_relax_band_t eon_relax_surface_fn surface |
Definition at line 239 of file eon_relax_engine.h.
| eon_relax_band_t eon_relax_surface_fn void * user |
Definition at line 239 of file eon_relax_engine.h.