16 #define __FUNCT__ "PetscIJacobianIMEX" 73 for (
int ns = 0; ns < context->
nsims; ns++) {
81 PetscFunctionReturn(0);
85 #define __FUNCT__ "PetscJacobianFunctionIMEX_JFNK" 136 MatShellGetContext(Jacobian,&context);
138 int nsims = context->
nsims;
141 VecNorm(Y,NORM_2,&normY);
148 VecAXPBY(F,context->
shift,0,Y);
152 double epsilon = context->
jfnk_eps / normY;
153 double t = context->
waqt;
155 for (
int ns = 0; ns < nsims; ns++) {
163 double *u = solver->
u;
164 double *uref = solver->
uref;
165 double *rhsref = solver->
rhsref;
166 double *rhs = solver->
rhs;
229 VecAXPBY(F,context->
shift,(-1.0/epsilon),Y);
233 PetscFunctionReturn(0);
237 #define __FUNCT__ "PetscJacobianFunctionIMEX_Linear" 299 MatShellGetContext(Jacobian,&context);
301 int nsims = context->
nsims;
304 VecNorm(Y,NORM_2,&normY);
311 VecAXPBY(F,context->
shift,0,Y);
315 double t = context->
waqt;
317 for (
int ns = 0; ns < nsims; ns++) {
325 double *u = solver->
u;
326 double *uref = solver->
uref;
327 double *rhsref = solver->
rhsref;
328 double *rhs = solver->
rhs;
391 VecAXPBY(F,context->
shift,-1.0,Y);
395 PetscFunctionReturn(0);
int TransferVecToPETSc(const double *const, Vec, void *, const int, const int)
int(* ParabolicFunction)(double *, double *, void *, void *, double)
Structure defining a simulation.
char SplitHyperbolicFlux[_MAX_STRING_SIZE_]
C++ declarations for MPI-related functions.
PetscErrorCode PetscIJacobianIMEX(TS ts, PetscReal t, Vec Y, Vec Ydot, PetscReal a, Mat A, Mat B, void *ctxt)
int MPIExchangeBoundariesnD(int, int, int *, int, void *, double *)
int(* ApplyBoundaryConditions)(void *, void *, double *, double *, double)
int PetscComputePreconMatIMEX(Mat, Vec, void *)
Some basic definitions and macros.
#define _ArrayAYPX_(x, a, y, size)
int(* FdFFunction)(double *, double *, int, void *, double)
int(* Upwind)(double *, double *, double *, double *, double *, double *, int, void *, double)
int(* SourceFunction)(double *, double *, void *, void *, double)
int(* HyperbolicFunction)(double *, double *, void *, void *, double, int, int(*)(double *, double *, int, void *, double), int(*)(double *, double *, double *, double *, double *, double *, int, void *, double))
int(* FFunction)(double *, double *, int, void *, double)
Structure containing all solver-specific variables and functions.
#define _ArrayAXPY_(x, a, y, size)
int(* UpwindFdF)(double *, double *, double *, double *, double *, double *, int, void *, double)
Structure containing the variables for time-integration with PETSc.
#define _ArraySetValue_(x, size, value)
int(* dFFunction)(double *, double *, int, void *, double)
PetscErrorCode PetscJacobianFunctionIMEX_JFNK(Mat Jacobian, Vec Y, Vec F)
int(* UpwinddF)(double *, double *, double *, double *, double *, double *, int, void *, double)
Structure of MPI-related variables.
PetscErrorCode PetscJacobianFunctionIMEX_Linear(Mat Jacobian, Vec Y, Vec F)
int npoints_local_wghosts
Contains macros and function definitions for common array operations.
int TransferVecFromPETSc(double *const, const Vec, void *, const int, const int)