ABLATE Source Documentation  0.12.34
ablate::finiteVolume::FiniteVolumeSolver Class Reference
+ Inheritance diagram for ablate::finiteVolume::FiniteVolumeSolver:

Public Types

enum  MeshCharacteristics { MIN_CELL_RADIUS = 0 , MAX_CELL_RADIUS }
 store an enum for the fields in the meshCharacteristicsDm
 
using PreRHSFunctionDefinition = PetscErrorCode(*)(FiniteVolumeSolver &, TS ts, PetscReal time, bool initialStage, Vec locX, void *ctx)
 
using RHSArbitraryFunction = PetscErrorCode(*)(const FiniteVolumeSolver &, DM dm, PetscReal time, Vec locXVec, Vec locFVec, void *ctx)
 
using ComputeTimeStepFunction = double(*)(TS ts, FiniteVolumeSolver &, 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

 FiniteVolumeSolver (std::string solverId, std::shared_ptr< domain::Region >, std::shared_ptr< parameters::Parameters > options, std::vector< std::shared_ptr< processes::Process >> flowProcesses, std::vector< std::shared_ptr< boundaryConditions::BoundaryCondition >> boundaryConditions)
 
 ~FiniteVolumeSolver () override
 cleanup
 
void Setup () override
 
void Initialize () override
 
PetscErrorCode ComputeRHSFunction (PetscReal time, Vec locXVec, Vec locFVec) override
 
PetscErrorCode ComputeBoundary (PetscReal time, Vec locX, Vec locX_t) override
 
void RegisterRHSFunction (CellInterpolant::DiscontinuousFluxFunction function, void *context, const std::string &field, const std::vector< std::string > &inputFields, const std::vector< std::string > &auxFields)
 
void RegisterRHSFunction (FaceInterpolant::ContinuousFluxFunction function, void *context, const std::string &field, const std::vector< std::string > &inputFields, const std::vector< std::string > &auxFields)
 
void RegisterRHSFunction (CellInterpolant::PointFunction function, void *context, const std::vector< std::string > &fields, const std::vector< std::string > &inputFields, const std::vector< std::string > &auxFields)
 
void RegisterRHSFunction (RHSArbitraryFunction function, void *context)
 
void RegisterPreRHSFunction (PreRHSFunctionDefinition function, void *context)
 
void RegisterComputeTimeStepFunction (ComputeTimeStepFunction function, void *ctx, std::string name)
 
std::map< std::string, double > ComputePhysicsTimeSteps (TS) override
 
double ComputePhysicsTimeStep (TS) 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
 
void GetCellRangeWithoutGhost (ablate::domain::Range &faceRange) const
 
template<class T >
std::shared_ptr< T > FindProcess ()
 
PetscErrorCode PreRHSFunction (TS ts, PetscReal time, bool initialStage, Vec locX) override
 
void GetMeshCharacteristics (DM &dm, Vec &vec)
 
- 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::SubDomainGetSubDomain () noexcept
 
const ablate::domain::SubDomainGetSubDomain () const noexcept
 
std::shared_ptr< domain::RegionGetRegion () 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
 

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)
 
- 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::SubDomainsubDomain
 

Member Function Documentation

◆ ComputeBoundary()

PetscErrorCode ablate::finiteVolume::FiniteVolumeSolver::ComputeBoundary ( PetscReal  time,
Vec  locX,
Vec  locX_t 
)
overridevirtual

Updates any traditional ghost node boundary

Parameters
time
locX
locX_t
Returns

Implements ablate::solver::BoundaryFunction.

◆ ComputePhysicsTimeStep()

double ablate::finiteVolume::FiniteVolumeSolver::ComputePhysicsTimeStep ( TS  ts)
overridevirtual

Computes the physics based time step. Each rank may return a different value, a global reduction will be done.

Implements ablate::solver::PhysicsTimeStepFunction.

◆ ComputePhysicsTimeSteps()

std::map< std::string, double > ablate::finiteVolume::FiniteVolumeSolver::ComputePhysicsTimeSteps ( TS  ts)
overridevirtual

Computes the individual time steps useful for output/debugging.

Reimplemented from ablate::solver::PhysicsTimeStepFunction.

◆ ComputeRHSFunction()

PetscErrorCode ablate::finiteVolume::FiniteVolumeSolver::ComputeRHSFunction ( PetscReal  time,
Vec  locXVec,
Vec  locFVec 
)
overridevirtual

Function passed into PETSc to compute the FV RHS

Parameters
dm
time
locXVec
globFVec
ctx
Returns

Implements ablate::solver::RHSFunction.

◆ FindProcess()

template<class T >
std::shared_ptr<T> ablate::finiteVolume::FiniteVolumeSolver::FindProcess ( )
inline

Returns first instance of process of type specifed

Template Parameters
T
Returns

◆ GetCellRangeWithoutGhost()

void ablate::finiteVolume::FiniteVolumeSolver::GetCellRangeWithoutGhost ( ablate::domain::Range faceRange) const

Get the cellIS and range over valid cells in this region without ghost cells (boundary or mpi)

Parameters
cellIS
pStart
pEnd
points

◆ GetId()

const std::string& ablate::finiteVolume::FiniteVolumeSolver::GetId ( ) const
inlineoverridevirtual

only required function, returns the id of the object. Should be unique for the simulation

Returns

Implements ablate::io::Serializable.

◆ GetMeshCharacteristics()

void ablate::finiteVolume::FiniteVolumeSolver::GetMeshCharacteristics ( DM &  dm,
Vec &  vec 
)
inline

returns the dm and localVector for meshCharacteristicsLocalVec

◆ Initialize()

void ablate::finiteVolume::FiniteVolumeSolver::Initialize ( )
overridevirtual

cell center

cell center

Implements ablate::solver::Solver.

◆ PreRHSFunction()

PetscErrorCode ablate::finiteVolume::FiniteVolumeSolver::PreRHSFunction ( TS  ts,
PetscReal  time,
bool  initialStage,
Vec  locX 
)
overridevirtual

Called to update the aux variables

Parameters
time
locX
Returns

Reimplemented from ablate::solver::RHSFunction.

◆ RegisterComputeTimeStepFunction()

void ablate::finiteVolume::FiniteVolumeSolver::RegisterComputeTimeStepFunction ( ComputeTimeStepFunction  function,
void *  ctx,
std::string  name 
)

Register a dtCalculator

Parameters
function
context
field
inputFields
auxFields

◆ RegisterPreRHSFunction()

void ablate::finiteVolume::FiniteVolumeSolver::RegisterPreRHSFunction ( PreRHSFunctionDefinition  function,
void *  context 
)

Register a pre rhs function. The user is responsible for all work

Parameters
function
context

◆ RegisterRHSFunction() [1/4]

void ablate::finiteVolume::FiniteVolumeSolver::RegisterRHSFunction ( CellInterpolant::DiscontinuousFluxFunction  function,
void *  context,
const std::string &  field,
const std::vector< std::string > &  inputFields,
const std::vector< std::string > &  auxFields 
)

Register a FVM rhs discontinuous flux function

Parameters
function
context
field
inputFields
auxFields

◆ RegisterRHSFunction() [2/4]

void ablate::finiteVolume::FiniteVolumeSolver::RegisterRHSFunction ( CellInterpolant::PointFunction  function,
void *  context,
const std::vector< std::string > &  fields,
const std::vector< std::string > &  inputFields,
const std::vector< std::string > &  auxFields 
)

Register a FVM rhs point function

Parameters
function
context
field
inputFields
auxFields

◆ RegisterRHSFunction() [3/4]

void ablate::finiteVolume::FiniteVolumeSolver::RegisterRHSFunction ( FaceInterpolant::ContinuousFluxFunction  function,
void *  context,
const std::string &  field,
const std::vector< std::string > &  inputFields,
const std::vector< std::string > &  auxFields 
)

Register a FVM rhs continuous flux function

Parameters
function
context
field
inputFields
auxFields

◆ RegisterRHSFunction() [4/4]

void ablate::finiteVolume::FiniteVolumeSolver::RegisterRHSFunction ( RHSArbitraryFunction  function,
void *  context 
)

Register an arbitrary function. The user is responsible for all work

Parameters
function
context

◆ Restore()

PetscErrorCode ablate::finiteVolume::FiniteVolumeSolver::Restore ( PetscViewer  viewer,
PetscInt  sequenceNumber,
PetscReal  time 
)
overridevirtual

Restore the state from the PetscViewer

Parameters
viewer
sequenceNumber
time

Implements ablate::io::Serializable.

◆ Save()

PetscErrorCode ablate::finiteVolume::FiniteVolumeSolver::Save ( PetscViewer  viewer,
PetscInt  sequenceNumber,
PetscReal  time 
)
overridevirtual

Save the state to the PetscViewer

Parameters
viewer
sequenceNumber
time

Implements ablate::io::Serializable.

◆ Serialize()

ablate::io::Serializable::SerializerType ablate::finiteVolume::FiniteVolumeSolver::Serialize ( ) const
overridevirtual

Returns true if any of the processes are marked as serializable

Returns

Reimplemented from ablate::io::Serializable.

◆ Setup()

void ablate::finiteVolume::FiniteVolumeSolver::Setup ( )
overridevirtual

SubDomain Register and Setup

Implements ablate::solver::Solver.


The documentation for this class was generated from the following files: