Enumerations | |
| enum | gpr_neb_status_t { GPR_NEB_NOT_CONVERGED = 0 , GPR_NEB_FORCE_TOLERANCE = 1 , GPR_NEB_MODEL_NOISE_FLOOR = 2 } |
| How a NEB result converged (ABI 1.1). More... | |
Functions | |
| gpr_neb_t | gpr_neb_search (gpr_oracle_fn oracle, void *user_data, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_neb_config_t *config) |
| NEB path optimization. GPR_NEB_STANDARD, GPR_NEB_AIE and GPR_NEB_OIE run without a surrogate. GPR_NEB_GP_OIE and GPR_NEB_GP_AIE, including the value from gpr_neb_config_defaults, run when n_coords is a multiple of 3: the call builds all-moving atoms with gpr_atoms_create_simple and continues in gpr_neb_search_gp, using the gprn NEB model. A GP mode whose n_coords is not a multiple of 3 returns NULL with GPR_ERR_INVALID_ARG (kGpModeWithoutGp). That is the only GP-mode rejection. GPR_NEB_GP_LOCAL returns NULL with GPR_ERR_INVALID_ARG (kLocalModeEntry) at any length. gpr_neb_search_gp is the entry that takes an atoms handle and a model config. | |
| gpr_neb_t | gpr_neb_search_local (gpr_oracle_fn oracle, void *user_data, gpr_atoms_t atoms, const double *box, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_neb_config_t *config, const gpr_local_band_config_t *local) |
| Local band (ABI 1.6). The result is the same opaque handle as the other NEB entries; destroy it with gpr_neb_result_destroy. A failure returns NULL and leaves the reason in gpr_last_error_message(). | |
| gpr_neb_t | gpr_neb_search_local_potential (gpr_potential_t pot, const int *atomic_nrs, const double *box, gpr_atoms_t atoms, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_neb_config_t *config, const gpr_local_band_config_t *local) |
| gpr_neb_search_local over a PotentialWrapper (ABI 1.6). With atoms NULL, atomic_nrs has length n_coords/3 and names the moving atoms. With atoms set, the descriptor's atomic numbers are used and atomic_nrs may be NULL. | |
| gpr_neb_t | gpr_neb_search_periodic (gpr_oracle_fn oracle, void *user_data, gpr_atoms_t atoms, const double *box, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_periodic_band_config_t *periodic, const gpr_local_band_config_t *local) |
| Periodic local band (ABI 1.7), the C binding of GPLocalBand. | |
| gpr_neb_t | gpr_neb_search_periodic_potential (gpr_potential_t pot, const int *atomic_nrs, const double *box, gpr_atoms_t atoms, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_periodic_band_config_t *periodic, const gpr_local_band_config_t *local) |
| gpr_neb_search_periodic over a PotentialWrapper (ABI 1.7). | |
| gpr_neb_t | gpr_neb_search_potential (gpr_potential_t pot, const int *atomic_nrs, const double *box, const double *R_initial, const double *R_final, int n_coords, int n_images, const gpr_neb_config_t *config) |
| gpr_neb_search over a PotentialWrapper. n_coords must be a positive multiple of 3, and atomic_nrs, box, both endpoints and config must be non-NULL. A GP mode then builds atoms from atomic_nrs (gpr_atoms_simple with those numbers, every atom moving) with one atom type per element in order of first appearance, as the gprn NEB reader types a frame, and continues in gpr_neb_search_gp_potential; being a GP mode is not an error. A length that is not a multiple of 3 fails that check for every mode, including GPR_NEB_GP_LOCAL. A local mode that passes the length check returns NULL with GPR_ERR_INVALID_ARG (kLocalModeEntry). A NULL potential is GPR_ERR_INVALID_ARG; a potential that is not live is GPR_ERR_NULL_HANDLE. | |
| int | gpr_neb_result_converged (gpr_neb_t result) |
| 1 if converged, 0 otherwise. | |
| int | gpr_neb_result_convergence_status (gpr_neb_t result) |
| gpr_neb_status_t of the result; GPR_NEB_NOT_CONVERGED for NULL. | |
| int | gpr_neb_result_oracle_calls (gpr_neb_t result) |
| Total oracle evaluations. | |
| int | gpr_neb_result_outer_iterations (gpr_neb_t result) |
| Number of outer iterations performed. | |
| double | gpr_neb_result_barrier (gpr_neb_t result) |
| Forward barrier (reported saddle image energy minus reactant energy). | |
| int | gpr_neb_result_max_energy_image (gpr_neb_t result) |
| Index of highest-energy image. | |
| int | gpr_neb_result_n_images (gpr_neb_t result) |
| Total number of images (including endpoints = n_images + 2). | |
| int | gpr_neb_result_image_positions (gpr_neb_t result, int image_idx, double *out, int n_coords) |
| Get positions for image i (0-based). n_coords must equal the full image length, frozen atoms included. Any other count is GPR_ERR_INVALID_ARG and out is not written. | |
| int | gpr_neb_result_image_energy (gpr_neb_t result, int image_idx, double *out) |
| Get energy for image i. | |
| int | gpr_neb_result_all_energies (gpr_neb_t result, double *out, int n_total) |
| Get all image energies into an array of size n_images_total. n_total must equal gpr_neb_result_n_images(). Any other count is GPR_ERR_INVALID_ARG and out is not written. | |
| void | gpr_neb_result_destroy (gpr_neb_t result) |
| Destroy NEB result. Destroying NULL or a live handle clears gpr_last_status() and gpr_last_error(), while preserving a pending GPR_ERR_ORACLE during cleanup. A second call reports GPR_ERR_INVALID_ARG through gpr_last_status() and does not free the handle again. | |
| enum gpr_neb_status_t |
How a NEB result converged (ABI 1.1).
| Enumerator | |
|---|---|
| GPR_NEB_NOT_CONVERGED | |
| GPR_NEB_FORCE_TOLERANCE | Climbing-image force below conv_tol |
| GPR_NEB_MODEL_NOISE_FLOOR | Force at the resolution of the model |
Definition at line 3805 of file gpridge_c.h.
| int gpr_neb_result_all_energies | ( | gpr_neb_t | result, |
| double * | out, | ||
| int | n_total ) |
Get all image energies into an array of size n_images_total. n_total must equal gpr_neb_result_n_images(). Any other count is GPR_ERR_INVALID_ARG and out is not written.
| double gpr_neb_result_barrier | ( | gpr_neb_t | result | ) |
Forward barrier (reported saddle image energy minus reactant energy).
| int gpr_neb_result_converged | ( | gpr_neb_t | result | ) |
1 if converged, 0 otherwise.
| int gpr_neb_result_convergence_status | ( | gpr_neb_t | result | ) |
gpr_neb_status_t of the result; GPR_NEB_NOT_CONVERGED for NULL.
| void gpr_neb_result_destroy | ( | gpr_neb_t | result | ) |
Destroy NEB result. Destroying NULL or a live handle clears gpr_last_status() and gpr_last_error(), while preserving a pending GPR_ERR_ORACLE during cleanup. A second call reports GPR_ERR_INVALID_ARG through gpr_last_status() and does not free the handle again.
| int gpr_neb_result_image_energy | ( | gpr_neb_t | result, |
| int | image_idx, | ||
| double * | out ) |
Get energy for image i.
| int gpr_neb_result_image_positions | ( | gpr_neb_t | result, |
| int | image_idx, | ||
| double * | out, | ||
| int | n_coords ) |
Get positions for image i (0-based). n_coords must equal the full image length, frozen atoms included. Any other count is GPR_ERR_INVALID_ARG and out is not written.
| int gpr_neb_result_max_energy_image | ( | gpr_neb_t | result | ) |
Index of highest-energy image.
| int gpr_neb_result_n_images | ( | gpr_neb_t | result | ) |
Total number of images (including endpoints = n_images + 2).
| int gpr_neb_result_oracle_calls | ( | gpr_neb_t | result | ) |
Total oracle evaluations.
| int gpr_neb_result_outer_iterations | ( | gpr_neb_t | result | ) |
Number of outer iterations performed.
| gpr_neb_t gpr_neb_search | ( | gpr_oracle_fn | oracle, |
| void * | user_data, | ||
| const double * | R_initial, | ||
| const double * | R_final, | ||
| int | n_coords, | ||
| int | n_images, | ||
| const gpr_neb_config_t * | config ) |
NEB path optimization. GPR_NEB_STANDARD, GPR_NEB_AIE and GPR_NEB_OIE run without a surrogate. GPR_NEB_GP_OIE and GPR_NEB_GP_AIE, including the value from gpr_neb_config_defaults, run when n_coords is a multiple of 3: the call builds all-moving atoms with gpr_atoms_create_simple and continues in gpr_neb_search_gp, using the gprn NEB model. A GP mode whose n_coords is not a multiple of 3 returns NULL with GPR_ERR_INVALID_ARG (kGpModeWithoutGp). That is the only GP-mode rejection. GPR_NEB_GP_LOCAL returns NULL with GPR_ERR_INVALID_ARG (kLocalModeEntry) at any length. gpr_neb_search_gp is the entry that takes an atoms handle and a model config.
Returns a result handle (NULL on failure). Caller must destroy with gpr_neb_result_destroy().
| oracle | Energy/gradient callback (simple signature) |
| user_data | Opaque pointer passed to oracle |
| R_initial | Initial state positions (n_coords) |
| R_final | Final state positions (n_coords) |
| n_coords | Coordinate dimension |
| n_images | Number of intermediate images (excluding endpoints) |
| config | NEB configuration |
| gpr_neb_t gpr_neb_search_local | ( | gpr_oracle_fn | oracle, |
| void * | user_data, | ||
| gpr_atoms_t | atoms, | ||
| const double * | box, | ||
| const double * | R_initial, | ||
| const double * | R_final, | ||
| int | n_coords, | ||
| int | n_images, | ||
| const gpr_neb_config_t * | config, | ||
| const gpr_local_band_config_t * | local ) |
Local band (ABI 1.6). The result is the same opaque handle as the other NEB entries; destroy it with gpr_neb_result_destroy. A failure returns NULL and leaves the reason in gpr_last_error_message().
atoms NULL means every coordinate moves and n_coords is 3 times the atom count. A non-NULL atoms handle is the gpr_neb_search_gp layout: R_initial and R_final hold every atom, frozen atoms stay at R_initial, and the band moves the others. box is 9 doubles, row-major, or NULL for an isolated system. config NULL selects gpr_neb_config_defaults(); local NULL selects gpr_local_band_config_defaults(). The mode is GPR_NEB_GP_LOCAL either way.
| gpr_neb_t gpr_neb_search_local_potential | ( | gpr_potential_t | pot, |
| const int * | atomic_nrs, | ||
| const double * | box, | ||
| gpr_atoms_t | atoms, | ||
| const double * | R_initial, | ||
| const double * | R_final, | ||
| int | n_coords, | ||
| int | n_images, | ||
| const gpr_neb_config_t * | config, | ||
| const gpr_local_band_config_t * | local ) |
gpr_neb_search_local over a PotentialWrapper (ABI 1.6). With atoms NULL, atomic_nrs has length n_coords/3 and names the moving atoms. With atoms set, the descriptor's atomic numbers are used and atomic_nrs may be NULL.
| gpr_neb_t gpr_neb_search_periodic | ( | gpr_oracle_fn | oracle, |
| void * | user_data, | ||
| gpr_atoms_t | atoms, | ||
| const double * | box, | ||
| const double * | R_initial, | ||
| const double * | R_final, | ||
| int | n_coords, | ||
| int | n_images, | ||
| const gpr_periodic_band_config_t * | periodic, | ||
| const gpr_local_band_config_t * | local ) |
Periodic local band (ABI 1.7), the C binding of GPLocalBand.
Same arguments and the same opaque result as gpr_neb_search_local. periodic NULL selects gpr_periodic_band_config_defaults() (uniform springs, a linear path, the whole band under fmax, max_move 0.2). local NULL selects gpr_local_band_config_defaults(). A non-NULL box is the periodic cell, 9 doubles, rows a, b, c; NULL is isolated. atoms NULL means every coordinate moves. The search does not certify; gpr_neb_request_index_certificate, called before it, does, and the report's certified, index and n_certificate_calls record the outcome.
| gpr_neb_t gpr_neb_search_periodic_potential | ( | gpr_potential_t | pot, |
| const int * | atomic_nrs, | ||
| const double * | box, | ||
| gpr_atoms_t | atoms, | ||
| const double * | R_initial, | ||
| const double * | R_final, | ||
| int | n_coords, | ||
| int | n_images, | ||
| const gpr_periodic_band_config_t * | periodic, | ||
| const gpr_local_band_config_t * | local ) |
gpr_neb_search_periodic over a PotentialWrapper (ABI 1.7).
| gpr_neb_t gpr_neb_search_potential | ( | gpr_potential_t | pot, |
| const int * | atomic_nrs, | ||
| const double * | box, | ||
| const double * | R_initial, | ||
| const double * | R_final, | ||
| int | n_coords, | ||
| int | n_images, | ||
| const gpr_neb_config_t * | config ) |
gpr_neb_search over a PotentialWrapper. n_coords must be a positive multiple of 3, and atomic_nrs, box, both endpoints and config must be non-NULL. A GP mode then builds atoms from atomic_nrs (gpr_atoms_simple with those numbers, every atom moving) with one atom type per element in order of first appearance, as the gprn NEB reader types a frame, and continues in gpr_neb_search_gp_potential; being a GP mode is not an error. A length that is not a multiple of 3 fails that check for every mode, including GPR_NEB_GP_LOCAL. A local mode that passes the length check returns NULL with GPR_ERR_INVALID_ARG (kLocalModeEntry). A NULL potential is GPR_ERR_INVALID_ARG; a potential that is not live is GPR_ERR_NULL_HANDLE.
Use this to attach an rgpot-backed PES wrapped with gpr_potential_from_force_with_uncertainty. atomic_nrs has length n_coords/3; box is 9 doubles, row-major 3x3. The NEB oracle is energy and gradient = -force, matching makeLazyPotentialOracle.