Actual source code: petscfv.h

  1: /*
  2:       Objects which encapsulate finite volume spaces and operations
  3: */
  4: #ifndef PETSCFV_H
  5: #define PETSCFV_H

  7: #include <petscdm.h>
  8: #include <petscdt.h>
  9: #include <petscfvtypes.h>
 10: #include <petscdstypes.h>

 12: /* SUBMANSEC = FV */

 14: PETSC_EXTERN PetscClassId PETSCLIMITER_CLASSID;

 16: /*J
 17:   PetscLimiterType - String with the name of a PETSc finite volume slope limiter

 19:   Level: beginner

 21: .seealso: `PetscLimiterSetType()`, `PetscLimiter`
 22: J*/
 23: typedef const char *PetscLimiterType;
 24: #define PETSCLIMITERSIN       "sin"
 25: #define PETSCLIMITERZERO      "zero"
 26: #define PETSCLIMITERNONE      "none"
 27: #define PETSCLIMITERMINMOD    "minmod"
 28: #define PETSCLIMITERVANLEER   "vanleer"
 29: #define PETSCLIMITERVANALBADA "vanalbada"
 30: #define PETSCLIMITERSUPERBEE  "superbee"
 31: #define PETSCLIMITERMC        "mc"

 33: PETSC_EXTERN PetscFunctionList PetscLimiterList;
 34: PETSC_EXTERN PetscErrorCode    PetscLimiterCreate(MPI_Comm, PetscLimiter *);
 35: PETSC_EXTERN PetscErrorCode    PetscLimiterDestroy(PetscLimiter *);
 36: PETSC_EXTERN PetscErrorCode    PetscLimiterSetType(PetscLimiter, PetscLimiterType);
 37: PETSC_EXTERN PetscErrorCode    PetscLimiterGetType(PetscLimiter, PetscLimiterType *);
 38: PETSC_EXTERN PetscErrorCode    PetscLimiterSetUp(PetscLimiter);
 39: PETSC_EXTERN PetscErrorCode    PetscLimiterSetFromOptions(PetscLimiter);
 40: PETSC_EXTERN PetscErrorCode    PetscLimiterViewFromOptions(PetscLimiter, PetscObject, const char[]);
 41: PETSC_EXTERN PetscErrorCode    PetscLimiterView(PetscLimiter, PetscViewer);
 42: PETSC_EXTERN PetscErrorCode    PetscLimiterRegister(const char[], PetscErrorCode (*)(PetscLimiter));
 43: PETSC_EXTERN PetscErrorCode    PetscLimiterRegisterDestroy(void);

 45: PETSC_EXTERN PetscErrorCode PetscLimiterLimit(PetscLimiter, PetscReal, PetscReal *);

 47: PETSC_EXTERN PetscErrorCode PetscFVInitializePackage(void);

 49: PETSC_EXTERN PetscClassId PETSCFV_CLASSID;

 51: /*J
 52:   PetscFVType - String with the name of a PETSc finite volume discretization

 54:   Level: beginner

 56: .seealso: `PetscFVSetType()`, `PetscFV`
 57: J*/
 58: typedef const char *PetscFVType;
 59: #define PETSCFVUPWIND       "upwind"
 60: #define PETSCFVLEASTSQUARES "leastsquares"

 62: PETSC_EXTERN PetscFunctionList PetscFVList;
 63: PETSC_EXTERN PetscErrorCode    PetscFVCreate(MPI_Comm, PetscFV *);
 64: PETSC_EXTERN PetscErrorCode    PetscFVDestroy(PetscFV *);
 65: PETSC_EXTERN PetscErrorCode    PetscFVSetType(PetscFV, PetscFVType);
 66: PETSC_EXTERN PetscErrorCode    PetscFVGetType(PetscFV, PetscFVType *);
 67: PETSC_EXTERN PetscErrorCode    PetscFVSetUp(PetscFV);
 68: PETSC_EXTERN PetscErrorCode    PetscFVSetFromOptions(PetscFV);
 69: PETSC_EXTERN PetscErrorCode    PetscFVViewFromOptions(PetscFV, PetscObject, const char[]);
 70: PETSC_EXTERN PetscErrorCode    PetscFVView(PetscFV, PetscViewer);
 71: PETSC_EXTERN PetscErrorCode    PetscFVRegister(const char[], PetscErrorCode (*)(PetscFV));
 72: PETSC_EXTERN PetscErrorCode    PetscFVRegisterDestroy(void);
 73: PETSC_EXTERN PetscErrorCode    PetscFVSetComponentName(PetscFV, PetscInt, const char[]);
 74: PETSC_EXTERN PetscErrorCode    PetscFVGetComponentName(PetscFV, PetscInt, const char *[]);

 76: PETSC_EXTERN PetscErrorCode PetscFVSetLimiter(PetscFV, PetscLimiter);
 77: PETSC_EXTERN PetscErrorCode PetscFVGetLimiter(PetscFV, PetscLimiter *);
 78: PETSC_EXTERN PetscErrorCode PetscFVSetNumComponents(PetscFV, PetscInt);
 79: PETSC_EXTERN PetscErrorCode PetscFVGetNumComponents(PetscFV, PetscInt *);
 80: PETSC_EXTERN PetscErrorCode PetscFVSetSpatialDimension(PetscFV, PetscInt);
 81: PETSC_EXTERN PetscErrorCode PetscFVGetSpatialDimension(PetscFV, PetscInt *);
 82: PETSC_EXTERN PetscErrorCode PetscFVSetComputeGradients(PetscFV, PetscBool);
 83: PETSC_EXTERN PetscErrorCode PetscFVGetComputeGradients(PetscFV, PetscBool *);
 84: PETSC_EXTERN PetscErrorCode PetscFVSetQuadrature(PetscFV, PetscQuadrature);
 85: PETSC_EXTERN PetscErrorCode PetscFVGetQuadrature(PetscFV, PetscQuadrature *);
 86: PETSC_EXTERN PetscErrorCode PetscFVSetDualSpace(PetscFV, PetscDualSpace);
 87: PETSC_EXTERN PetscErrorCode PetscFVGetDualSpace(PetscFV, PetscDualSpace *);

 89: PETSC_EXTERN PetscErrorCode PetscFVRefine(PetscFV, PetscFV *);

 91: PETSC_EXTERN PetscErrorCode PetscFVGetCellTabulation(PetscFV, PetscTabulation *);
 92: PETSC_EXTERN PetscErrorCode PetscFVCreateTabulation(PetscFV, PetscInt, PetscInt, const PetscReal[], PetscInt, PetscTabulation *);

 94: PETSC_EXTERN PetscErrorCode PetscFVComputeGradient(PetscFV, PetscInt, PetscScalar[], PetscScalar[]);
 95: PETSC_EXTERN PetscErrorCode PetscFVIntegrateRHSFunction(PetscFV, PetscDS, PetscInt, PetscInt, PetscFVFaceGeom *, PetscReal *, PetscScalar[], PetscScalar[], PetscScalar[], PetscScalar[]);

 97: PETSC_EXTERN PetscErrorCode PetscFVLeastSquaresSetMaxFaces(PetscFV, PetscInt);

 99: PETSC_EXTERN PetscErrorCode PetscDualSpaceApplyFVM(PetscDualSpace, PetscInt, PetscReal, PetscFVCellGeom *, PetscInt, PetscErrorCode (*)(PetscInt, PetscReal, const PetscReal[], PetscInt, PetscScalar *, void *), void *, PetscScalar *);

101: #endif