|
PartMC
2.8.0
|
Interface to SUNDIALS ODE solver library for condensation. More...

Go to the source code of this file.
Macros | |
| #define | PMC_CONDENSE_SOLVER_SUCCESS 0 |
| Result code indicating successful completion. More... | |
| #define | PMC_CONDENSE_SOLVER_INIT_Y 1 |
Result code indicating failure to allocate y vector. More... | |
| #define | PMC_CONDENSE_SOLVER_INIT_ABSTOL 2 |
Result code indicating failure to allocate abstol vector. More... | |
| #define | PMC_CONDENSE_SOLVER_INIT_CVODE_MEM 3 |
| Result code indicating failure to create the solver. More... | |
| #define | PMC_CONDENSE_SOLVER_INIT_CVODE 4 |
| Result code indicating failure to initialize the solver. More... | |
| #define | PMC_CONDENSE_SOLVER_SVTOL 5 |
| Result code indicating failure to set tolerances. More... | |
| #define | PMC_CONDENSE_SOLVER_SET_MAX_STEPS 6 |
| Result code indicating failure to set maximum steps. More... | |
| #define | PMC_CONDENSE_SOLVER_FAIL 7 |
| Result code indicating failure of the solver. More... | |
| #define | PMC_CONDENSE_SOLVER_LINSOL_CTOR 8 |
| Result code indicating failure in creation of the linear solver. More... | |
| #define | PMC_CONDENSE_SOLVER_LINSOL_SET 9 |
| Result code indicating failure in setting the linear solver. More... | |
| #define | PMC_CONDENSE_SOLVER_LINSOL_PREC 10 |
| Result code indicating failure in setting the preconditioner. More... | |
| #define | PMC_CONDENSE_SOLVER_INIT_SUNDIALS 11 |
| Result code indicating failure to allocate the SUNDIALS Context. More... | |
Functions | |
| static int | condense_vf (realtype t, N_Vector y, N_Vector ydot, void *user_data) |
| The ODE vector field to integrate. More... | |
| static int | condense_check_flag (void *flagvalue, char *funcname, int opt) |
| Check the return value from a SUNDIALS call. More... | |
| static int | condense_solver_Solve (double t, N_Vector ycur, N_Vector fcur, N_Vector b, N_Vector z, double gamma, double delta, int lr, void *user_data) |
| Linear solver routine for use by the ODE solver. More... | |
| void | condense_vf_f (int neq, realtype t, double *y_f, double *ydot_f) |
| void | condense_jac_solve_f (int neq, double t, double *ycur_f, double *fcur_f, double *b_f, double gamma) |
| int | condense_solver (int neq, double *x_f, double *abstol_f, double reltol_f, double t_initial_f, double t_final_f) |
| Call the ODE solver. More... | |
Interface to SUNDIALS ODE solver library for condensation.
Definition in file condense_solver.c.
| #define PMC_CONDENSE_SOLVER_FAIL 7 |
Result code indicating failure of the solver.
Definition at line 40 of file condense_solver.c.
| #define PMC_CONDENSE_SOLVER_INIT_ABSTOL 2 |
Result code indicating failure to allocate abstol vector.
Definition at line 25 of file condense_solver.c.
| #define PMC_CONDENSE_SOLVER_INIT_CVODE 4 |
Result code indicating failure to initialize the solver.
Definition at line 31 of file condense_solver.c.
| #define PMC_CONDENSE_SOLVER_INIT_CVODE_MEM 3 |
Result code indicating failure to create the solver.
Definition at line 28 of file condense_solver.c.
| #define PMC_CONDENSE_SOLVER_INIT_SUNDIALS 11 |
Result code indicating failure to allocate the SUNDIALS Context.
Definition at line 52 of file condense_solver.c.
| #define PMC_CONDENSE_SOLVER_INIT_Y 1 |
Result code indicating failure to allocate y vector.
Definition at line 22 of file condense_solver.c.
| #define PMC_CONDENSE_SOLVER_LINSOL_CTOR 8 |
Result code indicating failure in creation of the linear solver.
Definition at line 43 of file condense_solver.c.
| #define PMC_CONDENSE_SOLVER_LINSOL_PREC 10 |
Result code indicating failure in setting the preconditioner.
Definition at line 49 of file condense_solver.c.
| #define PMC_CONDENSE_SOLVER_LINSOL_SET 9 |
Result code indicating failure in setting the linear solver.
Definition at line 46 of file condense_solver.c.
| #define PMC_CONDENSE_SOLVER_SET_MAX_STEPS 6 |
Result code indicating failure to set maximum steps.
Definition at line 37 of file condense_solver.c.
| #define PMC_CONDENSE_SOLVER_SUCCESS 0 |
Result code indicating successful completion.
Definition at line 19 of file condense_solver.c.
| #define PMC_CONDENSE_SOLVER_SVTOL 5 |
Result code indicating failure to set tolerances.
Definition at line 34 of file condense_solver.c.
|
static |
Check the return value from a SUNDIALS call.
opt == 0 means SUNDIALS function allocates memory so check if flagvalue is not a NULL pointer.opt == 1 means SUNDIALS function returns a flag so check if the int pointed to by flagvalue has flag >= 0.opt == 2 means function allocates memory so check if flagvalue is not a NULL pointer.| flagvalue | A pointer to check (either for NULL, or as an int pointer giving the flag value). |
| funcname | A string giving the function name returning this result code. |
| opt | A flag indicating the type of check to perform. |
Definition at line 239 of file condense_solver.c.
| void condense_jac_solve_f | ( | int | neq, |
| double | t, | ||
| double * | ycur_f, | ||
| double * | fcur_f, | ||
| double * | b_f, | ||
| double | gamma | ||
| ) |
| int condense_solver | ( | int | neq, |
| double * | x_f, | ||
| double * | abstol_f, | ||
| double | reltol_f, | ||
| double | t_initial_f, | ||
| double | t_final_f | ||
| ) |
Call the ODE solver.
| neq | The number of equations. |
| x_f | A pointer to a vector of neq variables, giving the initial state vector on entry and the final state vector on exit. |
| abstol_f | A pointer to a vector of neq variables, giving the absolute error tolerance for the corresponding state vector component. |
| reltol_f | The scalar relative tolerance. |
| t_initial_f | The initial time (s). |
| t_final_f | The final time (s). |
Definition at line 84 of file condense_solver.c.
|
static |
Linear solver routine for use by the ODE solver.
Should solve the system
, where
is the current vector field Jacobian,
is a given scalar, and
is a given vector.
Definition at line 276 of file condense_solver.c.
|
static |
The ODE vector field to integrate.
| t | The current time (s). |
| y | The state vector. |
| ydot | The rate of change of the state vector. |
| user_data | A pointer to user-provided data. |
Definition at line 193 of file condense_solver.c.
| void condense_vf_f | ( | int | neq, |
| realtype | t, | ||
| double * | y_f, | ||
| double * | ydot_f | ||
| ) |