Classes | |
struct | BoundaryFVFaceGeom |
struct | BoundaryPreRHSPointFunctionDefinition |
Public Types | |
enum class | BoundarySourceType { Point , Distributed , Flux , Face } |
using | BoundarySourceFunction = PetscErrorCode(*)(PetscInt dim, const BoundaryFVFaceGeom *fg, const PetscFVCellGeom *boundaryCell, const PetscInt uOff[], const PetscScalar *boundaryValues, const PetscScalar *stencilValues[], const PetscInt aOff[], const PetscScalar *auxValues, const PetscScalar *stencilAuxValues[], PetscInt stencilSize, const PetscInt stencil[], const PetscScalar stencilWeights[], const PetscInt sOff[], PetscScalar source[], void *ctx) |
using | BoundaryUpdateFunction = PetscErrorCode(*)(PetscInt dim, const BoundaryFVFaceGeom *fg, const PetscFVCellGeom *boundaryCell, const PetscInt uOff[], PetscScalar *boundaryValues, const PetscScalar *stencilValues, const PetscInt aOff[], PetscScalar *auxValues, const PetscScalar *stencilAuxValues, void *ctx) |
using | BoundaryPreRHSFunctionDefinition = PetscErrorCode(*)(BoundarySolver &, TS ts, PetscReal time, bool initialStage, Vec locX, void *ctx) |
using | BoundaryPreRHSPointFunction = PetscErrorCode(*)(PetscReal time, PetscReal dt, PetscInt dim, const BoundaryFVFaceGeom *fg, const PetscFVCellGeom *boundaryCell, const PetscInt uOff[], PetscScalar *boundaryValues, const PetscScalar *stencilValues[], const PetscInt aOff[], PetscScalar *auxValues, const PetscScalar *stencilAuxValues[], PetscInt stencilSize, const PetscInt stencil[], const PetscScalar stencilWeights[], void *ctx) |
Public Types inherited from ablate::solver::CellSolver | |
using | AuxFieldUpdateFunction = PetscErrorCode(*)(PetscReal time, PetscInt dim, const PetscFVCellGeom *cellGeom, const PetscInt uOff[], const PetscScalar *u, const PetscInt aOff[], PetscScalar *auxField, void *ctx) |
function template for updating the aux field | |
using | SolutionFieldUpdateFunction = PetscErrorCode(*)(PetscReal time, PetscInt dim, const PetscFVCellGeom *cellGeom, const PetscInt uOff[], PetscScalar *u, void *ctx) |
function template for updating the solution field | |
Public Types inherited from ablate::io::Serializable | |
enum class | SerializerType { none , collective , serial } |
Public Member Functions | |
PetscErrorCode | ComputeBoundaryPreRHSPointFunction (PetscReal time, PetscReal dt, Vec locXVec, const BoundaryPreRHSPointFunctionDefinition &boundaryPreRhsPointFunction) |
BoundarySolver (std::string solverId, std::shared_ptr< domain::Region > region, std::shared_ptr< domain::Region > fieldBoundary, std::vector< std::shared_ptr< BoundaryProcess >> boundaryProcesses, std::shared_ptr< parameters::Parameters > options, bool mergeFaces=false) | |
void | Setup () override |
void | Initialize () override |
void | RegisterFunction (BoundarySourceFunction function, void *context, const std::vector< std::string > &sourceFields, const std::vector< std::string > &inputFields, const std::vector< std::string > &auxFields, BoundarySourceType type=BoundarySourceType::Point) |
void | RegisterFunction (BoundaryUpdateFunction function, void *context, const std::vector< std::string > &inputFields, const std::vector< std::string > &auxFields) |
void | RegisterPreRHSFunction (BoundaryPreRHSFunctionDefinition function, void *context) |
PetscErrorCode | ComputeRHSFunction (PetscReal time, Vec locXVec, Vec locFVec) override |
PetscErrorCode | ComputeRHSFunction (PetscReal time, Vec locXVec, Vec locFVec, const std::vector< BoundarySourceFunctionDescription > &boundarySourceFunctions) |
void | InsertFieldFunctions (const std::vector< std::shared_ptr< mathFunctions::FieldFunction >> &initialization, PetscReal time=0.0) |
std::vector< GradientStencil > | GetBoundaryGeometry (PetscInt cell) const |
const std::vector< GradientStencil > & | GetBoundaryGeometry () const |
const std::vector< std::string > & | GetOutputComponents () |
const std::vector< BoundarySourceFunctionDescription > & | GetOutputFunctions () |
PetscErrorCode | PreRHSFunction (TS ts, PetscReal time, bool initialStage, Vec locX) override |
SerializerType | Serialize () const override |
const std::string & | GetId () const override |
PetscErrorCode | Save (PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override |
PetscErrorCode | Restore (PetscViewer viewer, PetscInt sequenceNumber, PetscReal time) override |
Public Member Functions inherited from ablate::solver::CellSolver | |
CellSolver (std::string solverId, std::shared_ptr< domain::Region >={}, std::shared_ptr< parameters::Parameters > options=nullptr) | |
void | RegisterAuxFieldUpdate (AuxFieldUpdateFunction function, void *context, const std::vector< std::string > &auxField, const std::vector< std::string > &inputFields) |
void | RegisterSolutionFieldUpdate (SolutionFieldUpdateFunction function, void *context, const std::vector< std::string > &inputFields) |
void | UpdateAuxFields (PetscReal time, Vec locXVec, Vec locAuxField) |
void | UpdateSolutionFields (PetscReal time, Vec globXVec) |
void | Setup () override |
void | Initialize () override |
Public Member Functions inherited from ablate::solver::Solver | |
virtual void | Register (std::shared_ptr< ablate::domain::SubDomain > subDomain) |
const std::string & | GetSolverId () const |
ablate::domain::SubDomain & | GetSubDomain () noexcept |
const ablate::domain::SubDomain & | GetSubDomain () const noexcept |
std::shared_ptr< domain::Region > | GetRegion () const noexcept |
void | PreStage (TS ts, PetscReal stagetime) |
void | PreStep (TS ts) |
void | PostStep (TS ts) |
void | PostEvaluate (TS ts) |
void | RegisterPreStep (const std::function< void(TS ts, Solver &)> &preStep) |
void | RegisterPreStage (const std::function< void(TS ts, Solver &, PetscReal)> &preStage) |
void | RegisterPostStep (const std::function< void(TS ts, Solver &)> &postStep) |
void | RegisterPostEvaluate (const std::function< void(TS ts, Solver &)> &postEval) |
void | GetCellRange (ablate::domain::Range &cellRange) const |
void | GetFaceRange (ablate::domain::Range &faceRange) const |
void | GetRange (PetscInt depth, ablate::domain::Range &range) const |
void | RestoreRange (ablate::domain::Range &range) const |
Static Public Member Functions | |
static void | ComputeGradient (PetscInt dim, PetscScalar boundaryValue, PetscInt stencilSize, const PetscScalar *stencilValues, const PetscScalar *stencilWeights, PetscScalar *grad) |
static void | ComputeGradientAlongNormal (PetscInt dim, const BoundaryFVFaceGeom *fg, PetscScalar boundaryValue, PetscInt stencilSize, const PetscScalar *stencilValues, const PetscScalar *stencilWeights, PetscScalar &dPhiDNorm) |
Protected Attributes | |
std::vector< GradientStencil > | gradientStencils |
Protected Attributes inherited from ablate::solver::CellSolver | |
Vec | cellGeomVec = nullptr |
Vector used to describe the entire cell geom of the dm. This is constant and does not depend upon region. | |
Vec | faceGeomVec = nullptr |
Vector used to describe the entire face geom of the dm. This is constant and does not depend upon region. | |
Protected Attributes inherited from ablate::solver::Solver | |
PetscOptions | petscOptions |
std::shared_ptr< ablate::domain::SubDomain > | subDomain |
Additional Inherited Members | |
Protected Member Functions inherited from ablate::solver::Solver | |
Solver (std::string solverId, std::shared_ptr< domain::Region >={}, std::shared_ptr< parameters::Parameters > options=nullptr) | |
Static Protected Member Functions inherited from ablate::solver::Solver | |
static PetscErrorCode | DMPlexInsertBoundaryValues_Plex (DM dm, PetscDS ds, PetscBool insertEssential, Vec locX, PetscReal time, Vec faceGeomFVM, Vec cellGeomFVM, Vec gradFVM) |
static PetscErrorCode | DMPlexInsertTimeDerivativeBoundaryValues_Plex (DM dm, PetscDS ds, PetscBool insertEssential, Vec locX, PetscReal time, Vec faceGeomFVM, Vec cellGeomFVM, Vec gradFVM) |
Static Protected Member Functions inherited from ablate::io::Serializable | |
static PetscErrorCode | SaveKeyValue (PetscViewer viewer, const char *name, PetscScalar value) |
static PetscErrorCode | RestoreKeyValue (PetscViewer viewer, const char *name, PetscScalar &value) |
template<class T > | |
static PetscErrorCode | SaveKeyValue (PetscViewer viewer, const char *name, T value) |
template<class T > | |
static PetscErrorCode | RestoreKeyValue (PetscViewer viewer, const char *name, T &value) |
template<class T > | |
static SerializerType | DetermineSerializerType (const T &types) |
using ablate::boundarySolver::BoundarySolver::BoundaryPreRHSFunctionDefinition = PetscErrorCode (*)(BoundarySolver&, TS ts, PetscReal time, bool initialStage, Vec locX, void* ctx) |
Called before any of the rhs functions of the solver
using ablate::boundarySolver::BoundarySolver::BoundaryPreRHSPointFunction = PetscErrorCode (*)(PetscReal time, PetscReal dt, PetscInt dim, const BoundaryFVFaceGeom* fg, const PetscFVCellGeom* boundaryCell, const PetscInt uOff[], PetscScalar* boundaryValues, const PetscScalar* stencilValues[], const PetscInt aOff[], PetscScalar* auxValues, const PetscScalar* stencilAuxValues[], PetscInt stencilSize, const PetscInt stencil[], const PetscScalar stencilWeights[], void* ctx) |
Simple function definition used to iterate over all boundary cells before the time step
using ablate::boundarySolver::BoundarySolver::BoundaryUpdateFunction = PetscErrorCode (*)(PetscInt dim, const BoundaryFVFaceGeom* fg, const PetscFVCellGeom* boundaryCell, const PetscInt uOff[], PetscScalar* boundaryValues, const PetscScalar* stencilValues, const PetscInt aOff[], PetscScalar* auxValues, const PetscScalar* stencilAuxValues, void* ctx) |
Update the solution or aux field before each time step
Boundaries can be treated in two different ways, point source on the boundary or distributed in the other phase. For the Distributed model, the source is divided by volume in each case
ablate::boundarySolver::BoundarySolver::BoundarySolver | ( | std::string | solverId, |
std::shared_ptr< domain::Region > | region, | ||
std::shared_ptr< domain::Region > | fieldBoundary, | ||
std::vector< std::shared_ptr< BoundaryProcess >> | boundaryProcesses, | ||
std::shared_ptr< parameters::Parameters > | options, | ||
bool | mergeFaces = false |
||
) |
solverId | the id for this solver |
region | the boundary cell region |
fieldBoundary | the region describing the faces between the boundary and field |
boundaryProcesses | a list of boundary processes |
options | other options |
PetscErrorCode ablate::boundarySolver::BoundarySolver::ComputeBoundaryPreRHSPointFunction | ( | PetscReal | time, |
PetscReal | dt, | ||
Vec | locXVec, | ||
const BoundaryPreRHSPointFunctionDefinition & | boundaryPreRhsPointFunction | ||
) |
Helper function that can be called from other locations to to iterate over each boundary cell
time | |
dt | |
locXVec | |
boundaryPreRhsPointFunction |
|
static |
public helper function to compute the gradient
dim | |
boundaryValue | |
stencilValues | |
stencilWeights | |
grad |
|
static |
public helper function to compute dPhiDNorm
dim | |
boundaryValue | |
stencilValues | |
stencilWeights | |
grad |
|
overridevirtual |
Function passed into PETSc to compute the FV RHS with all boundarySourceFunctions
time | |
locXVec | |
locFVec |
Implements ablate::solver::RHSFunction.
Reimplemented in ablate::boundarySolver::DebugBoundarySolver.
PetscErrorCode ablate::boundarySolver::BoundarySolver::ComputeRHSFunction | ( | PetscReal | time, |
Vec | locXVec, | ||
Vec | locFVec, | ||
const std::vector< BoundarySourceFunctionDescription > & | boundarySourceFunctions | ||
) |
Public function to allow arbitrary boundarySourceFunctions to be used for computation
time | |
locXVec | |
locFVec | |
boundarySourceFunctions |
|
inline |
Return a copy of all GradientStencil
std::vector< ablate::boundarySolver::BoundarySolver::GradientStencil > ablate::boundarySolver::BoundarySolver::GetBoundaryGeometry | ( | PetscInt | cell | ) | const |
Return a reference to the boundary geometry. This is a slow call and should only be done for init/debugging/testing
|
inlineoverridevirtual |
only required function, returns the id of the object. Should be unique for the simulation
Implements ablate::io::Serializable.
|
inline |
Get access to the output fields
|
inline |
Get access to the output functions
void ablate::boundarySolver::BoundarySolver::InsertFieldFunctions | ( | const std::vector< std::shared_ptr< mathFunctions::FieldFunction >> & | initialization, |
PetscReal | time = 0.0 |
||
) |
Helper function to project values to a cell boundary instead of the cell centroid
|
overridevirtual |
Called to update the aux variables
time | |
locX |
Reimplemented from ablate::solver::RHSFunction.
void ablate::boundarySolver::BoundarySolver::RegisterFunction | ( | BoundarySourceFunction | function, |
void * | context, | ||
const std::vector< std::string > & | sourceFields, | ||
const std::vector< std::string > & | inputFields, | ||
const std::vector< std::string > & | auxFields, | ||
BoundarySourceType | type = BoundarySourceType::Point |
||
) |
Register an arbitrary function. The user is responsible for all work. When registering face based functions the each sourceField is assumed to be a separate components in a single field
function | |
context |
void ablate::boundarySolver::BoundarySolver::RegisterFunction | ( | BoundaryUpdateFunction | function, |
void * | context, | ||
const std::vector< std::string > & | inputFields, | ||
const std::vector< std::string > & | auxFields | ||
) |
Register an update function.
function | |
context |
void ablate::boundarySolver::BoundarySolver::RegisterPreRHSFunction | ( | BoundaryPreRHSFunctionDefinition | function, |
void * | context | ||
) |
Register an pre function that is called before any RHS function
function | |
context |
|
overridevirtual |
Restore each of the processes
viewer | |
sequenceNumber | |
time |
Implements ablate::io::Serializable.
|
overridevirtual |
Call each of the processes to be saved
viewer | |
sequenceNumber | |
time |
Implements ablate::io::Serializable.
|
overridevirtual |
Check to see if any of the processes should be serialized
Reimplemented from ablate::io::Serializable.
|
overridevirtual |
SubDomain Register and Setup
Implements ablate::solver::Solver.
Reimplemented in ablate::boundarySolver::DebugBoundarySolver.