HyPar
1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
|
Contains the function to set nonzero entries of the Jacobian matrix. More...
#include <stdio.h>
#include <vector>
#include <arrayfunctions.h>
#include <simulation_object.h>
#include <mpivars_cpp.h>
#include <petscinterface.h>
Go to the source code of this file.
Macros | |
#define | __FUNCT__ "PetscJacobianMatNonzeroEntriesImpl" |
Functions | |
int | PetscJacobianMatNonzeroEntriesImpl (Mat Amat, int width, void *ctxt) |
Contains the function to set nonzero entries of the Jacobian matrix.
Definition in file PetscJacobianMatNonzeroEntriesImpl.cpp.
#define __FUNCT__ "PetscJacobianMatNonzeroEntriesImpl" |
Definition at line 16 of file PetscJacobianMatNonzeroEntriesImpl.cpp.
int PetscJacobianMatNonzeroEntriesImpl | ( | Mat | Amat, |
int | width, | ||
void * | ctxt | ||
) |
Set non-zero entries of the Jacobian matrix for the implicit time integration of the governing equations: The ODE, obtained after discretizing the governing PDE in space, is expressed as follows:
\begin{equation} \frac {d{\bf U}}{dt} = {\bf L}\left({\bf U}\right) \Rightarrow \frac {d{\bf U}}{dt} - {\bf L}\left({\bf U}\right) = 0, \end{equation}
where \({\bf L}\) is the spatially discretized right-hand-side, and \({\bf U}\) represents the entire solution vector.
The Jacobian is thus given by:
\begin{equation} {\bf J} = \left[\alpha{\bf I} - \frac {\partial {\bf L}} {\partial {\bf U}} \right] \end{equation}
where \(\alpha\) is the shift coefficient (PETScContext::shift) of the time integration method.
All functions and variables whose names start with Vec, Mat, PC, KSP, SNES, and TS are defined by PETSc. Refer to the PETSc documentation (https://petsc.org/release/docs/). Usually, googling with the function or variable name yields the specific doc page dealing with that function/variable.
Amat | Matrix |
width | Stencil width |
ctxt | Application context |
Definition at line 38 of file PetscJacobianMatNonzeroEntriesImpl.cpp.