xref: /petsc/include/petscfv.h (revision 6d8694c4fbab79f9439f1ad13c0386ba7ee1ca4b)
1f62f30faSMatthew G. Knepley /*
2f62f30faSMatthew G. Knepley       Objects which encapsulate finite volume spaces and operations
3f62f30faSMatthew G. Knepley */
4a4963045SJacob Faibussowitsch #pragma once
5ac09b921SBarry Smith 
6f62f30faSMatthew G. Knepley #include <petscdm.h>
7f62f30faSMatthew G. Knepley #include <petscdt.h>
8660d4ad9SBarry Smith #include <petscspace.h>
9660d4ad9SBarry Smith #include <petscdualspace.h>
10f62f30faSMatthew G. Knepley #include <petscfvtypes.h>
11879707a1SMatthew G. Knepley #include <petscdstypes.h>
12f62f30faSMatthew G. Knepley 
13*ce78bad3SBarry Smith /* MANSEC = DM */
14ac09b921SBarry Smith /* SUBMANSEC = FV */
15ac09b921SBarry Smith 
16ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscClassId PETSCLIMITER_CLASSID;
17ab2453f0SMatthew G. Knepley 
18ab2453f0SMatthew G. Knepley /*J
19ab2453f0SMatthew G. Knepley   PetscLimiterType - String with the name of a PETSc finite volume slope limiter
20ab2453f0SMatthew G. Knepley 
21ab2453f0SMatthew G. Knepley   Level: beginner
22ab2453f0SMatthew G. Knepley 
23db781477SPatrick Sanan .seealso: `PetscLimiterSetType()`, `PetscLimiter`
24ab2453f0SMatthew G. Knepley J*/
25ab2453f0SMatthew G. Knepley typedef const char *PetscLimiterType;
26ab2453f0SMatthew G. Knepley #define PETSCLIMITERSIN       "sin"
279347ee04SMatthew G. Knepley #define PETSCLIMITERZERO      "zero"
289347ee04SMatthew G. Knepley #define PETSCLIMITERNONE      "none"
299347ee04SMatthew G. Knepley #define PETSCLIMITERMINMOD    "minmod"
309347ee04SMatthew G. Knepley #define PETSCLIMITERVANLEER   "vanleer"
319347ee04SMatthew G. Knepley #define PETSCLIMITERVANALBADA "vanalbada"
329347ee04SMatthew G. Knepley #define PETSCLIMITERSUPERBEE  "superbee"
339347ee04SMatthew G. Knepley #define PETSCLIMITERMC        "mc"
34ab2453f0SMatthew G. Knepley 
35ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscFunctionList PetscLimiterList;
36ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscLimiterCreate(MPI_Comm, PetscLimiter *);
37ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscLimiterDestroy(PetscLimiter *);
38ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscLimiterSetType(PetscLimiter, PetscLimiterType);
39ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscLimiterGetType(PetscLimiter, PetscLimiterType *);
40ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscLimiterSetUp(PetscLimiter);
41ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscLimiterSetFromOptions(PetscLimiter);
42fe2efc57SMark PETSC_EXTERN PetscErrorCode    PetscLimiterViewFromOptions(PetscLimiter, PetscObject, const char[]);
43ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscLimiterView(PetscLimiter, PetscViewer);
44ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscLimiterRegister(const char[], PetscErrorCode (*)(PetscLimiter));
45ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscLimiterRegisterDestroy(void);
46ab2453f0SMatthew G. Knepley 
471475bf87SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscLimiterLimit(PetscLimiter, PetscReal, PetscReal *);
48ab2453f0SMatthew G. Knepley 
49f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVInitializePackage(void);
504bf303faSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode PetscFVFinalizePackage(void);
51f62f30faSMatthew G. Knepley 
52f62f30faSMatthew G. Knepley PETSC_EXTERN PetscClassId PETSCFV_CLASSID;
53f62f30faSMatthew G. Knepley 
54f62f30faSMatthew G. Knepley /*J
55f62f30faSMatthew G. Knepley   PetscFVType - String with the name of a PETSc finite volume discretization
56f62f30faSMatthew G. Knepley 
57f62f30faSMatthew G. Knepley   Level: beginner
58f62f30faSMatthew G. Knepley 
59db781477SPatrick Sanan .seealso: `PetscFVSetType()`, `PetscFV`
60f62f30faSMatthew G. Knepley J*/
61f62f30faSMatthew G. Knepley typedef const char *PetscFVType;
62f62f30faSMatthew G. Knepley #define PETSCFVUPWIND       "upwind"
63f62f30faSMatthew G. Knepley #define PETSCFVLEASTSQUARES "leastsquares"
64f62f30faSMatthew G. Knepley 
65f62f30faSMatthew G. Knepley PETSC_EXTERN PetscFunctionList PetscFVList;
66f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscFVCreate(MPI_Comm, PetscFV *);
67f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscFVDestroy(PetscFV *);
68f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscFVSetType(PetscFV, PetscFVType);
69f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscFVGetType(PetscFV, PetscFVType *);
70f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscFVSetUp(PetscFV);
71f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscFVSetFromOptions(PetscFV);
72fe2efc57SMark PETSC_EXTERN PetscErrorCode    PetscFVViewFromOptions(PetscFV, PetscObject, const char[]);
73f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscFVView(PetscFV, PetscViewer);
74f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscFVRegister(const char[], PetscErrorCode (*)(PetscFV));
75f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode    PetscFVRegisterDestroy(void);
76a00cdb45SToby Isaac PETSC_EXTERN PetscErrorCode    PetscFVSetComponentName(PetscFV, PetscInt, const char[]);
77a00cdb45SToby Isaac PETSC_EXTERN PetscErrorCode    PetscFVGetComponentName(PetscFV, PetscInt, const char *[]);
78f62f30faSMatthew G. Knepley 
79ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetLimiter(PetscFV, PetscLimiter);
80ab2453f0SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetLimiter(PetscFV, PetscLimiter *);
81f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetNumComponents(PetscFV, PetscInt);
82f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetNumComponents(PetscFV, PetscInt *);
83f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetSpatialDimension(PetscFV, PetscInt);
84f62f30faSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetSpatialDimension(PetscFV, PetscInt *);
85eb4d80e8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetComputeGradients(PetscFV, PetscBool);
86eb4d80e8SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetComputeGradients(PetscFV, PetscBool *);
87ce379721SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetQuadrature(PetscFV, PetscQuadrature);
88ce379721SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetQuadrature(PetscFV, PetscQuadrature *);
89dd0f9b09SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVSetDualSpace(PetscFV, PetscDualSpace);
90dd0f9b09SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetDualSpace(PetscFV, PetscDualSpace *);
912f86f8c5SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVCreateDualSpace(PetscFV, DMPolytopeType);
92f62f30faSMatthew G. Knepley 
93f6feae9bSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVClone(PetscFV, PetscFV *);
94a48af489SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVRefine(PetscFV, PetscFV *);
95a48af489SMatthew G. Knepley 
96ef0bb6c7SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVGetCellTabulation(PetscFV, PetscTabulation *);
97ef0bb6c7SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVCreateTabulation(PetscFV, PetscInt, PetscInt, const PetscReal[], PetscInt, PetscTabulation *);
986c1a3d01SMatthew G. Knepley 
99c5148223SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVComputeGradient(PetscFV, PetscInt, PetscScalar[], PetscScalar[]);
100879707a1SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVIntegrateRHSFunction(PetscFV, PetscDS, PetscInt, PetscInt, PetscFVFaceGeom *, PetscReal *, PetscScalar[], PetscScalar[], PetscScalar[], PetscScalar[]);
101f62f30faSMatthew G. Knepley 
102c5148223SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscFVLeastSquaresSetMaxFaces(PetscFV, PetscInt);
103c5148223SMatthew G. Knepley 
104af092e56SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscDualSpaceApplyFVM(PetscDualSpace, PetscInt, PetscReal, PetscFVCellGeom *, PetscInt, PetscErrorCode (*)(PetscInt, PetscReal, const PetscReal[], PetscInt, PetscScalar *, void *), void *, PetscScalar *);
105