50 int ghosts = solver->
ghosts;
51 int ndims = solver->
ndims;
52 int nvars = solver->
nvars;
57 fprintf(stderr,
"Error in FirstDerivativeFourthOrder(): input arrays not allocated.\n");
61 static double one_twelve = 1.0/12.0;
65 int indexC[ndims], index_outer[ndims], bounds_outer[ndims];
69 #pragma omp parallel for schedule(auto) default(shared) private(i,j,v,index_outer,indexC)
70 for (j=0; j<N_outer; j++) {
74 for (i = -ghosts; i < -ghosts+1; i++) {
75 int qC, qp1, qp2, qp3, qp4;
81 for (v=0; v<nvars; v++)
82 Df[qC*nvars+v] = (-25*f[qC*nvars+v]+48*f[qp1*nvars+v]-36*f[qp2*nvars+v]+16*f[qp3*nvars+v]-3*f[qp4*nvars+v])*one_twelve;
84 for (i = -ghosts+1; i < -ghosts+2; i++) {
85 int qC, qm1, qp1, qp2, qp3;
91 for (v=0; v<nvars; v++)
92 Df[qC*nvars+v] = (-3*f[qm1*nvars+v]-10*f[qC*nvars+v]+18*f[qp1*nvars+v]-6*f[qp2*nvars+v]+f[qp3*nvars+v])*one_twelve;
95 for (i = -ghosts+2; i < dim[dir]+ghosts-2; i++) {
96 int qC, qm1, qm2, qp1, qp2;
102 for (v=0; v<nvars; v++)
103 Df[qC*nvars+v] = (f[qm2*nvars+v]-8*f[qm1*nvars+v]+8*f[qp1*nvars+v]-f[qp2*nvars+v])*one_twelve;
106 for (i = dim[dir]+ghosts-2; i < dim[dir]+ghosts-1; i++) {
107 int qC, qm3, qm2, qm1, qp1;
113 for (v=0; v<nvars; v++)
114 Df[qC*nvars+v] = (-f[qm3*nvars+v]+6*f[qm2*nvars+v]-18*f[qm1*nvars+v]+10*f[qC*nvars+v]+3*f[qp1*nvars+v])*one_twelve;
116 for (i = dim[dir]+ghosts-1; i < dim[dir]+ghosts; i++) {
117 int qC, qm4, qm3, qm2, qm1;
123 for (v=0; v<nvars; v++)
124 Df[qC*nvars+v] = (3*f[qm4*nvars+v]-16*f[qm3*nvars+v]+36*f[qm2*nvars+v]-48*f[qm1*nvars+v]+25*f[qC*nvars+v])*one_twelve;
Definitions for the functions computing the first derivative.
#define _ArrayIndexnD_(N, index, imax, i, ghost)
int FirstDerivativeFourthOrderCentral(double *, double *, int, int, void *, void *)
MPI related function definitions.
#define _ArrayIndex1D_(N, imax, i, ghost, index)
#define _ArrayCopy1D_(x, y, size)
Contains structure definition for hypar.
Some basic definitions and macros.
Contains macros and function definitions for common array operations.
#define _ArrayProduct1D_(x, size, p)
Structure of MPI-related variables.
Structure containing all solver-specific variables and functions.