C++¶
Header-only wrapper in include/palioxis.hpp. No build step required —
add include/ to your include path and link against the Palioxis static
library.
API coverage¶
C API ( |
C++ wrapper |
|---|---|
Process configuration |
|
— |
|
— |
|
Construction / destruction |
|
|
|
|
destructor |
Model metadata |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cached at construction |
|
|
|
|
|
|
Diffusion |
|
|
|
|
|
|
|
|
|
|
|
|
— |
|
— |
Time integration |
|
|
|
|
|
— |
|
|
|
|
|
|
|
Initialisation |
|
|
|
|
|
|
|
|
|
— |
|
Bounds / validation |
|
|
|
|
|
Surface |
|
|
|
|
|
Retention |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Diagnostics |
|
|
|
|
— |
|
— |
Usage¶
#include "palioxis.hpp"
// Set the Palioxis data root once per process.
// XML input files cross-reference each other relative to this path.
palioxis::set_root("/path/to/palioxis");
// Construct a model from an XML configuration file.
palioxis::MultipleDefectModel m("input.xml");
// Inspect cached metadata.
std::cout << "n_gas = " << m.get_n_gas() << "\n";
for (const auto& name : m.gas_names())
std::cout << " gas: " << name << "\n";
// State vectors — sizes: mobile[n_gas], defects[n_trap_types], trapped[n_ne_traps]
palioxis::MobileConcentrations mobile = { /* ... */ };
palioxis::DefectConcentrations defects = { /* ... */ };
palioxis::TrappedConcentrations trapped = { /* ... */ };
double T = 800.0; // Kelvin
// Effective diffusion coefficient prefactor matrix (n_gas × n_gas).
palioxis::ShapedDoubleData D_eff = m.effective_diffusion_prefactor(mobile, defects, T);
// Both mobile and trapped time derivatives in a single call.
palioxis::TimeDerivatives dy = m.get_time_derivatives(mobile, defects, trapped, T);
// dy.mobile — mobile rates [n_gas]
// dy.trapped — trapped rates [n_ne_traps]