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>
#include <hypar.h>
Go to the source code of this file.
Macros | |
#define | _MINIMUM_GHOSTS_ 1 |
Functions | |
int | SecondDerivativeSecondOrderCentral (double *D2f, double *f, int dir, void *s, void *m) |
2nd order discretization of the second derivative.
Definition in file SecondDerivativeSecondOrder.c.
#define _MINIMUM_GHOSTS_ 1 |
Minimum number of ghost points required.
Definition at line 18 of file SecondDerivativeSecondOrder.c.
int SecondDerivativeSecondOrderCentral | ( | double * | D2f, |
double * | f, | ||
int | dir, | ||
void * | s, | ||
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 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.