RadCluster
Graph-based cluster dynamics for irradiated materials
Loading...
Searching...
No Matches
rate_equations.h
Go to the documentation of this file.
1
15#pragma once
16
17#include "parameters.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/* SUNDIALS N_Vector */
24#include <sundials/sundials_nvector.h>
25#include <sundials/sundials_types.h>
26
27#ifdef __cplusplus
28}
29#endif
30
31// ── SUNDIALS RHS callback type ────────────────────────────────────────────────
32using CVRhsFn_t = int(*)(sunrealtype, N_Vector, N_Vector, void*);
33
34// ── User data struct passed to SUNDIALS RHS ───────────────────────────────────
35
36struct UserData {
37 Parameters* P; // non-const: preconditioner writes storage
38 CVRhsFn_t rhs_fn; // RHS function pointer (for FD probing in preconditioner)
39 // Dynamic window state (used by active_window)
40 int x_lo_i; // lower active SIA index (0-based)
41 int x_hi_i; // upper active SIA index (inclusive, 0-based)
42 int x_lo_v; // lower active VAC index (0-based)
43 int x_hi_v; // upper active VAC index (inclusive, 0-based)
45};
46
47// ── Startup: size-only kernel tables ─────────────────────────────────────────
48
61
62// ── RHS callbacks ─────────────────────────────────────────────────────────────
63
71int rhs_full_CD(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
72
80int rhs_bin_moment(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data);
81
85int prec_setup(sunrealtype t, N_Vector y, N_Vector fy,
86 sunbooleantype jok, sunbooleantype* jcurPtr,
87 sunrealtype gamma, void* user_data);
88
89int prec_solve(sunrealtype t, N_Vector y, N_Vector fy,
90 N_Vector r, N_Vector z,
91 sunrealtype gamma, sunrealtype delta,
92 int lr, void* user_data);
int prec_solve(sunrealtype t, N_Vector y, N_Vector fy, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype delta, int lr, void *user_data)
int prec_setup(sunrealtype t, N_Vector y, N_Vector fy, sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data)
int rhs_full_CD(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data)
int(*)(sunrealtype, N_Vector, N_Vector, void *) CVRhsFn_t
int rhs_bin_moment(sunrealtype t, N_Vector y, N_Vector ydot, void *user_data)
void build_kernel_tables(Parameters &P)
bool window_active
CVRhsFn_t rhs_fn
Parameters * P