Loading...
Searching...
No Matches
Potential wrapper

Functions

gpr_potential_t gpr_potential_from_force_with_uncertainty (gpr_force_with_uncertainty_fn fn, void *user_data)
 Wrap a C force-with-uncertainty callback as a PotentialWrapper.
gpr_potential_t gpr_potential_from_force (gpr_force_fn fn, void *user_data)
 Wrap a plain force callback (the gpr_dimer_search signature) as a potential handle (ABI 1.1). The callback's energy_noise_rms slot is the energy-noise RMS channel and may be NULL. Returns NULL on failure.
void gpr_potential_destroy (gpr_potential_t pot)
 Destroy a potential handle. 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_potential_force (gpr_potential_t pot, long n_atoms, const double *R, const int *atomic_nrs, double *F, double *energy, double *energy_noise_rms, const double *box)
 Evaluate energy and forces. energy_noise_rms may be NULL. When non-NULL, it receives the energy-noise RMS channel (a standard deviation in eV, not a variance).
int gpr_potential_force_with_uncertainty (gpr_potential_t pot, long n_atoms, const double *R, const int *atomic_nrs, double *F, double *energy, double *energy_noise_rms, double *force_noise_rms, const double *box)
 Evaluate energy, forces, and both uncertainty channels. energy_noise_rms and force_noise_rms may be NULL.

Detailed Description

Function Documentation

◆ gpr_potential_destroy()

void gpr_potential_destroy ( gpr_potential_t pot)

Destroy a potential handle. 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.

◆ gpr_potential_force()

int gpr_potential_force ( gpr_potential_t pot,
long n_atoms,
const double * R,
const int * atomic_nrs,
double * F,
double * energy,
double * energy_noise_rms,
const double * box )

Evaluate energy and forces. energy_noise_rms may be NULL. When non-NULL, it receives the energy-noise RMS channel (a standard deviation in eV, not a variance).

◆ gpr_potential_force_with_uncertainty()

int gpr_potential_force_with_uncertainty ( gpr_potential_t pot,
long n_atoms,
const double * R,
const int * atomic_nrs,
double * F,
double * energy,
double * energy_noise_rms,
double * force_noise_rms,
const double * box )

Evaluate energy, forces, and both uncertainty channels. energy_noise_rms and force_noise_rms may be NULL.

◆ gpr_potential_from_force()

gpr_potential_t gpr_potential_from_force ( gpr_force_fn fn,
void * user_data )

Wrap a plain force callback (the gpr_dimer_search signature) as a potential handle (ABI 1.1). The callback's energy_noise_rms slot is the energy-noise RMS channel and may be NULL. Returns NULL on failure.

◆ gpr_potential_from_force_with_uncertainty()

gpr_potential_t gpr_potential_from_force_with_uncertainty ( gpr_force_with_uncertainty_fn fn,
void * user_data )

Wrap a C force-with-uncertainty callback as a PotentialWrapper.

This is the C ABI for pot::PotentialWrapper::from_force_with_uncertainty, which is the factory from_rgpot uses after converting rgpot layouts. rgpot C++ types cannot be named here; pass a callback that evaluates the same PES. Returns NULL on failure (check gpr_last_error()).