accelerInt  v0.1
solver_generic.c
Go to the documentation of this file.
1 
10 #include "header.h"
11 #include "solver.h"
12 
13 #ifdef GENERATE_DOCS
14  namespace generic {
15 #endif
16 
28 void intDriver (const int NUM, const double t, const double t_end,
29  const double *pr_global, double *y_global)
30 {
31  int tid;
32  #pragma omp parallel for shared(y_global, pr_global) private(tid)
33  for (tid = 0; tid < NUM; ++tid) {
34 
35  // local array with initial values
36  double y_local[NSP];
37  double pr_local = pr_global[tid];
38 
39  // load local array with initial values from global array
40 
41  for (int i = 0; i < NSP; i++)
42  {
43  y_local[i] = y_global[tid + i * NUM];
44  }
45 
46  // call integrator for one time step
47  check_error(tid, integrate (t, t_end, pr_local, y_local));
48 
49  // update global array with integrated values
50 
51  for (int i = 0; i < NSP; i++)
52  {
53  y_global[tid + i * NUM] = y_local[i];
54  }
55 
56  } //end tid loop
57 
58 } // end intDriver
59 
60 #ifdef GENERATE_DOCS
61  }
62 #endif
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.
Definition: radau2a.c:520
An example header file that defines system size and other required methods for integration of the van...
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.
#define NSP
The IVP system size.
Definition: header.cuh:20
Contains skeleton of all methods that need to be defined on a per solver basis.
Definition: solver.h:19
void check_error(int, int)
Checks the return code of the given thread (IVP) for an error, and exits if found.
Definition: radau2a_props.c:13