13 __constant__
double x_coeffs[
FD_ORD] = {-1.0, 1.0};
14 __constant__
double y_coeffs[
FD_ORD] = {-0.5, 0.5};
16 __constant__
double x_coeffs[
FD_ORD] = {-2.0, -1.0, 1.0, 2.0};
17 __constant__
double y_coeffs[
FD_ORD] = {1.0 / 12.0, -2.0 / 3.0, 2.0 / 3.0, -1.0 / 12.0};
19 __constant__
double x_coeffs[
FD_ORD] = {-3.0, -2.0, - 1.0, 1.0, 2.0, 3.0};
20 __constant__
double y_coeffs[
FD_ORD] = {-1.0 / 60.0, 3.0 / 20.0, -3.0 / 4.0, 3.0 / 4.0, -3.0 / 20.0, 1.0 / 60.0};
35 void eval_jacob (
const double t,
const double pres,
const double * __restrict__ cy,
36 double * __restrict__ jac,
const mechanism_memory* __restrict__ d_mem,
37 double* __restrict__
y_temp,
double* __restrict__ ewt) {
38 double* dy = d_mem->dy;
41 for (
int i = 0; i <
NSP; ++i) {
46 dydt (t, pres, cy, dy, d_mem);
49 for (
int j = 0; j <
NSP; ++j) {
51 for (
int i = 0; i <
NSP; ++i) {
58 double srur = sqrt(DBL_EPSILON);
62 for (
int i = 0; i <
NSP; ++i) {
65 double fac = sqrt(sum / ((
double)(
NSP)));
66 double r0 = 1000.0 *
RTOL * DBL_EPSILON * ((double)(
NSP)) * fac;
70 for (
int j = 0; j <
NSP; ++j) {
72 double r = fmax(srur * fabs(yj_orig), r0 / ewt[
INDEX(j)]);
79 for (
int i = 0; i <
NSP; ++i) {
84 for (
int i = 0; i <
NSP; ++i) {
88 for (
int k = 0; k <
FD_ORD; ++k) {
93 for (
int i = 0; i <
NSP; ++i) {
98 for (
int i = 0; i <
NSP; ++i) {
void dydt(const double t, const double mu, const double *__restrict__ y, double *__restrict__ dy)
An implementation of the RHS of the van der Pol equation.
Header definition of CUDA Finite Difference Jacobian.
__device__ void eval_jacob(const double t, const double pres, const double *__restrict__ cy, double *__restrict__ jac, const mechanism_memory *__restrict__ d_mem, double *__restrict__ y_temp, double *__restrict__ ewt)
Computes a finite difference Jacobian of order FD_ORD of the RHS function dydt at the given pressure ...
double * y_temp
temorary storage
#define FD_ORD
The finite difference order [Default: 1].
#define INDEX(i)
Convenience macro to get the value of a vector at index i, calculated as i * GRID_DIM + T_ID...