1 #if !defined(PETSCCEIMPL_H) 2 #define PETSCCEIMPL_H 3 4 #include <petscconvest.h> 5 #include <petsc/private/petscimpl.h> 6 7 typedef struct _PetscConvEstOps *PetscConvEstOps; 8 struct _PetscConvEstOps { 9 PetscErrorCode (*setfromoptions)(PetscConvEst); 10 PetscErrorCode (*setup)(PetscConvEst); 11 PetscErrorCode (*view)(PetscConvEst,PetscViewer); 12 PetscErrorCode (*destroy)(PetscConvEst); 13 PetscErrorCode (*setsolver)(PetscConvEst, PetscObject); 14 PetscErrorCode (*initguess)(PetscConvEst, PetscInt, DM, Vec); 15 PetscErrorCode (*computeerror)(PetscConvEst, PetscInt, DM, Vec, PetscReal[]); 16 PetscErrorCode (*getconvrate)(PetscConvEst, PetscReal[]); 17 }; 18 19 struct _p_PetscConvEst 20 { 21 PETSCHEADER(struct _PetscConvEstOps); 22 /* Inputs */ 23 DM idm; /* Initial grid */ 24 PetscObject solver; /* Solver */ 25 PetscReal r; /* The refinement factor (spatial check requires r = 2) */ 26 PetscInt Nr; /* The number of refinements */ 27 PetscInt Nf; /* The number of fields in the DM */ 28 PetscErrorCode (**initGuess)(PetscInt, PetscReal, const PetscReal[], PetscInt, PetscScalar[], void *); 29 PetscErrorCode (**exactSol)(PetscInt, PetscReal, const PetscReal[], PetscInt, PetscScalar[], void *); 30 void **ctxs; 31 /* Outputs */ 32 PetscLogEvent event; 33 PetscBool monitor; 34 PetscReal *errors; 35 }; 36 37 #endif 38