1 #ifndef ABLATELIBRARY_CELLINTERPOLANT_HPP
2 #define ABLATELIBRARY_CELLINTERPOLANT_HPP
6 #include "domain/range.hpp"
7 #include "domain/region.hpp"
8 #include "domain/subDomain.hpp"
9 namespace ablate::finiteVolume {
16 using DiscontinuousFluxFunction = PetscErrorCode (*)(PetscInt dim,
const PetscFVFaceGeom* fg,
const PetscInt uOff[],
const PetscScalar fieldL[],
const PetscScalar fieldR[],
const PetscInt aOff[],
17 const PetscScalar auxL[],
const PetscScalar auxR[], PetscScalar flux[],
void* ctx);
22 using PointFunction = PetscErrorCode (*)(PetscInt dim, PetscReal time,
const PetscFVCellGeom* cg,
const PetscInt uOff[],
const PetscScalar u[],
const PetscInt aOff[],
const PetscScalar a[],
23 PetscScalar f[],
void* ctx);
30 std::vector<PetscInt> inputFields;
31 std::vector<PetscInt> auxFields;
41 std::vector<PetscInt> fields;
42 std::vector<PetscInt> inputFields;
43 std::vector<PetscInt> auxFields;
48 std::shared_ptr<ablate::domain::SubDomain> subDomain;
51 std::vector<DM> gradientCellDms;
56 void ComputeFluxSourceTerms(DM dm, PetscDS ds, PetscInt totDim,
const PetscScalar* xArray, DM dmAux, PetscDS dsAux, PetscInt totDimAux,
const PetscScalar* auxArray, DM faceDM,
57 const PetscScalar* faceGeomArray, DM cellDM,
const PetscScalar* cellGeomArray, std::vector<DM>& dmGrads, std::vector<const PetscScalar*>& locGradArrays,
58 PetscScalar* locFArray,
const std::shared_ptr<domain::Region>& solverRegion, std::vector<CellInterpolant::DiscontinuousFluxFunctionDescription>& rhsFunctions,
64 void ProjectToFace(
const std::vector<domain::Field>& fields, PetscDS ds,
const PetscFVFaceGeom& faceGeom, PetscInt cellId,
const PetscFVCellGeom& cellGeom, DM dm,
const PetscScalar* xArray,
65 const std::vector<DM>& dmGrads,
const std::vector<const PetscScalar*>& gradArrays, PetscScalar* u, PetscScalar* grad,
bool projectField =
true);
78 void ComputeFieldGradients(
const domain::Field& field, Vec xLocalVec, Vec& gradLocVec, DM& dmGrad, Vec cellGeomVec, Vec faceGeomVec,
const ablate::domain::Range& faceRange,
92 static PetscErrorCode ComputeGradientFVM(DM dm, DMLabel regionLabel, PetscInt regionValue, PetscFV fvm, Vec faceGeometry, Vec cellGeometry, DM* dmGrad);
102 CellInterpolant(std::shared_ptr<ablate::domain::SubDomain> subDomain,
const std::shared_ptr<domain::Region>& solverRegion, Vec faceGeomVec, Vec cellGeomVec);
111 void ComputeRHS(PetscReal time, Vec locXVec, Vec locAuxVec, Vec locFVec,
const std::shared_ptr<domain::Region>& solverRegion,
121 void ComputeRHS(PetscReal time, Vec locXVec, Vec locAuxVec, Vec locFVec,
const std::shared_ptr<domain::Region>& solverRegion, std::vector<CellInterpolant::PointFunctionDescription>& rhsFunctions,
Definition: cellInterpolant.hpp:11
PetscErrorCode(*)(PetscInt dim, const PetscFVFaceGeom *fg, const PetscInt uOff[], const PetscScalar fieldL[], const PetscScalar fieldR[], const PetscInt aOff[], const PetscScalar auxL[], const PetscScalar auxR[], PetscScalar flux[], void *ctx) DiscontinuousFluxFunction
Definition: cellInterpolant.hpp:17
PetscErrorCode(*)(PetscInt dim, PetscReal time, const PetscFVCellGeom *cg, const PetscInt uOff[], const PetscScalar u[], const PetscInt aOff[], const PetscScalar a[], PetscScalar f[], void *ctx) PointFunction
Definition: cellInterpolant.hpp:23
CellInterpolant(std::shared_ptr< ablate::domain::SubDomain > subDomain, const std::shared_ptr< domain::Region > &solverRegion, Vec faceGeomVec, Vec cellGeomVec)
Definition: cellInterpolant.cpp:5
void ComputeRHS(PetscReal time, Vec locXVec, Vec locAuxVec, Vec locFVec, const std::shared_ptr< domain::Region > &solverRegion, std::vector< CellInterpolant::DiscontinuousFluxFunctionDescription > &rhsFunctions, const ablate::domain::Range &faceRange, const ablate::domain::Range &cellRange, Vec cellGeomVec, Vec faceGeomVec)
Definition: cellInterpolant.cpp:42
Definition: cellInterpolant.hpp:25
Definition: cellInterpolant.hpp:37