1f62f30faSMatthew G. Knepley /* 2f62f30faSMatthew G. Knepley Objects which encapsulate finite volume spaces and operations 3f62f30faSMatthew G. Knepley */ 4f62f30faSMatthew G. Knepley #if !defined(__PETSCFV_H) 5f62f30faSMatthew G. Knepley #define __PETSCFV_H 6f62f30faSMatthew G. Knepley #include <petscdm.h> 7f62f30faSMatthew G. Knepley #include <petscdt.h> 8f62f30faSMatthew G. Knepley #include <petscfvtypes.h> 9879707a1SMatthew G. Knepley #include <petscdstypes.h> 10f62f30faSMatthew G. Knepley 11ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscClassId PETSCLIMITER_CLASSID; 12ab2453f0SMatthew G. Knepley 13ab2453f0SMatthew G. Knepley /*J 14ab2453f0SMatthew G. Knepley PetscLimiterType - String with the name of a PETSc finite volume slope limiter 15ab2453f0SMatthew G. Knepley 16ab2453f0SMatthew G. Knepley Level: beginner 17ab2453f0SMatthew G. Knepley 18ab2453f0SMatthew G. Knepley .seealso: PetscLimiterSetType(), PetscLimiter 19ab2453f0SMatthew G. Knepley J*/ 20ab2453f0SMatthew G. Knepley typedef const char *PetscLimiterType; 21ab2453f0SMatthew G. Knepley #define PETSCLIMITERSIN "sin" 229347ee04SMatthew G. Knepley #define PETSCLIMITERZERO "zero" 239347ee04SMatthew G. Knepley #define PETSCLIMITERNONE "none" 249347ee04SMatthew G. Knepley #define PETSCLIMITERMINMOD "minmod" 259347ee04SMatthew G. Knepley #define PETSCLIMITERVANLEER "vanleer" 269347ee04SMatthew G. Knepley #define PETSCLIMITERVANALBADA "vanalbada" 279347ee04SMatthew G. Knepley #define PETSCLIMITERSUPERBEE "superbee" 289347ee04SMatthew G. Knepley #define PETSCLIMITERMC "mc" 29ab2453f0SMatthew G. Knepley 30ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscFunctionList PetscLimiterList; 31ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscLimiterCreate(MPI_Comm, PetscLimiter *); 32ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscLimiterDestroy(PetscLimiter *); 33ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscLimiterSetType(PetscLimiter, PetscLimiterType); 34ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscLimiterGetType(PetscLimiter, PetscLimiterType *); 35ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscLimiterSetUp(PetscLimiter); 36ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscLimiterSetFromOptions(PetscLimiter); 378aec7d55SBarry Smith PETSC_STATIC_INLINE PetscErrorCode PetscLimiterViewFromOptions(PetscLimiter A,PetscObject B,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,B,name);} 38ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscLimiterView(PetscLimiter, PetscViewer); 39ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscLimiterRegister(const char [], PetscErrorCode (*)(PetscLimiter)); 40ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscLimiterRegisterDestroy(void); 41ab2453f0SMatthew G. Knepley 421475bf87SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscLimiterLimit(PetscLimiter, PetscReal, PetscReal *); 43ab2453f0SMatthew G. Knepley 44ab2453f0SMatthew G. Knepley 45f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVInitializePackage(void); 46f62f30faSMatthew G. Knepley 47f62f30faSMatthew G. Knepley PETSC_EXTERN PetscClassId PETSCFV_CLASSID; 48f62f30faSMatthew G. Knepley 49f62f30faSMatthew G. Knepley /*J 50f62f30faSMatthew G. Knepley PetscFVType - String with the name of a PETSc finite volume discretization 51f62f30faSMatthew G. Knepley 52f62f30faSMatthew G. Knepley Level: beginner 53f62f30faSMatthew G. Knepley 54f62f30faSMatthew G. Knepley .seealso: PetscFVSetType(), PetscFV 55f62f30faSMatthew G. Knepley J*/ 56f62f30faSMatthew G. Knepley typedef const char *PetscFVType; 57f62f30faSMatthew G. Knepley #define PETSCFVUPWIND "upwind" 58f62f30faSMatthew G. Knepley #define PETSCFVLEASTSQUARES "leastsquares" 59f62f30faSMatthew G. Knepley 60f62f30faSMatthew G. Knepley PETSC_EXTERN PetscFunctionList PetscFVList; 61f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVCreate(MPI_Comm, PetscFV *); 62f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVDestroy(PetscFV *); 63f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetType(PetscFV, PetscFVType); 64f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetType(PetscFV, PetscFVType *); 65f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetUp(PetscFV); 66f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetFromOptions(PetscFV); 678aec7d55SBarry Smith PETSC_STATIC_INLINE PetscErrorCode PetscFVViewFromOptions(PetscFV A,PetscObject B,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,B,name);} 68f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVView(PetscFV, PetscViewer); 69f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVRegister(const char [], PetscErrorCode (*)(PetscFV)); 70f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVRegisterDestroy(void); 71*a00cdb45SToby Isaac PETSC_EXTERN PetscErrorCode PetscFVSetComponentName(PetscFV, PetscInt, const char []); 72*a00cdb45SToby Isaac PETSC_EXTERN PetscErrorCode PetscFVGetComponentName(PetscFV, PetscInt, const char *[]); 73f62f30faSMatthew G. Knepley 74ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetLimiter(PetscFV, PetscLimiter); 75ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetLimiter(PetscFV, PetscLimiter *); 76f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetNumComponents(PetscFV, PetscInt); 77f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetNumComponents(PetscFV, PetscInt *); 78f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetSpatialDimension(PetscFV, PetscInt); 79f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetSpatialDimension(PetscFV, PetscInt *); 80eb4d80e8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetComputeGradients(PetscFV, PetscBool); 81eb4d80e8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetComputeGradients(PetscFV, PetscBool *); 82ce379721SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetQuadrature(PetscFV, PetscQuadrature); 83ce379721SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetQuadrature(PetscFV, PetscQuadrature *); 84dd0f9b09SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetDualSpace(PetscFV, PetscDualSpace); 85dd0f9b09SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetDualSpace(PetscFV, PetscDualSpace *); 86f62f30faSMatthew G. Knepley 87a48af489SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVRefine(PetscFV, PetscFV *); 88a48af489SMatthew G. Knepley 896c1a3d01SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetDefaultTabulation(PetscFV, PetscReal **, PetscReal **, PetscReal **); 906c1a3d01SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetTabulation(PetscFV, PetscInt, const PetscReal[], PetscReal **, PetscReal **, PetscReal **); 916c1a3d01SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVRestoreTabulation(PetscFV, PetscInt, const PetscReal[], PetscReal **, PetscReal **, PetscReal **); 926c1a3d01SMatthew G. Knepley 93c5148223SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVComputeGradient(PetscFV, PetscInt, PetscScalar[], PetscScalar[]); 94879707a1SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVIntegrateRHSFunction(PetscFV, PetscDS, PetscInt, PetscInt, PetscFVFaceGeom *, PetscReal *, PetscScalar[], PetscScalar[], PetscScalar[], PetscScalar[]); 95f62f30faSMatthew G. Knepley 96c5148223SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVLeastSquaresSetMaxFaces(PetscFV, PetscInt); 97c5148223SMatthew G. Knepley 98f62f30faSMatthew G. Knepley #endif 99