ABLATE Source Documentation  0.12.33
ablate::solver::CellSolver Class Reference
+ Inheritance diagram for ablate::solver::CellSolver:

Public Types

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 Member Functions

 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
 

Protected Attributes

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
 

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)
 

Constructor & Destructor Documentation

◆ CellSolver()

ablate::solver::CellSolver::CellSolver ( std::string  solverId,
std::shared_ptr< domain::Region region = {},
std::shared_ptr< parameters::Parameters options = nullptr 
)
explicit

Create a base solver used for cell based solvers

Parameters
solverId
options

Member Function Documentation

◆ Initialize()

void ablate::solver::CellSolver::Initialize ( )
overridevirtual

Call any solution update functions before the first timestep

Implements ablate::solver::Solver.

◆ RegisterAuxFieldUpdate()

void ablate::solver::CellSolver::RegisterAuxFieldUpdate ( AuxFieldUpdateFunction  function,
void *  context,
const std::vector< std::string > &  auxField,
const std::vector< std::string > &  inputFields 
)

Register a auxFieldUpdate

Parameters
function
context
field
inputFields
auxFields

◆ RegisterSolutionFieldUpdate()

void ablate::solver::CellSolver::RegisterSolutionFieldUpdate ( SolutionFieldUpdateFunction  function,
void *  context,
const std::vector< std::string > &  inputFields 
)

Register a auxFieldUpdate

Parameters
function
context
field
inputFields
auxFields

◆ Setup()

void ablate::solver::CellSolver::Setup ( )
overridevirtual

Setup the subdomain cell solver vectors

Implements ablate::solver::Solver.

◆ UpdateAuxFields()

void ablate::solver::CellSolver::UpdateAuxFields ( PetscReal  time,
Vec  locXVec,
Vec  locAuxField 
)

Helper function to march over each cell and update the aux Fields

Parameters
time
locXVec
locAuxField

◆ UpdateSolutionFields()

void ablate::solver::CellSolver::UpdateSolutionFields ( PetscReal  time,
Vec  globXVec 
)

Helper function to march over each cell and update the solution fields if specified (including ghost nodes)

Parameters
flow
locXVec

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