eOn client
Long-timescale dynamics: aKMC, NEB, parallel replica
☾
Toggle main menu visibility
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
10
struct
XTBEngineOptions
{
11
int
method
{
RGPOT_XTB_METHOD_GFN2
};
// RGPOT_XTB_METHOD_*
12
double
accuracy
{1.0};
13
double
electronic_temperature
{300.0};
14
int
max_iterations
{250};
15
double
charge
{0.0};
16
int
uhf
{0};
17
std::string
engine_path
;
18
};
19
20
class
XTBEngineLoader
{
21
public
:
22
explicit
XTBEngineLoader
(
const
XTBEngineOptions
&opt);
23
~XTBEngineLoader
();
24
XTBEngineLoader
(
const
XTBEngineLoader
&) =
delete
;
25
XTBEngineLoader
&
operator=
(
const
XTBEngineLoader
&) =
delete
;
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
31
private
:
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
*);
38
create_fn
m_create
{
nullptr
};
39
destroy_fn
m_destroy
{
nullptr
};
40
force_fn
m_force
{
nullptr
};
41
};
XTBEngineLoader::~XTBEngineLoader
~XTBEngineLoader()
Definition
XTBEngineLoader.cpp:116
XTBEngineLoader::XTBEngineLoader
XTBEngineLoader(const XTBEngineLoader &)=delete
XTBEngineLoader::destroy_fn
void(*)(RgpotXtbPot *) destroy_fn
Definition
XTBEngineLoader.h:35
XTBEngineLoader::m_destroy
destroy_fn m_destroy
Definition
XTBEngineLoader.h:39
XTBEngineLoader::m_force
force_fn m_force
Definition
XTBEngineLoader.h:40
XTBEngineLoader::force
void force(long N, const double *R, const int *atomicNrs, double *F, double *U, double *variance, const double *box) const
Definition
XTBEngineLoader.cpp:126
XTBEngineLoader::m_lib
void * m_lib
Definition
XTBEngineLoader.h:32
XTBEngineLoader::create_fn
RgpotXtbPot *(*)(const RgpotXtbConfig *, char *, size_t) create_fn
Definition
XTBEngineLoader.h:34
XTBEngineLoader::m_pot
RgpotXtbPot * m_pot
Definition
XTBEngineLoader.h:33
XTBEngineLoader::m_create
create_fn m_create
Definition
XTBEngineLoader.h:38
XTBEngineLoader::operator=
XTBEngineLoader & operator=(const XTBEngineLoader &)=delete
XTBEngineLoader::available
bool available() const noexcept
Definition
XTBEngineLoader.h:27
XTBEngineLoader::XTBEngineLoader
XTBEngineLoader(const XTBEngineOptions &opt)
Definition
XTBEngineLoader.cpp:38
XTBEngineLoader::force_fn
int(*)(RgpotXtbPot *, long, const double *, const int *, double *, double *, double *, const double *) force_fn
Definition
XTBEngineLoader.h:36
RgpotXtbConfig
Definition
xtb_c_abi.h:38
XTBEngineOptions
Definition
XTBEngineLoader.h:10
XTBEngineOptions::uhf
int uhf
Definition
XTBEngineLoader.h:16
XTBEngineOptions::engine_path
std::string engine_path
Definition
XTBEngineLoader.h:17
XTBEngineOptions::max_iterations
int max_iterations
Definition
XTBEngineLoader.h:14
XTBEngineOptions::charge
double charge
Definition
XTBEngineLoader.h:15
XTBEngineOptions::electronic_temperature
double electronic_temperature
Definition
XTBEngineLoader.h:13
XTBEngineOptions::method
int method
Definition
XTBEngineLoader.h:11
XTBEngineOptions::accuracy
double accuracy
Definition
XTBEngineLoader.h:12
xtb_c_abi.h
C ABI between XTBDlopen frontend and libxtb_engine.so.
RGPOT_XTB_METHOD_GFN2
@ RGPOT_XTB_METHOD_GFN2
Definition
xtb_c_abi.h:35
RgpotXtbPot
struct RgpotXtbPot RgpotXtbPot
Definition
xtb_c_abi.h:28
include
eon
potentials
Rgpot
XTBEngineLoader.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf