HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PetscIJacobianIMEX.cpp File Reference

Contains the functions required for Jacobian computations for IMEX time-integration. More...

#include <stdlib.h>
#include <basic.h>
#include <arrayfunctions.h>
#include <mpivars_cpp.h>
#include <simulation_object.h>
#include <petscinterface.h>

Go to the source code of this file.

Macros

#define __FUNCT__   "PetscIJacobianIMEX"
 
#define __FUNCT__   "PetscJacobianFunctionIMEX_JFNK"
 
#define __FUNCT__   "PetscJacobianFunctionIMEX_Linear"
 

Functions

PetscErrorCode PetscIJacobianIMEX (TS ts, PetscReal t, Vec Y, Vec Ydot, PetscReal a, Mat A, Mat B, void *ctxt)
 
PetscErrorCode PetscJacobianFunctionIMEX_JFNK (Mat Jacobian, Vec Y, Vec F)
 
PetscErrorCode PetscJacobianFunctionIMEX_Linear (Mat Jacobian, Vec Y, Vec F)
 

Detailed Description

Contains the functions required for Jacobian computations for IMEX time-integration.

Author
Debojyoti Ghosh

Definition in file PetscIJacobianIMEX.cpp.

Macro Definition Documentation

#define __FUNCT__   "PetscIJacobianIMEX"

Definition at line 237 of file PetscIJacobianIMEX.cpp.

#define __FUNCT__   "PetscJacobianFunctionIMEX_JFNK"

Definition at line 237 of file PetscIJacobianIMEX.cpp.

#define __FUNCT__   "PetscJacobianFunctionIMEX_Linear"

Definition at line 237 of file PetscIJacobianIMEX.cpp.

Function Documentation

PetscErrorCode PetscIJacobianIMEX ( TS  ts,
PetscReal  t,
Vec  Y,
Vec  Ydot,
PetscReal  a,
Mat  A,
Mat  B,
void *  ctxt 
)

Compute the Jacobian for implicit-explicit (IMEX) 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 F}\left({\bf U}\right) + {\bf G}\left({\bf U}\right) \Rightarrow \dot{\bf U} - {\bf G}\left({\bf U}\right) = {\bf F}\left({\bf U}\right), \end{equation}

where \({\bf F}\) is the spatially discretized non-stiff right-hand-side (treated explicitly), \({\bf G}\) is the spatially discretized stiff right-hand-side (treated implicitly), and \({\bf U}\) represents the entire solution vector. The Jacobian of the implicit part is thus given by:

\begin{equation} {\bf J} = \left[\alpha{\bf I} - \frac {\partial {\bf G}} {\partial {\bf U}} \right] \end{equation}

where \(\alpha\) is the shift coefficient (PETScContext::shift) of the time integration method.

Note that \({\bf G}\left({\bf U}\right)\) represents all terms that the user has indicated to be integrated in time implicitly (PETScContext::flag_hyperbolic_f, PETScContext::flag_hyperbolic_df, PETScContext::flag_hyperbolic, PETScContext::flag_parabolic, and PETScContext::flag_source).

Matrix-free representation: The Jacobian is computed using a matrix-free approach, where the entire Jacobian is never assembled, computed, or stored. Instead, the action of the Jacobian on a vector is defined through functions (PetscJacobianFunctionIMEX_JFNK() for nonlinear systems, and PetscJacobianFunctionIMEX_Linear() for linear systems). This approach works well with iterative solvers. Thus, this function just does the following:

See Also
PetscIFunctionIMEX()

Notes:

Parameters
tsTime stepping object (see PETSc TS)
tCurrent time
YSolution vector
YdotTime-derivative of solution vector
aShift
AJacobian matrix
BPreconditioning matrix
ctxtApplication context

Definition at line 61 of file PetscIJacobianIMEX.cpp.

69 {
70  PETScContext* context = (PETScContext*) ctxt;
71 
72  PetscFunctionBegin;
73  for (int ns = 0; ns < context->nsims; ns++) {
74  ((SimulationObject*)context->simobj)[ns].solver.count_IJacobian++;
75  }
76  context->shift = a;
77  context->waqt = t;
78  /* Construct preconditioning matrix */
79  if (context->flag_use_precon) PetscComputePreconMatIMEX(B,Y,context);
80 
81  PetscFunctionReturn(0);
82 }
int PetscComputePreconMatIMEX(Mat, Vec, void *)
Structure containing the variables for time-integration with PETSc.
Structure defining a simulation.
PetscErrorCode PetscJacobianFunctionIMEX_JFNK ( Mat  Jacobian,
Vec  Y,
Vec  F 
)

Computes the action of the Jacobian on a vector: See documentation for PetscIJacobianIMEX() for the definition of the Jacobian. This function computes its action on a vector for a nonlinear system by taking the directional derivative, as follows:

\begin{equation} {\bf f} = {\bf J}\left({\bf U}_0\right){\bf y} = \frac {\partial \mathcal{F}\left({\bf U}\right)} {\partial {\bf U}}\left({\bf U}_0\right) {\bf y} \approx \frac{1}{\epsilon} \left[ \mathcal{F}\left({\bf U}_0+\epsilon{\bf y}\right)-\mathcal{F}\left({\bf U}_0\right) \right] \end{equation}

In the context of the implicit-explicit (IMEX) time integration of the ODE given by

\begin{equation} \frac {d {\bf U}} {dt} = {\bf F}\left({\bf U}\right) + {\bf G}\left({\bf U}\right) \Rightarrow \frac {d {\bf U}} {dt} - {\bf G}\left({\bf U}\right) = {\bf F}\left({\bf U}\right), \end{equation}

where \({\bf F}\) is the spatially discretized non-stiff right-hand-side (treated explicitly), \({\bf G}\) is the spatially discretized stiff right-hand-side (treated implicitly), we have that

\begin{equation} \mathcal{F}\left({\bf U}\right) \equiv \dot{\bf U} - {\bf G}\left({\bf U}\right) \Rightarrow {\bf J}\left({\bf U}\right) = \left[\alpha{\bf I} - \frac {\partial {\bf G}\left({\bf U}\right)} {\partial {\bf U}} \right]. \end{equation}

where \(\alpha\) (PETScContext::shift) is the shift variable specific to the time integration method. So this function computes

\begin{equation} {\bf f} = \alpha {\bf y} - \frac{1}{\epsilon} \left[ {\bf G}\left({\bf U}_0+\epsilon{\bf y}\right)-{\bf G}\left({\bf U}_0\right) \right] \end{equation}

In the code, \({\bf y}\) is Y, \(\bf f\) is F, and \({\bf U}_0\) is HyPar::uref (the reference solution at which the nonlinear Jacobian is computed). See papers on Jacobian-free Newton-Krylov (JFNK) methods to understand how \(\epsilon\) is computed.

Note that \({\bf G}\left({\bf U}\right)\) represents all terms that the user has indicated to be integrated in time implicitly (PETScContext::flag_hyperbolic_f, PETScContext::flag_hyperbolic_df, PETScContext::flag_hyperbolic, PETScContext::flag_parabolic, and PETScContext::flag_source).

Notes:

  • For a nonlinear spatial discretization, the right-hand-side must be computed without the nonlinearity (i.e. with a previously computed or "frozen" discretization operator). This ensures that the Jacobian being computed is consistent.
  • It is assumed that the reader is familiar with PETSc's implementation of IMEX time integrators, for example, TSARKIMEX (https://petsc.org/release/docs/manualpages/TS/TSARKIMEX.html).
  • See https://petsc.org/release/docs/manualpages/TS/index.html for documentation on PETSc's time integrators.
  • 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.
Parameters
JacobianJacobian matrix
YInput vector
FOutput vector (Jacobian times input vector

Definition at line 128 of file PetscIJacobianIMEX.cpp.

131 {
132  PETScContext* context(nullptr);
133 
134  PetscFunctionBegin;
135 
136  MatShellGetContext(Jacobian,&context);
137  SimulationObject* sim = (SimulationObject*) context->simobj;
138  int nsims = context->nsims;
139 
140  double normY;
141  VecNorm(Y,NORM_2,&normY);
142 
143  if (normY < 1e-16) {
144 
145  /* F = 0 */
146  VecZeroEntries(F);
147  /* [J]Y = aY - F(Y) */
148  VecAXPBY(F,context->shift,0,Y);
149 
150  } else {
151 
152  double epsilon = context->jfnk_eps / normY;
153  double t = context->waqt; /* current stage/step time */
154 
155  for (int ns = 0; ns < nsims; ns++) {
156 
157  HyPar* solver = &(sim[ns].solver);
158  MPIVariables* mpi = &(sim[ns].mpi);
159  solver->count_IJacFunction++;
160 
161  int size = solver->npoints_local_wghosts;
162 
163  double *u = solver->u;
164  double *uref = solver->uref;
165  double *rhsref = solver->rhsref;
166  double *rhs = solver->rhs;
167 
168  /* copy solution from PETSc vector */
169  TransferVecFromPETSc(u,Y,context,ns,context->offsets[ns]);
170  _ArrayAYPX_(uref,epsilon,u,size*solver->nvars);
171  /* apply boundary conditions and exchange data over MPI interfaces */
172  solver->ApplyBoundaryConditions(solver,mpi,u,NULL,t);
174  solver->nvars,
175  solver->dim_local,
176  solver->ghosts,
177  mpi,
178  u );
179 
180  /* Evaluate hyperbolic, parabolic and source terms and the RHS for U+dU */
181  _ArraySetValue_(rhs,size*solver->nvars,0.0);
182  if ((!strcmp(solver->SplitHyperbolicFlux,"yes")) && solver->flag_fdf_specified) {
183  if (context->flag_hyperbolic_f == _IMPLICIT_) {
184  solver->HyperbolicFunction( solver->hyp,u,solver,mpi,t,0,
185  solver->FdFFunction,solver->UpwindFdF);
186  _ArrayAXPY_(solver->hyp,-1.0,rhs,size*solver->nvars);
187  }
188  if (context->flag_hyperbolic_df == _IMPLICIT_) {
189  solver->HyperbolicFunction( solver->hyp,u,solver,mpi,t,0,
190  solver->dFFunction,solver->UpwinddF);
191  _ArrayAXPY_(solver->hyp,-1.0,rhs,size*solver->nvars);
192  }
193  } else if (!strcmp(solver->SplitHyperbolicFlux,"yes")) {
194  if (context->flag_hyperbolic_f == _IMPLICIT_) {
195  solver->HyperbolicFunction( solver->hyp,u,solver,mpi,t,0,
196  solver->FFunction,solver->Upwind);
197  _ArrayAXPY_(solver->hyp,-1.0,rhs,size*solver->nvars);
198  solver->HyperbolicFunction( solver->hyp,u,solver,mpi,t,0,
199  solver->dFFunction,solver->UpwinddF);
200  _ArrayAXPY_(solver->hyp, 1.0,rhs,size*solver->nvars);
201  }
202  if (context->flag_hyperbolic_df == _IMPLICIT_) {
203  solver->HyperbolicFunction( solver->hyp,u,solver,mpi,t,0,
204  solver->dFFunction,solver->UpwinddF);
205  _ArrayAXPY_(solver->hyp,-1.0,rhs,size*solver->nvars);
206  }
207  } else {
208  if (context->flag_hyperbolic == _IMPLICIT_) {
209  solver->HyperbolicFunction( solver->hyp,u,solver,mpi,t,0,
210  solver->FFunction,solver->Upwind);
211  _ArrayAXPY_(solver->hyp,-1.0,rhs,size*solver->nvars);
212  }
213  }
214  if (context->flag_parabolic == _IMPLICIT_) {
215  solver->ParabolicFunction (solver->par,u,solver,mpi,t);
216  _ArrayAXPY_(solver->par, 1.0,rhs,size*solver->nvars);
217  }
218  if (context->flag_source == _IMPLICIT_) {
219  solver->SourceFunction (solver->source,u,solver,mpi,t);
220  _ArrayAXPY_(solver->source, 1.0,rhs,size*solver->nvars);
221  }
222 
223  _ArrayAXPY_(rhsref,-1.0,rhs,size*solver->nvars);
224  /* Transfer RHS to PETSc vector */
225  TransferVecToPETSc(rhs,F,context,ns,context->offsets[ns]);
226  }
227 
228  /* [J]Y = aY - F(Y) */
229  VecAXPBY(F,context->shift,(-1.0/epsilon),Y);
230 
231  }
232 
233  PetscFunctionReturn(0);
234 }
double * hyp
Definition: hypar.h:119
int npoints_local_wghosts
Definition: hypar.h:42
#define _ArraySetValue_(x, size, value)
int(* dFFunction)(double *, double *, int, void *, double)
Definition: hypar.h:280
double * u
Definition: hypar.h:116
int TransferVecFromPETSc(double *const, const Vec, void *, const int, const int)
int(* Upwind)(double *, double *, double *, double *, double *, double *, int, void *, double)
Definition: hypar.h:295
int flag_fdf_specified
Definition: hypar.h:290
int(* UpwinddF)(double *, double *, double *, double *, double *, double *, int, void *, double)
Definition: hypar.h:300
int * dim_local
Definition: hypar.h:37
int(* UpwindFdF)(double *, double *, double *, double *, double *, double *, int, void *, double)
Definition: hypar.h:307
int(* FdFFunction)(double *, double *, int, void *, double)
Definition: hypar.h:286
int(* FFunction)(double *, double *, int, void *, double)
Definition: hypar.h:276
int(* ParabolicFunction)(double *, double *, void *, void *, double)
Definition: hypar.h:256
int ghosts
Definition: hypar.h:52
#define _IMPLICIT_
double * par
Definition: hypar.h:122
double * source
Definition: hypar.h:125
int(* SourceFunction)(double *, double *, void *, void *, double)
Definition: hypar.h:259
double * rhsref
Definition: hypar.h:398
int TransferVecToPETSc(const double *const, Vec, void *, const int, const int)
double * uref
Definition: hypar.h:397
int(* HyperbolicFunction)(double *, double *, void *, void *, double, int, int(*)(double *, double *, int, void *, double), int(*)(double *, double *, double *, double *, double *, double *, int, void *, double))
Definition: hypar.h:250
int count_IJacFunction
Definition: hypar.h:422
int nvars
Definition: hypar.h:29
Structure containing the variables for time-integration with PETSc.
#define _ArrayAYPX_(x, a, y, size)
Structure defining a simulation.
char SplitHyperbolicFlux[_MAX_STRING_SIZE_]
Definition: hypar.h:92
int ndims
Definition: hypar.h:26
int(* ApplyBoundaryConditions)(void *, void *, double *, double *, double)
Definition: hypar.h:214
int MPIExchangeBoundariesnD(int, int, int *, int, void *, double *)
Structure of MPI-related variables.
#define _ArrayAXPY_(x, a, y, size)
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
double * rhs
Definition: hypar.h:399
PetscErrorCode PetscJacobianFunctionIMEX_Linear ( Mat  Jacobian,
Vec  Y,
Vec  F 
)

Computes the action of the Jacobian on a vector: See documentation for PetscIJacobianIMEX() for the definition of the Jacobian. This function computes its action on a vector for a linear system by taking the directional derivative, as follows:

\begin{equation} {\bf f} = {\bf J}{\bf y} = \frac {\partial \mathcal{F}\left({\bf U}\right)} {\partial {\bf U}} {\bf y} = \left[ \mathcal{F}\left({\bf U}_0+{\bf y}\right)-\mathcal{F}\left({\bf U}_0\right) \right], \end{equation}

where \(\mathcal{F}\) is linear, and thus \({\bf J}\) is a constant ( \(\mathcal{F}\left({\bf y}\right) = {\bf J}{\bf y}\)). In the context of the implicit-explicit (IMEX) time integration of the ODE given by

\begin{equation} \frac {d {\bf U}} {dt} = {\bf F}\left({\bf U}\right) + {\bf G}\left({\bf U}\right) \Rightarrow \frac {d {\bf U}} {dt} - {\bf G}\left({\bf U}\right) = {\bf F}\left({\bf U}\right), \end{equation}

where \({\bf F}\) is the spatially discretized non-stiff right-hand-side (treated explicitly), \({\bf G}\) is the spatially discretized stiff right-hand-side (treated implicitly) and is linear, we have that

\begin{equation} \mathcal{F}\left({\bf U}\right) \equiv \dot{\bf U} - {\bf G}\left({\bf U}\right) \Rightarrow {\bf J}\left({\bf U}\right) = \left[\alpha{\bf I} - \frac {\partial {\bf G}\left({\bf U}\right)} {\partial {\bf U}} \right]. \end{equation}

where \(\alpha\) (PETScContext::shift) is the shift variable specific to the time integration method. So this function computes

\begin{equation} {\bf f} = \alpha {\bf y} - \left[ {\bf G}\left({\bf U}_0+{\bf y}\right)-{\bf G}\left({\bf U}_0\right) \right] \end{equation}

In the code, \({\bf y}\) is Y, \(\bf f\) is F, and \({\bf U}_0\) is HyPar::uref (the reference solution at which the nonlinear Jacobian is computed).

Since \(\mathcal{F}\) is linear,

\begin{equation} {\bf J}{\bf y} = \left[ \mathcal{F}\left({\bf U}_0+{\bf y}\right)-\mathcal{F}\left({\bf U}_0\right) \right] = \mathcal{F}\left({\bf y}\right). \end{equation}

However, the Jacobian is not computed as \(\mathcal{F}\left({\bf y}\right)\) because of the following reason: this function is used by the equation solver within the implicit time integrator in PETSc, and \({\bf y}\) represents the change in the solution, i.e. \(\Delta {\bf U}\), and not the solution \(\bf U\). Thus, evaluating \(\mathcal{F}\left({\bf y}\right)\) using HyPar::HyperbolicFunction, HyPar::ParabolicFunction, and HyPar::SourceFunction is incorrect since these functions expect \(\bf U\) as the input.

Note that \({\bf G}\left({\bf U}\right)\) represents all terms that the user has indicated to be integrated in time implicitly (PETScContext::flag_hyperbolic_f, PETScContext::flag_hyperbolic_df, PETScContext::flag_hyperbolic, PETScContext::flag_parabolic, and PETScContext::flag_source).

Notes:

  • For a nonlinear spatial discretization, the right-hand-side must be computed without the nonlinearity (i.e. with a previously computed or "frozen" discretization operator). This ensures that the Jacobian being computed is consistent, and is truly linear.
  • See https://petsc.org/release/docs/manualpages/TS/index.html for documentation on PETSc's time integrators.
  • 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.
Parameters
JacobianJacobian matrix
YInput vector
FOutput vector (Jacobian times input vector

Definition at line 290 of file PetscIJacobianIMEX.cpp.

294 {
295  PETScContext* context(nullptr);
296 
297  PetscFunctionBegin;
298 
299  MatShellGetContext(Jacobian,&context);
300  SimulationObject* sim = (SimulationObject*) context->simobj;
301  int nsims = context->nsims;
302 
303  double normY;
304  VecNorm(Y,NORM_2,&normY);
305 
306  if (normY < 1e-16) {
307 
308  /* F = 0 */
309  VecZeroEntries(F);
310  /* [J]Y = aY - F(Y) */
311  VecAXPBY(F,context->shift,0,Y);
312 
313  } else {
314 
315  double t = context->waqt; /* current stage/step time */
316 
317  for (int ns = 0; ns < nsims; ns++) {
318 
319  HyPar* solver = &(sim[ns].solver);
320  MPIVariables* mpi = &(sim[ns].mpi);
321  solver->count_IJacFunction++;
322 
323  int size = solver->npoints_local_wghosts;
324 
325  double *u = solver->u;
326  double *uref = solver->uref;
327  double *rhsref = solver->rhsref;
328  double *rhs = solver->rhs;
329 
330  /* copy solution from PETSc vector */
331  TransferVecFromPETSc(u,Y,context,ns,context->offsets[ns]);
332  _ArrayAYPX_(uref,1.0,u,size*solver->nvars);
333  /* apply boundary conditions and exchange data over MPI interfaces */
334  solver->ApplyBoundaryConditions(solver,mpi,u,NULL,t);
336  solver->nvars,
337  solver->dim_local,
338  solver->ghosts,
339  mpi,
340  u );
341 
342  /* Evaluate hyperbolic, parabolic and source terms and the RHS for U+dU */
343  _ArraySetValue_(rhs,size*solver->nvars,0.0);
344  if ((!strcmp(solver->SplitHyperbolicFlux,"yes")) && solver->flag_fdf_specified) {
345  if (context->flag_hyperbolic_f == _IMPLICIT_) {
346  solver->HyperbolicFunction( solver->hyp,u,solver,mpi,t,0,
347  solver->FdFFunction,solver->UpwindFdF);
348  _ArrayAXPY_(solver->hyp,-1.0,rhs,size*solver->nvars);
349  }
350  if (context->flag_hyperbolic_df == _IMPLICIT_) {
351  solver->HyperbolicFunction( solver->hyp,u,solver,mpi,t,0,
352  solver->dFFunction,solver->UpwinddF);
353  _ArrayAXPY_(solver->hyp,-1.0,rhs,size*solver->nvars);
354  }
355  } else if (!strcmp(solver->SplitHyperbolicFlux,"yes")) {
356  if (context->flag_hyperbolic_f == _IMPLICIT_) {
357  solver->HyperbolicFunction( solver->hyp,u,solver,mpi,t,0,
358  solver->FFunction,solver->Upwind);
359  _ArrayAXPY_(solver->hyp,-1.0,rhs,size*solver->nvars);
360  solver->HyperbolicFunction( solver->hyp,u,solver,mpi,t,0,
361  solver->dFFunction,solver->UpwinddF);
362  _ArrayAXPY_(solver->hyp, 1.0,rhs,size*solver->nvars);
363  }
364  if (context->flag_hyperbolic_df == _IMPLICIT_) {
365  solver->HyperbolicFunction( solver->hyp,u,solver,mpi,t,0,
366  solver->dFFunction,solver->UpwinddF);
367  _ArrayAXPY_(solver->hyp,-1.0,rhs,size*solver->nvars);
368  }
369  } else {
370  if (context->flag_hyperbolic == _IMPLICIT_) {
371  solver->HyperbolicFunction( solver->hyp,u,solver,mpi,t,0,
372  solver->FFunction,solver->Upwind);
373  _ArrayAXPY_(solver->hyp,-1.0,rhs,size*solver->nvars);
374  }
375  }
376  if (context->flag_parabolic == _IMPLICIT_) {
377  solver->ParabolicFunction (solver->par,u,solver,mpi,t);
378  _ArrayAXPY_(solver->par, 1.0,rhs,size*solver->nvars);
379  }
380  if (context->flag_source == _IMPLICIT_) {
381  solver->SourceFunction (solver->source,u,solver,mpi,t);
382  _ArrayAXPY_(solver->source, 1.0,rhs,size*solver->nvars);
383  }
384 
385  _ArrayAXPY_(rhsref,-1.0,rhs,size*solver->nvars);
386  /* Transfer RHS to PETSc vector */
387  TransferVecToPETSc(rhs,F,context,ns,context->offsets[ns]);
388  }
389 
390  /* [J]Y = aY - F(Y) */
391  VecAXPBY(F,context->shift,-1.0,Y);
392 
393  }
394 
395  PetscFunctionReturn(0);
396 }
double * hyp
Definition: hypar.h:119
int npoints_local_wghosts
Definition: hypar.h:42
#define _ArraySetValue_(x, size, value)
int(* dFFunction)(double *, double *, int, void *, double)
Definition: hypar.h:280
double * u
Definition: hypar.h:116
int TransferVecFromPETSc(double *const, const Vec, void *, const int, const int)
int(* Upwind)(double *, double *, double *, double *, double *, double *, int, void *, double)
Definition: hypar.h:295
int flag_fdf_specified
Definition: hypar.h:290
int(* UpwinddF)(double *, double *, double *, double *, double *, double *, int, void *, double)
Definition: hypar.h:300
int * dim_local
Definition: hypar.h:37
int(* UpwindFdF)(double *, double *, double *, double *, double *, double *, int, void *, double)
Definition: hypar.h:307
int(* FdFFunction)(double *, double *, int, void *, double)
Definition: hypar.h:286
int(* FFunction)(double *, double *, int, void *, double)
Definition: hypar.h:276
int(* ParabolicFunction)(double *, double *, void *, void *, double)
Definition: hypar.h:256
int ghosts
Definition: hypar.h:52
#define _IMPLICIT_
double * par
Definition: hypar.h:122
double * source
Definition: hypar.h:125
int(* SourceFunction)(double *, double *, void *, void *, double)
Definition: hypar.h:259
double * rhsref
Definition: hypar.h:398
int TransferVecToPETSc(const double *const, Vec, void *, const int, const int)
double * uref
Definition: hypar.h:397
int(* HyperbolicFunction)(double *, double *, void *, void *, double, int, int(*)(double *, double *, int, void *, double), int(*)(double *, double *, double *, double *, double *, double *, int, void *, double))
Definition: hypar.h:250
int count_IJacFunction
Definition: hypar.h:422
int nvars
Definition: hypar.h:29
Structure containing the variables for time-integration with PETSc.
#define _ArrayAYPX_(x, a, y, size)
Structure defining a simulation.
char SplitHyperbolicFlux[_MAX_STRING_SIZE_]
Definition: hypar.h:92
int ndims
Definition: hypar.h:26
int(* ApplyBoundaryConditions)(void *, void *, double *, double *, double)
Definition: hypar.h:214
int MPIExchangeBoundariesnD(int, int, int *, int, void *, double *)
Structure of MPI-related variables.
#define _ArrayAXPY_(x, a, y, size)
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
double * rhs
Definition: hypar.h:399