|
PartMC
2.4.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... | |
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_Init (CVodeMem cv_mem) |
| Initialization routine for the ODE linear equation solver. More... | |
| static int | condense_solver_Setup (CVodeMem cv_mem, int convfail, N_Vector ypred, N_Vector fpred, booleantype *jcurPtr, N_Vector vtemp1, N_Vector vtemp2, N_Vector vtemp3) |
| Setup routine for the ODE linear equation solver. More... | |
| static int | condense_solver_Solve (CVodeMem cv_mem, N_Vector b, N_Vector weight, N_Vector ycur, N_Vector fcur) |
| Linear solver routine for use by the ODE solver. More... | |
| static void | condense_solver_Free (CVodeMem cv_mem) |
| Finalization routine for the ODE linear equation solver. More... | |
| 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_Y 1 |
Result code indicating failure to allocate y vector.
Definition at line 22 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 218 of file condense_solver.c.
| 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 73 of file condense_solver.c.
|
static |
Finalization routine for the ODE linear equation solver.
| cv_mem | The CVODE solver parameter structure. |
Definition at line 328 of file condense_solver.c.
|
static |
Initialization routine for the ODE linear equation solver.
| cv_mem | The CVODE solver parameter structure. |
Definition at line 251 of file condense_solver.c.
|
static |
Setup routine for the ODE linear equation solver.
| cv_mem | The CVODE solver parameter structure. |
| convfail | |
| ypred | |
| fpred | |
| jcurPtr | |
| vtemp1 | |
| vtemp2 | |
| vtemp3 |
Definition at line 268 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.
| cv_mem | The CVODE solver parameter structure. |
| b | The right-hand-side of the linear system. |
| weight | |
| ycur | The current state vector. |
| fcur | The current vector field vector. |
Definition at line 288 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 173 of file condense_solver.c.