HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
firstderivative.h
Go to the documentation of this file.
1 
6 #ifndef _FIRST_DERIV_H_
7 #define _FIRST_DERIV_H_
8 
10 #define _FIRST_ORDER_ "1"
11 
12 #define _SECOND_ORDER_CENTRAL_ "2"
13 
14 #define _FOURTH_ORDER_CENTRAL_ "4"
15 
16 /* One-dimensional first derivative functions: Functions to calculate the
17  * finite-difference approximation to the first derivative along a given
18  * dimension at the cell-centers / grid points.
19  *
20  * Arguments:-
21  *
22  * Df double* array containing the approximation to the first derivative
23  * (1D array representing an n-D solution)
24  *
25  * f double* array containing the function whose first derivative is to
26  * be computed.
27  * (1D array representing an n-D solution)
28  *
29  * dir int dimension (x/y/z/...) along which to compute the first derivative
30  *
31  * bias int forward or backward differencing for odd-ordered approximations
32  * (-1: backward, 1: forward)
33  *
34  * s void* pointer to an object providing the solver context. The object must
35  * contain at least the following:
36  * ndims int number of dimensions
37  * nvars int number of elements at each grid location
38  * dim int* array of grid size along each dimension
39  * (integer array of size ndims)
40  * ghosts int number of ghost points
41  *
42  * m void* Pointer to an object providing the MPI context. Current not being
43  * used. This will be required for compact finite-difference methods.
44  *
45  *
46  * Notes:
47  *
48  * + The first derivative is computed at the ghost points too. Thus, biased schemes are used
49  * at and near the boundaries.
50 */
51 
52 int FirstDerivativeFirstOrder (double*,double*,int,int,void*,void*);
53 int FirstDerivativeSecondOrderCentral (double*,double*,int,int,void*,void*);
54 int FirstDerivativeFourthOrderCentral (double*,double*,int,int,void*,void*);
56 int FirstDerivativeSecondOrderCentralNoGhosts (double*,double*,int,int,int,int*,int,int,void*);
58 #if defined(HAVE_CUDA)
59 #if __cplusplus
60 extern "C" {
61 #endif
62 
63 int gpuFirstDerivativeFourthOrderCentral (double*,double*,int,int,void*,void*);
65 #if __cplusplus
66 }
67 #endif
68 #endif
69 
70 #endif
int FirstDerivativeFirstOrder(double *, double *, int, int, void *, void *)
int FirstDerivativeFourthOrderCentral(double *, double *, int, int, void *, void *)
int FirstDerivativeSecondOrderCentralNoGhosts(double *, double *, int, int, int, int *, int, int, void *)
int gpuFirstDerivativeFourthOrderCentral(double *, double *, int, int, void *, void *)
int FirstDerivativeSecondOrderCentral(double *, double *, int, int, void *, void *)