HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Evaluate the parabolic term using a 1-stage finite-difference discretization. More...
#include <stdlib.h>
#include <basic.h>
#include <arrayfunctions.h>
#include <mpivars.h>
#include <hypar.h>
Go to the source code of this file.
Functions | |
int | ParabolicFunctionNC1Stage (double *par, double *u, void *s, void *m, double t) |
Evaluate the parabolic term using a 1-stage finite-difference discretization.
Definition in file ParabolicFunctionNC1Stage.c.
int ParabolicFunctionNC1Stage | ( | double * | par, |
double * | u, | ||
void * | s, | ||
void * | m, | ||
double | t | ||
) |
Evaluate the parabolic term using a conservative finite-difference spatial discretization: The parabolic term is assumed to be of the form:
\begin{equation} {\bf P}\left({\bf u}\right) = \sum_{d=0}^{D-1} \frac {\partial^2 {\bf g}_d\left(\bf u\right)} {\partial x_d^2}, \end{equation}
which is discretized at a grid point as:
\begin{equation} \left.{\bf P}\left({\bf u}\right)\right|_j = \sum_{d=0}^{D-1} \frac { \mathcal{L}_d \left[ {\bf g}_d \right] } {\Delta x_d^2}, \end{equation}
where \(d\) is the spatial dimension index, \(D\) is the total number of spatial dimensions (HyPar::ndims), and \(j\) is the grid index along \(d\). \(\mathcal{L}_d\) represents the finite-difference approximation to the Laplacian along the \(d\) spatial dimension, computed using HyPar::SecondDerivativePar.
Note: this form of the parabolic term does not allow for cross-derivatives.
To use this form of the parabolic term:
par | array to hold the computed parabolic term |
u | solution |
s | Solver object of type HyPar |
m | MPI object of type MPIVariables |
t | Current simulation time |
Definition at line 31 of file ParabolicFunctionNC1Stage.c.