HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Definitions for the functions computing the second derivative. More...
Go to the source code of this file.
Macros | |
#define | _SECOND_ORDER_CENTRAL_ "2" |
#define | _FOURTH_ORDER_CENTRAL_ "4" |
Functions | |
int | SecondDerivativeSecondOrderCentral (double *, double *, int, void *, void *) |
int | SecondDerivativeFourthOrderCentral (double *, double *, int, void *, void *) |
int | SecondDerivativeSecondOrderCentralNoGhosts (double *, double *, int, int, int *, int, int, void *) |
Definitions for the functions computing the second derivative.
Definition in file secondderivative.h.
#define _SECOND_ORDER_CENTRAL_ "2" |
Second order central scheme
Definition at line 10 of file secondderivative.h.
#define _FOURTH_ORDER_CENTRAL_ "4" |
Fourth order central scheme
Definition at line 12 of file secondderivative.h.
int SecondDerivativeSecondOrderCentral | ( | double * | D2f, |
double * | f, | ||
int | dir, | ||
void * | s, | ||
void * | m | ||
) |
Second order approximation to the second derivative (note: not divided by square of grid spacing).
Computes the second-order finite-difference approximation to the second derivative (Note: not divided by the grid spacing):
\begin{equation} \left(\partial^2 f\right)_i = f_{i-1} - 2f_i + f_{i+1} \end{equation}
where \(i\) is the grid index along the spatial dimension of the derivative.
Notes:
D2f | Array to hold the computed second derivative (with ghost points) (same size and layout as f) |
f | Array containing the grid point function values whose first derivative is to be computed (with ghost points) |
dir | The spatial dimension along which the derivative is computed |
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
Definition at line 34 of file SecondDerivativeSecondOrder.c.
int SecondDerivativeFourthOrderCentral | ( | double * | D2f, |
double * | f, | ||
int | dir, | ||
void * | s, | ||
void * | m | ||
) |
Fourth order approximation to the second derivative (note: not divided by square of grid spacing).
Computes the fourth-order finite-difference approximation to the second derivative (Note: not divided by the grid spacing):
\begin{equation} \left(\partial^2 f\right)_i = -\frac{1}{12}f_{i-2} + \frac{4}{3}f_{i-1} - \frac{15}{6}f_i + \frac{4}{3}f_{i+1} - \frac{1}{12}f_{i+2} \end{equation}
where \(i\) is the grid index along the spatial dimension of the derivative.
Notes:
D2f | Array to hold the computed second derivative (with ghost points) (same size and layout as f) |
f | Array containing the grid point function values whose first derivative is to be computed (with ghost points) |
dir | The spatial dimension along which the derivative is computed |
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
Definition at line 34 of file SecondDerivativeFourthOrder.c.
int SecondDerivativeSecondOrderCentralNoGhosts | ( | double * | D2f, |
double * | f, | ||
int | dir, | ||
int | ndims, | ||
int * | dim, | ||
int | ghosts, | ||
int | nvars, | ||
void * | m | ||
) |
Second order approximation to the second derivative (note: not divided by square of grid spacing).
Computes the second-order finite-difference approximation to the second derivative (Note: not divided by the grid spacing):
\begin{equation} \left(\partial^2 f\right)_i = f_{i-1} - 2f_i + f_{i+1} \end{equation}
where \(i\) is the grid index along the spatial dimension of the derivative.
Notes:
D2f | Array to hold the computed second derivative (with ghost points) (same size and layout as f) |
f | Array containing the grid point function values whose second derivative is to be computed (with ghost points) |
dir | The spatial dimension along which the derivative is computed |
ndims | Number of spatial/coordinate dimensions |
dim | Local dimensions |
ghosts | Number of ghost points |
nvars | Number of vector components at each grid points |
m | MPI object of type MPIContext |
Definition at line 39 of file SecondDerivativeSecondOrderNoGhosts.c.