accelerInt
v0.1
examples
van_der_pol
dydt.cu
Go to the documentation of this file.
1
9
#include "
header.cuh
"
10
#include "
gpu_macros.cuh
"
11
12
#ifdef GENERATE_DOCS
13
//put this in the van der Pol namespace for documentation
14
namespace
van_der_pol_cu
{
15
#endif
16
23
__device__
24
void
dydt
(
const
double
t,
const
double
mu,
const
double
* __restrict__ y,
double
* __restrict__ dy,
25
const
mechanism_memory
* __restrict__ d_mem) {
26
27
// y1' = y2
28
dy[
INDEX
(0)] = y[
INDEX
(1)];
29
// y2' = mu(1 - y1^2)y2 - y1
30
dy[
INDEX
(1)] = mu * (1 - y[
INDEX
(0)] * y[
INDEX
(0)]) * y[
INDEX
(1)] - y[
INDEX
(0)];
31
32
}
// end dydt
33
34
35
#ifdef GENERATE_DOCS
36
}
37
#endif
gpu_macros.cuh
Defines some simple macros to simplify GPU indexing.
van_der_pol_cu::dydt
__device__ void dydt(const double t, const double mu, const double *__restrict__ y, double *__restrict__ dy, const mechanism_memory *__restrict__ d_mem)
An implementation of the RHS of the van der Pol equation.
Definition:
dydt.cu:24
header.cuh
An example header file that defines system size, memory functions and other required methods for inte...
van_der_pol_cu::mechanism_memory
This struct is used to store memory for the CUDA RHS and Jacobian evaluation. Along with the solver_m...
Definition:
gpu_memory.cuh:25
van_der_pol_cu
Definition:
dydt.cu:14
INDEX
#define INDEX(i)
Convenience macro to get the value of a vector at index i, calculated as i * GRID_DIM + T_ID...
Definition:
gpu_macros.cuh:24
Generated by
1.8.14