RadCluster
Graph-based cluster dynamics for irradiated materials
Loading...
Searching...
No Matches
Functions
rhs_dispatch.cpp File Reference

Go to the source code of this file.

Functions

void dgbtrf_ (const int *m, const int *n, const int *kl, const int *ku, double *ab, const int *ldab, int *ipiv, int *info)
 
void dgbtrs_ (const char *trans, const int *n, const int *kl, const int *ku, const int *nrhs, const double *ab, const int *ldab, const int *ipiv, double *b, const int *ldb, int *info)
 
void dgetrf_ (const int *m, const int *n, double *a, const int *lda, int *ipiv, int *info)
 
void dgetrs_ (const char *trans, const int *n, const int *nrhs, const double *a, const int *lda, const int *ipiv, double *b, const int *ldb, int *info)
 
static int prec_setup_jacobi (sunrealtype, N_Vector, N_Vector, sunbooleantype, sunbooleantype *jcurPtr, sunrealtype, void *)
 
static int prec_solve_jacobi (sunrealtype, N_Vector, N_Vector, N_Vector r, N_Vector z, sunrealtype gamma, sunrealtype, int, void *user_data)
 
static double fd_delta (double yj, double atol)
 
static int prec_setup_woodbury (sunrealtype t, N_Vector y, N_Vector fy, sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, void *user_data)
 
static int prec_solve_woodbury (sunrealtype t, N_Vector y, N_Vector fy, N_Vector rv, N_Vector zv, sunrealtype gamma, sunrealtype, int, void *user_data)
 
int prec_setup (sunrealtype t, N_Vector y, N_Vector fy, sunbooleantype jok, sunbooleantype *jcurPtr, sunrealtype gamma, 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)
 

Detailed Description

rhs_dispatch.cpp — RHS-dispatch scaffolding and GMRES preconditioners.

This is the host-INDEPENDENT half of the former rate_equations.cpp. It holds the solver-side scaffolding that is shared by every material model:

• prec_setup() / prec_solve() — preconditioner dispatch entry points invoked by SUNDIALS (CVODE + SPGMR). • Jacobi preconditioner — diagonal scaling (legacy, prec_type==0). • Woodbury preconditioner — bordered-banded SMW (prec_type==1), LAPACK dgbtrf/dgbtrs/dgetrf/dgetrs.

The EUROFER-specific P1-P8 rate-equation kernels (rhs_full_CD / rhs_case1 / rhs_case2 / rhs_bin_moment) live in cpp_utils/materials/eurofer97/rate_kernels.cpp and are reached here only through the RHS function pointer carried in UserData.rhs_fn — the preconditioner FD-probes whatever RHS the active material model installed, so this file has no compile-time dependency on the EUROFER kernel arithmetic.

NOTE ON THE REORGANIZATION (RadCluster_2_1 core/materials split): The byte content below is relocated verbatim from rate_equations.cpp lines 1827-2190. No arithmetic, no LAPACK call, and no control flow was altered — this is a pure file-level relocation.

Physics reference: Ghoniem (2026), Rate_Equations.pdf. Preconditioner derivation: Docs/Formulation/Jacobian_Preconditioner.tex.

Definition in file rhs_dispatch.cpp.

Function Documentation

◆ dgbtrf_()

void dgbtrf_ ( const int *  m,
const int *  n,
const int *  kl,
const int *  ku,
double *  ab,
const int *  ldab,
int *  ipiv,
int *  info 
)

◆ dgbtrs_()

void dgbtrs_ ( const char *  trans,
const int *  n,
const int *  kl,
const int *  ku,
const int *  nrhs,
const double *  ab,
const int *  ldab,
const int *  ipiv,
double *  b,
const int *  ldb,
int *  info 
)

◆ dgetrf_()

void dgetrf_ ( const int *  m,
const int *  n,
double *  a,
const int *  lda,
int *  ipiv,
int *  info 
)

◆ dgetrs_()

void dgetrs_ ( const char *  trans,
const int *  n,
const int *  nrhs,
const double *  a,
const int *  lda,
const int *  ipiv,
double *  b,
const int *  ldb,
int *  info 
)

◆ fd_delta()

static double fd_delta ( double  yj,
double  atol 
)
inlinestatic

Definition at line 107 of file rhs_dispatch.cpp.

◆ prec_setup()

int prec_setup ( sunrealtype  t,
N_Vector  y,
N_Vector  fy,
sunbooleantype  jok,
sunbooleantype *  jcurPtr,
sunrealtype  gamma,
void *  user_data 
)

Jacobi diagonal preconditioner setup (for GMRES, window mode).

Definition at line 370 of file rhs_dispatch.cpp.

◆ prec_setup_jacobi()

static int prec_setup_jacobi ( sunrealtype  ,
N_Vector  ,
N_Vector  ,
sunbooleantype  ,
sunbooleantype *  jcurPtr,
sunrealtype  ,
void *   
)
static

Definition at line 77 of file rhs_dispatch.cpp.

◆ prec_setup_woodbury()

static int prec_setup_woodbury ( sunrealtype  t,
N_Vector  y,
N_Vector  fy,
sunbooleantype  jok,
sunbooleantype *  jcurPtr,
sunrealtype  gamma,
void *  user_data 
)
static

Definition at line 115 of file rhs_dispatch.cpp.

◆ prec_solve()

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 
)

Definition at line 390 of file rhs_dispatch.cpp.

◆ prec_solve_jacobi()

static int prec_solve_jacobi ( sunrealtype  ,
N_Vector  ,
N_Vector  ,
N_Vector  r,
N_Vector  z,
sunrealtype  gamma,
sunrealtype  ,
int  ,
void *  user_data 
)
static

Definition at line 84 of file rhs_dispatch.cpp.

◆ prec_solve_woodbury()

static int prec_solve_woodbury ( sunrealtype  t,
N_Vector  y,
N_Vector  fy,
N_Vector  rv,
N_Vector  zv,
sunrealtype  gamma,
sunrealtype  ,
int  ,
void *  user_data 
)
static

Definition at line 303 of file rhs_dispatch.cpp.