accelerInt
v0.1
|
Functions | |
void | intDriver (const int NUM, const double t, const double t_end, const double *pr_global, double *y_global) |
Integration driver for the CPU integrators. More... | |
int | integrate (const double t_start, const double t_end, const double pr, double *y) |
A header definition of the integrate method, that must be implemented by various solvers. More... | |
void | init_solver_log () |
Initializes solver specific items for logging. More... | |
void | solver_log () |
Executes solver specific logging tasks. More... | |
void | initialize_solver (int num_threads) |
Initializes the solver. More... | |
void | cleanup_solver (int num_threads) |
Cleans up the created solvers. More... | |
const char * | solver_name () |
Returns a descriptive solver name. More... | |
void | accelerInt_initialize (int num_threads) |
Initializes the solver. More... | |
void | accelerInt_integrate (const int NUM, const double t_start, const double t_end, const double stepsize, double *__restrict__ y_host, const double *__restrict__ var_host) |
integrate NUM odes from time t to time t_end , using stepsizes of t_step More... | |
void | accelerInt_cleanup (int num_threads) |
Cleans up the solver. More... | |
void | write_log (int NUM, double t, const double *y_host, FILE *pFile) |
Writes state vectors to file. More... | |
int | main (int argc, char *argv[]) |
void | check_error (int, int) |
Checks the return code of the given thread (IVP) for an error, and exits if found. More... | |
Include common code.
void generic::accelerInt_cleanup | ( | int | num_threads | ) |
Cleans up the solver.
[in] | num_threads | The number of OpenMP threads to use |
Definition at line 63 of file solver_interface.c.
void generic::accelerInt_initialize | ( | int | num_threads | ) |
Initializes the solver.
[in] | num_threads | The number of OpenMP threads to use |
Definition at line 23 of file solver_interface.c.
void generic::accelerInt_integrate | ( | const int | NUM, |
const double | t_start, | ||
const double | t_end, | ||
const double | stepsize, | ||
double *__restrict__ | y_host, | ||
const double *__restrict__ | var_host | ||
) |
integrate NUM odes from time t
to time t_end
, using stepsizes of t_step
[in] | NUM | The number of ODEs to integrate. This should be the size of the leading dimension of y_host and var_host . |
[in] | t_start | The system time |
[in] | t_end | The end time |
[in] | stepsize | The integration step size. If stepsize < 0, the step size will be set to t_end - t |
[in,out] | y_host | The state vectors to integrate. |
[in] | var_host | The parameters to use in dydt() and eval_jacob() |
[in] | NUM | The number of ODEs to integrate. This should be the size of the leading dimension of y_host and var_host . |
[in] | t | The system time |
[in] | t_end | The end time |
[in] | stepsize | The integration step size. If stepsize < 0, the step size will be set to t_end - t |
[in,out] | y_host | The state vectors to integrate. |
[in] | var_host | The parameters to use in dydt() and eval_jacob() |
Definition at line 39 of file solver_interface.c.
void generic::check_error | ( | int | tid, |
int | code | ||
) |
Checks the return code of the given thread (IVP) for an error, and exits if found.
tid | The thread (IVP) index |
code | The return code of the thread |
tid | The thread (IVP) index |
code | The return code of the thread |
Definition at line 13 of file radau2a_props.c.
void generic::cleanup_solver | ( | int | num_threads | ) |
Cleans up the created solvers.
num_threads | The number of OpenMP threads used |
Frees and cleans up allocated CVODE memory.
num_threads | The number of OpenMP threads used |
Frees and cleans up allocated RK78 memory.
Definition at line 165 of file cvodes_init.c.
void generic::init_solver_log | ( | ) |
Initializes solver specific items for logging.
Initializes stepsize logging for stiffness measurement
Initializes solver specific items for logging.
Initializes the Krylov subspace logging files (if LOG_OUTPUT is defined)
Definition at line 190 of file cvodes_init.c.
void generic::initialize_solver | ( | int | num_threads | ) |
Initializes the solver.
num_threads | The number of OpenMP threads to use |
Various definitions in the generated options, e.g. FINITE_DIFFERENCE, CV_MAX_ERRTEST_FAILS, etc. affect the options set for the CVODEs solver.
The RHS function dydt_cvodes() will be used in the solver.
If FINITE_DIFFERENCE is not defined, the jacobian function in eval_jacob_cvodes will be used in the CVODE solver. Else, the CVODE finite difference based on the RHS function will be used.
num_threads | The number of OpenMP threads to use |
num_threads | Unused |
Definition at line 49 of file cvodes_init.c.
void generic::intDriver | ( | const int | NUM, |
const double | t, | ||
const double | t_end, | ||
const double * | pr_global, | ||
double * | y_global | ||
) |
Integration driver for the CPU integrators.
[in] | NUM | The (non-padded) number of IVPs to integrate |
[in] | t | The current system time |
[in] | t_end | The IVP integration end time |
[in] | pr_global | The system constant variable (pressures / densities) |
[in,out] | y_global | The system state vectors at time t. Returns system state vectors at time t_end |
[in] | NUM | The (non-padded) number of IVPs to integrate |
[in] | t | The current system time |
[in] | t_end | The IVP integration end time |
[in] | pr_global | The system constant variable (pressures / densities) |
[in,out] | y_global | The system state vectors at time t. Returns system state vectors at time t_end |
This is generic driver for CPU integrators
Definition at line 28 of file solver_generic.c.
int generic::integrate | ( | const double | t_start, |
const double | t_end, | ||
const double | pr, | ||
double * | y | ||
) |
A header definition of the integrate method, that must be implemented by various solvers.
[in] | t_start | the starting IVP integration time |
[in] | t_end | the IVP integration endtime |
[in] | pr | the IVP constant variable (presssure/density) |
[in,out] | y | The IVP state vector at time t_start. At end of this function call, the system state at time t_end is stored here |
A header definition of the integrate method, that must be implemented by various solvers.
[in] | t_start | The starting time |
[in] | t_end | The end integration time |
[in] | pr | The system constant variable (pressure/density) |
[in,out] | y | The system state vector at time t_start . Overwritten with the system state at time t_end |
A header definition of the integrate method, that must be implemented by various solvers.
t_start | The initial integration time |
t_end | The final integration timestep |
pr | User data passed to the RHS function dydt() - commonly used for the Pressure term |
y | The state vector |
A header definition of the integrate method, that must be implemented by various solvers.
t_start | The initial integration time |
t_end | The final integration timestep |
pr | User data passed to the RHS function dydt() - commonly used for the Pressure term |
y | The state vector |
int generic::main | ( | int | argc, |
char * | argv[] | ||
) |
Main function
[in] | argc | command line argument count |
[in] | argv | command line argument vector |
This allows running the integrators from the command line. The syntax is as follows:
./solver-name [num_threads] [num_IVPs]
omp_get_max_threads()
Definition at line 87 of file solver_main.c.
void generic::solver_log | ( | ) |
Executes solver specific logging tasks.
Logs errors, step-sizes, and krylov subspace size (if LOG_OUTPUT is defined)
Definition at line 192 of file cvodes_init.c.
const char* generic::solver_name | ( | ) |
Returns a descriptive solver name.
Definition at line 181 of file cvodes_init.c.
void generic::write_log | ( | int | NUM, |
double | t, | ||
const double * | y_host, | ||
FILE * | pFile | ||
) |
Writes state vectors to file.
[in] | NUM | the number of state vectors to write |
[in] | t | the current system time |
[in] | y_host | the current state vectors |
[in] | pFile | the opened binary file object |
The resulting file is updated as: system time
temperature, mass fractions (State #1)
temperature, mass fractions (State #2)...
Definition at line 47 of file solver_main.c.