Finite Volume Solver  prototype
A framework to build finite volume solvers for the AG Klein at the Freie Universität Berlin.
Public Member Functions | Private Attributes | List of all members
fub::amrex::MultiBlockIntegratorContext Class Reference

#include <MultiBlockIntegratorContext.hpp>

Public Member Functions

 MultiBlockIntegratorContext (FlameMasterReactor reactor, std::vector< IntegratorContext > tubes, std::vector< cutcell::IntegratorContext > plena, std::vector< BlockConnection > connectivity)
 
 MultiBlockIntegratorContext (FlameMasterReactor reactor, std::vector< IntegratorContext > tubes, std::vector< cutcell::IntegratorContext > plena, std::vector< BlockConnection > connectivity, std::vector< std::shared_ptr< PressureValve >> valves)
 
MultiBlockBoundaryGetBoundaryCondition (int level)
 Returns the current boundary condition for the specified level. More...
 
MPI_Comm GetMpiCommunicator () const noexcept
 
const std::shared_ptr< CounterRegistry > & GetCounterRegistry () const noexcept
 Returns a shared pointer to the counter registry. More...
 
Member Accessors
span< IntegratorContextTubes () noexcept
 Returns the current time level for data at the specified refinement level and direction. More...
 
span< const IntegratorContextTubes () const noexcept
 Returns the current time level for data at the specified refinement level and direction. More...
 
span< cutcell::IntegratorContextPlena () noexcept
 Returns the current time level for data at the specified refinement level and direction. More...
 
span< const cutcell::IntegratorContextPlena () const noexcept
 Returns the current time level for data at the specified refinement level and direction. More...
 
const std::shared_ptr< MultiBlockGriddingAlgorithm > & GetGriddingAlgorithm () const noexcept
 Returns the current time level for data at the specified refinement level and direction. More...
 
Duration GetTimePoint (int level=0) const
 Returns the current time level for data at the specified refinement level and direction. More...
 
std::ptrdiff_t GetCycles (int level=0) const
 Returns the current number of cycles for data at the specified refinement level and direction. More...
 
Observers
bool LevelExists (int level) const noexcept
 Returns true if the data exists for the specified level number. More...
 
int GetRatioToCoarserLevel (int level, Direction dir) const noexcept
 Returns the refinement ratio in the specified direction. More...
 
::amrex::IntVect GetRatioToCoarserLevel (int level) const noexcept
 Returns the refinement ratio for all directions. More...
 
Modifiers
void CopyDataToScratch (int level)
 Replaces the underlying gridding algorithm with the specified one. More...
 
void CopyScratchToData (int level)
 Replaces the underlying gridding algorithm with the specified one. More...
 
void ResetHierarchyConfiguration (std::shared_ptr< MultiBlockGriddingAlgorithm > gridding)
 Replaces the underlying gridding algorithm with the specified one. More...
 
void ResetHierarchyConfiguration (int level=0)
 Whenever the gridding algorithm changes the data hierarchy this function will regrid all distributed helper variables managed by the context. More...
 
void SetCycles (std::ptrdiff_t cycle, int level)
 Sets the cycle count for a specific level number and direction. More...
 
void SetTimePoint (Duration t, int level)
 Sets the time point for a specific level number and direction. More...
 
Member functions relevant for the level integrator algorithm.
void PreAdvanceHierarchy ()
 On each first subcycle this will regrid the data if neccessary. More...
 
void PostAdvanceHierarchy ()
 On each first subcycle this will regrid the data if neccessary. More...
 
int PreAdvanceLevel (int level_num, Duration dt, std::pair< int, int > subcycle)
 On each first subcycle this will regrid the data if neccessary. More...
 
Result< void, TimeStepTooLargePostAdvanceLevel (int level_num, Duration dt, std::pair< int, int > subcycle)
 Increases the internal time stamps and cycle counters for the specified level number and direction. More...
 
void ApplyBoundaryCondition (int level, Direction dir)
 Applies the boundary condition for the scratch space on level level in direcition dir. More...
 
void FillGhostLayerTwoLevels (int level, int coarse)
 Fills the ghost layer of the scratch data and interpolates in the coarse fine layer. More...
 
void FillGhostLayerSingleLevel (int level)
 Fills the ghost layer of the scratch data and does nothing in the coarse fine layer. More...
 
Duration ComputeStableDt (int level, Direction dir)
 Returns a estimate for a stable time step size which can be taken for specified level number in direction dir. More...
 
void ComputeNumericFluxes (int level, Duration dt, Direction dir)
 Fill the flux MultiFab with numeric fluxes based on current states in scratch. More...
 
void UpdateConservatively (int level, Duration dt, Direction dir)
 Apply a conservative time update for each conservative variable on the specified level number and direction. More...
 
void CompleteFromCons (int level, Duration dt)
 Reconstruct complete state variables from conservative ones. More...
 
void AccumulateCoarseFineFluxes (int level, double time_scale, Direction dir)
 Accumulate fluxes on the coarse fine interfaces for a specified fine level number. More...
 
void ApplyFluxCorrection (int fine, int coarse, Duration dt)
 Replace the coarse fluxes by accumulated fine fluxes on the coarse fine interfaces. More...
 
void ResetCoarseFineFluxes (int fine, int coarse)
 Resets all accumulates fluxes to zero. More...
 
void CoarsenConservatively (int fine, int coarse)
 Coarsen scratch data from a fine level number to a coarse level number. More...
 

Private Attributes

std::vector< IntegratorContexttubes_
 
std::vector< cutcell::IntegratorContextplena_
 
std::shared_ptr< MultiBlockGriddingAlgorithmgridding_
 

Constructor & Destructor Documentation

◆ MultiBlockIntegratorContext() [1/2]

fub::amrex::MultiBlockIntegratorContext::MultiBlockIntegratorContext ( FlameMasterReactor  reactor,
std::vector< IntegratorContext tubes,
std::vector< cutcell::IntegratorContext plena,
std::vector< BlockConnection connectivity 
)

◆ MultiBlockIntegratorContext() [2/2]

fub::amrex::MultiBlockIntegratorContext::MultiBlockIntegratorContext ( FlameMasterReactor  reactor,
std::vector< IntegratorContext tubes,
std::vector< cutcell::IntegratorContext plena,
std::vector< BlockConnection connectivity,
std::vector< std::shared_ptr< PressureValve >>  valves 
)

Member Function Documentation

◆ AccumulateCoarseFineFluxes()

void fub::amrex::MultiBlockIntegratorContext::AccumulateCoarseFineFluxes ( int  level,
double  time_scale,
Direction  dir 
)

Accumulate fluxes on the coarse fine interfaces for a specified fine level number.

◆ ApplyBoundaryCondition()

void fub::amrex::MultiBlockIntegratorContext::ApplyBoundaryCondition ( int  level,
Direction  dir 
)

Applies the boundary condition for the scratch space on level level in direcition dir.

Parameters
levelThe refinement level on which the boundary condition shall be used.

◆ ApplyFluxCorrection()

void fub::amrex::MultiBlockIntegratorContext::ApplyFluxCorrection ( int  fine,
int  coarse,
Duration  dt 
)

Replace the coarse fluxes by accumulated fine fluxes on the coarse fine interfaces.

◆ CoarsenConservatively()

void fub::amrex::MultiBlockIntegratorContext::CoarsenConservatively ( int  fine,
int  coarse 
)

Coarsen scratch data from a fine level number to a coarse level number.

◆ CompleteFromCons()

void fub::amrex::MultiBlockIntegratorContext::CompleteFromCons ( int  level,
Duration  dt 
)

Reconstruct complete state variables from conservative ones.

◆ ComputeNumericFluxes()

void fub::amrex::MultiBlockIntegratorContext::ComputeNumericFluxes ( int  level,
Duration  dt,
Direction  dir 
)

Fill the flux MultiFab with numeric fluxes based on current states in scratch.

◆ ComputeStableDt()

Duration fub::amrex::MultiBlockIntegratorContext::ComputeStableDt ( int  level,
Direction  dir 
)

Returns a estimate for a stable time step size which can be taken for specified level number in direction dir.

◆ CopyDataToScratch()

void fub::amrex::MultiBlockIntegratorContext::CopyDataToScratch ( int  level)

Replaces the underlying gridding algorithm with the specified one.

◆ CopyScratchToData()

void fub::amrex::MultiBlockIntegratorContext::CopyScratchToData ( int  level)

Replaces the underlying gridding algorithm with the specified one.

◆ FillGhostLayerSingleLevel()

void fub::amrex::MultiBlockIntegratorContext::FillGhostLayerSingleLevel ( int  level)

Fills the ghost layer of the scratch data and does nothing in the coarse fine layer.

◆ FillGhostLayerTwoLevels()

void fub::amrex::MultiBlockIntegratorContext::FillGhostLayerTwoLevels ( int  level,
int  coarse 
)

Fills the ghost layer of the scratch data and interpolates in the coarse fine layer.

◆ GetBoundaryCondition()

MultiBlockBoundary& fub::amrex::MultiBlockIntegratorContext::GetBoundaryCondition ( int  level)

Returns the current boundary condition for the specified level.

◆ GetCounterRegistry()

const std::shared_ptr<CounterRegistry>& fub::amrex::MultiBlockIntegratorContext::GetCounterRegistry ( ) const
noexcept

Returns a shared pointer to the counter registry.

◆ GetCycles()

std::ptrdiff_t fub::amrex::MultiBlockIntegratorContext::GetCycles ( int  level = 0) const

Returns the current number of cycles for data at the specified refinement level and direction.

◆ GetGriddingAlgorithm()

const std::shared_ptr<MultiBlockGriddingAlgorithm>& fub::amrex::MultiBlockIntegratorContext::GetGriddingAlgorithm ( ) const
noexcept

Returns the current time level for data at the specified refinement level and direction.

◆ GetMpiCommunicator()

MPI_Comm fub::amrex::MultiBlockIntegratorContext::GetMpiCommunicator ( ) const
noexcept

◆ GetRatioToCoarserLevel() [1/2]

::amrex::IntVect fub::amrex::MultiBlockIntegratorContext::GetRatioToCoarserLevel ( int  level) const
noexcept

Returns the refinement ratio for all directions.

◆ GetRatioToCoarserLevel() [2/2]

int fub::amrex::MultiBlockIntegratorContext::GetRatioToCoarserLevel ( int  level,
Direction  dir 
) const
noexcept

Returns the refinement ratio in the specified direction.

◆ GetTimePoint()

Duration fub::amrex::MultiBlockIntegratorContext::GetTimePoint ( int  level = 0) const

Returns the current time level for data at the specified refinement level and direction.

◆ LevelExists()

bool fub::amrex::MultiBlockIntegratorContext::LevelExists ( int  level) const
noexcept

Returns true if the data exists for the specified level number.

◆ Plena() [1/2]

span<const cutcell::IntegratorContext> fub::amrex::MultiBlockIntegratorContext::Plena ( ) const
noexcept

Returns the current time level for data at the specified refinement level and direction.

◆ Plena() [2/2]

span<cutcell::IntegratorContext> fub::amrex::MultiBlockIntegratorContext::Plena ( )
noexcept

Returns the current time level for data at the specified refinement level and direction.

◆ PostAdvanceHierarchy()

void fub::amrex::MultiBlockIntegratorContext::PostAdvanceHierarchy ( )

On each first subcycle this will regrid the data if neccessary.

◆ PostAdvanceLevel()

Result<void, TimeStepTooLarge> fub::amrex::MultiBlockIntegratorContext::PostAdvanceLevel ( int  level_num,
Duration  dt,
std::pair< int, int >  subcycle 
)

Increases the internal time stamps and cycle counters for the specified level number and direction.

◆ PreAdvanceHierarchy()

void fub::amrex::MultiBlockIntegratorContext::PreAdvanceHierarchy ( )

On each first subcycle this will regrid the data if neccessary.

◆ PreAdvanceLevel()

int fub::amrex::MultiBlockIntegratorContext::PreAdvanceLevel ( int  level_num,
Duration  dt,
std::pair< int, int >  subcycle 
)

On each first subcycle this will regrid the data if neccessary.

◆ ResetCoarseFineFluxes()

void fub::amrex::MultiBlockIntegratorContext::ResetCoarseFineFluxes ( int  fine,
int  coarse 
)

Resets all accumulates fluxes to zero.

◆ ResetHierarchyConfiguration() [1/2]

void fub::amrex::MultiBlockIntegratorContext::ResetHierarchyConfiguration ( int  level = 0)

Whenever the gridding algorithm changes the data hierarchy this function will regrid all distributed helper variables managed by the context.

Parameters
[in]levelThe level number of the coarsest level which changed its shape. Regrid all levels finer than level.

◆ ResetHierarchyConfiguration() [2/2]

void fub::amrex::MultiBlockIntegratorContext::ResetHierarchyConfiguration ( std::shared_ptr< MultiBlockGriddingAlgorithm gridding)

Replaces the underlying gridding algorithm with the specified one.

◆ SetCycles()

void fub::amrex::MultiBlockIntegratorContext::SetCycles ( std::ptrdiff_t  cycle,
int  level 
)

Sets the cycle count for a specific level number and direction.

◆ SetTimePoint()

void fub::amrex::MultiBlockIntegratorContext::SetTimePoint ( Duration  t,
int  level 
)

Sets the time point for a specific level number and direction.

◆ Tubes() [1/2]

span<const IntegratorContext> fub::amrex::MultiBlockIntegratorContext::Tubes ( ) const
noexcept

Returns the current time level for data at the specified refinement level and direction.

◆ Tubes() [2/2]

span<IntegratorContext> fub::amrex::MultiBlockIntegratorContext::Tubes ( )
noexcept

Returns the current time level for data at the specified refinement level and direction.

◆ UpdateConservatively()

void fub::amrex::MultiBlockIntegratorContext::UpdateConservatively ( int  level,
Duration  dt,
Direction  dir 
)

Apply a conservative time update for each conservative variable on the specified level number and direction.

Member Data Documentation

◆ gridding_

std::shared_ptr<MultiBlockGriddingAlgorithm> fub::amrex::MultiBlockIntegratorContext::gridding_
private

◆ plena_

std::vector<cutcell::IntegratorContext> fub::amrex::MultiBlockIntegratorContext::plena_
private

◆ tubes_

std::vector<IntegratorContext> fub::amrex::MultiBlockIntegratorContext::tubes_
private

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