HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
2nd order discretization of the second derivative. More...
#include <stdio.h>
#include <stdlib.h>
#include <basic.h>
#include <arrayfunctions.h>
#include <secondderivative.h>
#include <mpivars.h>
Go to the source code of this file.
Macros | |
#define | _MINIMUM_GHOSTS_ 1 |
Typedefs | |
typedef MPIVariables | MPIContext |
Functions | |
int | SecondDerivativeSecondOrderCentralNoGhosts (double *D2f, double *f, int dir, int ndims, int *dim, int ghosts, int nvars, void *m) |
2nd order discretization of the second derivative.
Definition in file SecondDerivativeSecondOrderNoGhosts.c.
#define _MINIMUM_GHOSTS_ 1 |
Minimum number of ghost points required.
Definition at line 19 of file SecondDerivativeSecondOrderNoGhosts.c.
typedef MPIVariables MPIContext |
Definition at line 13 of file SecondDerivativeSecondOrderNoGhosts.c.
int SecondDerivativeSecondOrderCentralNoGhosts | ( | double * | D2f, |
double * | f, | ||
int | dir, | ||
int | ndims, | ||
int * | dim, | ||
int | ghosts, | ||
int | nvars, | ||
void * | m | ||
) |
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.