16 #define __FUNCT__ "PetscIJacobian" 64 for (
int ns = 0; ns < context->
nsims; ns++) {
72 PetscFunctionReturn(0);
76 #define __FUNCT__ "PetscJacobianFunction_JFNK" 120 MatShellGetContext(Jacobian,&context);
122 int nsims = context->
nsims;
125 VecNorm(Y,NORM_2,&normY);
132 VecAXPBY(F,context->
shift,0,Y);
136 double epsilon = context->
jfnk_eps / normY;
137 double t = context->
waqt;
139 for (
int ns = 0; ns < nsims; ns++) {
147 double *u = solver->
u;
148 double *uref = solver->
uref;
149 double *rhsref = solver->
rhsref;
150 double *rhs = solver->
rhs;
180 VecAXPBY(F,context->
shift,(-1.0/epsilon),Y);
184 PetscFunctionReturn(0);
188 #define __FUNCT__ "PetscJacobianFunction_Linear" 245 MatShellGetContext(Jacobian,&context);
247 int nsims = context->
nsims;
250 VecNorm(Y,NORM_2,&normY);
257 VecAXPBY(F,context->
shift,0,Y);
261 double t = context->
waqt;
263 for (
int ns = 0; ns < nsims; ns++) {
271 double *u = solver->
u;
272 double *uref = solver->
uref;
273 double *rhsref = solver->
rhsref;
274 double *rhs = solver->
rhs;
304 VecAXPBY(F,context->
shift,-1.0,Y);
308 PetscFunctionReturn(0);
int TransferVecToPETSc(const double *const, Vec, void *, const int, const int)
int(* ParabolicFunction)(double *, double *, void *, void *, double)
Structure defining a simulation.
C++ declarations for MPI-related functions.
int MPIExchangeBoundariesnD(int, int, int *, int, void *, double *)
int(* ApplyBoundaryConditions)(void *, void *, double *, double *, double)
Some basic definitions and macros.
#define _ArrayAYPX_(x, a, y, size)
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 PetscComputePreconMatImpl(Mat, Vec, void *)
int(* FFunction)(double *, double *, int, void *, double)
Structure containing all solver-specific variables and functions.
#define _ArrayAXPY_(x, a, y, size)
PetscErrorCode PetscJacobianFunction_JFNK(Mat Jacobian, Vec Y, Vec F)
Structure containing the variables for time-integration with PETSc.
#define _ArraySetValue_(x, size, value)
PetscErrorCode PetscIJacobian(TS ts, PetscReal t, Vec Y, Vec Ydot, PetscReal a, Mat A, Mat B, void *ctxt)
Structure of MPI-related variables.
int npoints_local_wghosts
Contains macros and function definitions for common array operations.
int TransferVecFromPETSc(double *const, const Vec, void *, const int, const int)
PetscErrorCode PetscJacobianFunction_Linear(Mat Jacobian, Vec Y, Vec F)