Loading...
Searching...
No Matches
XTBEngineLoader.h
Go to the documentation of this file.
1#pragma once
2/*
3** Thin RGPOT-xtb backend: dlopen libxtb_engine.so (ISO_C_BINDING engine).
4** Host does not link libxtb — same pattern as MetatomicEngineLoader.
5*/
6#include "xtb_c_abi.h"
7#include <memory>
8#include <string>
9
11 int method{RGPOT_XTB_METHOD_GFN2}; // RGPOT_XTB_METHOD_*
12 double accuracy{1.0};
15 double charge{0.0};
16 int uhf{0};
17 std::string engine_path;
18};
19
21public:
22 explicit XTBEngineLoader(const XTBEngineOptions &opt);
26
27 [[nodiscard]] bool available() const noexcept { return m_pot != nullptr; }
28 void force(long N, const double *R, const int *atomicNrs, double *F,
29 double *U, double *variance, const double *box) const;
30
31private:
32 void *m_lib{nullptr};
33 RgpotXtbPot *m_pot{nullptr};
34 using create_fn = RgpotXtbPot *(*)(const RgpotXtbConfig *, char *, size_t);
35 using destroy_fn = void (*)(RgpotXtbPot *);
36 using force_fn = int (*)(RgpotXtbPot *, long, const double *, const int *,
37 double *, double *, double *, const double *);
40 force_fn m_force{nullptr};
41};
XTBEngineLoader(const XTBEngineLoader &)=delete
void(*)(RgpotXtbPot *) destroy_fn
destroy_fn m_destroy
void force(long N, const double *R, const int *atomicNrs, double *F, double *U, double *variance, const double *box) const
RgpotXtbPot *(*)(const RgpotXtbConfig *, char *, size_t) create_fn
RgpotXtbPot * m_pot
XTBEngineLoader & operator=(const XTBEngineLoader &)=delete
bool available() const noexcept
XTBEngineLoader(const XTBEngineOptions &opt)
int(*)(RgpotXtbPot *, long, const double *, const int *, double *, double *, double *, const double *) force_fn
std::string engine_path
double electronic_temperature
C ABI between XTBDlopen frontend and libxtb_engine.so.
@ RGPOT_XTB_METHOD_GFN2
Definition xtb_c_abi.h:35
struct RgpotXtbPot RgpotXtbPot
Definition xtb_c_abi.h:28