accelerInt  v0.1
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
Defines some simple macros to simplify GPU indexing.
__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
An example header file that defines system size, memory functions and other required methods for inte...
This struct is used to store memory for the CUDA RHS and Jacobian evaluation. Along with the solver_m...
Definition: gpu_memory.cuh:25
#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