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

#include <CompressibleAdvectionIntegratorContext.hpp>

Public Member Functions

 CompressibleAdvectionIntegratorContext (std::shared_ptr< GriddingAlgorithm > gridding, HyperbolicMethod method)
 
 CompressibleAdvectionIntegratorContext (std::shared_ptr< GriddingAlgorithm > gridding, HyperbolicMethod method, int cell_gcw, int face_gcw)
 
 CompressibleAdvectionIntegratorContext (const CompressibleAdvectionIntegratorContext &)
 Deeply copies a context and all its distributed data for all MPI ranks. More...
 
CompressibleAdvectionIntegratorContext operator= (const CompressibleAdvectionIntegratorContext &)
 
 CompressibleAdvectionIntegratorContext (CompressibleAdvectionIntegratorContext &&)=default
 
CompressibleAdvectionIntegratorContextoperator= (CompressibleAdvectionIntegratorContext &&)=default
 
CompressibleAdvectionAdvectiveFluxesGetAdvectiveFluxes (int level)
 
const CompressibleAdvectionAdvectiveFluxesGetAdvectiveFluxes (int level) const
 
void ResetHierarchyConfiguration (std::shared_ptr< GriddingAlgorithm > gridding) override
 Replaces the underlying gridding algorithm with the specified one. More...
 
void ResetHierarchyConfiguration (int level=0) override
 Whenever the gridding algorithm changes the data hierarchy this function will regrid all distributed helper variables managed by the context. More...
 
Member Accessors
int Rank () const noexcept
 Returns a shared pointer to the underlying GriddingAlgorithm which owns the simulation. More...
 
const std::shared_ptr< GriddingAlgorithm > & GetGriddingAlgorithm () const noexcept
 Returns a shared pointer to the underlying GriddingAlgorithm which owns the simulation. More...
 
const PatchHierarchyGetPatchHierarchy () const noexcept
 Returns a reference to const PatchHierarchy which is a member of the GriddingAlgorithm. More...
 
PatchHierarchyGetPatchHierarchy () noexcept
 Returns a reference to PatchHierarchy which is a member of the GriddingAlgorithm. More...
 
MPI_Comm GetMpiCommunicator () const noexcept
 Returns the MPI communicator which is associated with this context. More...
 
Access Level-specific data
::amrex::MultiFab & GetData (int level)
 Returns the MultiFab associated with level data on the specifed level number. More...
 
const ::amrex::MultiFab & GetData (int level) const
 Returns the MultiFab associated with level data on the specifed level number. More...
 
::amrex::MultiFab & GetScratch (int level)
 Returns the MultiFab associated with level data with ghost cells on the specifed level number and direction. More...
 
const ::amrex::MultiFab & GetScratch (int level) const
 Returns the MultiFab associated with level data on the specifed level number. More...
 
::amrex::MultiFab & GetFluxes (int level, Direction dir)
 Returns the MultiFab associated with flux data on the specifed level number and direction. More...
 
const ::amrex::MultiFab & GetFluxes (int level, Direction dir) const
 Returns the MultiFab associated with level data on the specifed level number. 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...
 
const ::amrex::GeometryGetGeometry (int level) const
 Returns the geometry object for the specified refinement level. More...
 
const std::shared_ptr< CounterRegistry > & GetCounterRegistry () const noexcept
 Returns a shared pointer to the counter registry. 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 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 PostAdvanceHierarchy ()
 Updates time point and cycle counter for the patch hierarchy. 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 CopyDataToScratch (int level_num)
 Updates time point and cycle counter for the patch hierarchy. More...
 
void CopyScratchToData (int level_num)
 Updates time point and cycle counter for the patch hierarchy. More...
 
void ApplyBoundaryCondition (int level, Direction dir)
 Applies the boundary condition for the scratch space on level level in direcition dir. More...
 
void ApplyBoundaryCondition (int level, Direction dir, AnyBoundaryCondition &bc)
 Updates time point and cycle counter for the patch hierarchy. More...
 
void FillGhostLayerTwoLevels (int level, AnyBoundaryCondition &fbc, int coarse, AnyBoundaryCondition &cbc)
 Fills the ghost layer of the scratch data and interpolates in the coarse fine layer. More...
 
void FillGhostLayerTwoLevels (int level, int coarse)
 Updates time point and cycle counter for the patch hierarchy. More...
 
void FillGhostLayerSingleLevel (int level, AnyBoundaryCondition &bc)
 Fills the ghost layer of the scratch data and does nothing in the coarse fine layer. More...
 
void FillGhostLayerSingleLevel (int level)
 Updates time point and cycle counter for the patch hierarchy. 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...
 

Public Attributes

bool count_per_level
 

Private Attributes

std::vector< CompressibleAdvectionAdvectiveFluxesPv_
 
int cell_ghost_cell_width_
 
int face_ghost_cell_width_
 
std::shared_ptr< GriddingAlgorithmgridding_
 
std::vector< LevelDatadata_
 
HyperbolicMethod method_
 

Constructor & Destructor Documentation

◆ CompressibleAdvectionIntegratorContext() [1/4]

fub::amrex::CompressibleAdvectionIntegratorContext::CompressibleAdvectionIntegratorContext ( std::shared_ptr< GriddingAlgorithm gridding,
HyperbolicMethod  method 
)

◆ CompressibleAdvectionIntegratorContext() [2/4]

fub::amrex::CompressibleAdvectionIntegratorContext::CompressibleAdvectionIntegratorContext ( std::shared_ptr< GriddingAlgorithm gridding,
HyperbolicMethod  method,
int  cell_gcw,
int  face_gcw 
)

◆ CompressibleAdvectionIntegratorContext() [3/4]

fub::amrex::CompressibleAdvectionIntegratorContext::CompressibleAdvectionIntegratorContext ( const CompressibleAdvectionIntegratorContext )

Deeply copies a context and all its distributed data for all MPI ranks.

◆ CompressibleAdvectionIntegratorContext() [4/4]

fub::amrex::CompressibleAdvectionIntegratorContext::CompressibleAdvectionIntegratorContext ( CompressibleAdvectionIntegratorContext &&  )
default

Member Function Documentation

◆ AccumulateCoarseFineFluxes()

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

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

◆ ApplyBoundaryCondition() [1/2]

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

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.

◆ ApplyBoundaryCondition() [2/2]

void fub::amrex::IntegratorContext::ApplyBoundaryCondition ( int  level,
Direction  dir,
AnyBoundaryCondition bc 
)
inherited

Updates time point and cycle counter for the patch hierarchy.

◆ ApplyFluxCorrection()

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

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

◆ CoarsenConservatively()

void fub::amrex::IntegratorContext::CoarsenConservatively ( int  fine,
int  coarse 
)
inherited

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

◆ CompleteFromCons()

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

Reconstruct complete state variables from conservative ones.

◆ ComputeNumericFluxes()

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

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

◆ ComputeStableDt()

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

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

◆ CopyDataToScratch()

void fub::amrex::IntegratorContext::CopyDataToScratch ( int  level_num)
inherited

Updates time point and cycle counter for the patch hierarchy.

◆ CopyScratchToData()

void fub::amrex::IntegratorContext::CopyScratchToData ( int  level_num)
inherited

Updates time point and cycle counter for the patch hierarchy.

◆ FillGhostLayerSingleLevel() [1/2]

void fub::amrex::IntegratorContext::FillGhostLayerSingleLevel ( int  level)
inherited

Updates time point and cycle counter for the patch hierarchy.

◆ FillGhostLayerSingleLevel() [2/2]

void fub::amrex::IntegratorContext::FillGhostLayerSingleLevel ( int  level,
AnyBoundaryCondition bc 
)
inherited

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

◆ FillGhostLayerTwoLevels() [1/2]

void fub::amrex::IntegratorContext::FillGhostLayerTwoLevels ( int  level,
AnyBoundaryCondition fbc,
int  coarse,
AnyBoundaryCondition cbc 
)
inherited

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

◆ FillGhostLayerTwoLevels() [2/2]

void fub::amrex::IntegratorContext::FillGhostLayerTwoLevels ( int  level,
int  coarse 
)
inherited

Updates time point and cycle counter for the patch hierarchy.

◆ GetAdvectiveFluxes() [1/2]

CompressibleAdvectionAdvectiveFluxes& fub::amrex::CompressibleAdvectionIntegratorContext::GetAdvectiveFluxes ( int  level)

◆ GetAdvectiveFluxes() [2/2]

const CompressibleAdvectionAdvectiveFluxes& fub::amrex::CompressibleAdvectionIntegratorContext::GetAdvectiveFluxes ( int  level) const

◆ GetCounterRegistry()

const std::shared_ptr<CounterRegistry>& fub::amrex::IntegratorContext::GetCounterRegistry ( ) const
noexceptinherited

Returns a shared pointer to the counter registry.

◆ GetCycles()

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

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

◆ GetData() [1/2]

::amrex::MultiFab& fub::amrex::IntegratorContext::GetData ( int  level)
inherited

Returns the MultiFab associated with level data on the specifed level number.

◆ GetData() [2/2]

const ::amrex::MultiFab& fub::amrex::IntegratorContext::GetData ( int  level) const
inherited

Returns the MultiFab associated with level data on the specifed level number.

◆ GetFluxes() [1/2]

::amrex::MultiFab& fub::amrex::IntegratorContext::GetFluxes ( int  level,
Direction  dir 
)
inherited

Returns the MultiFab associated with flux data on the specifed level number and direction.

◆ GetFluxes() [2/2]

const ::amrex::MultiFab& fub::amrex::IntegratorContext::GetFluxes ( int  level,
Direction  dir 
) const
inherited

Returns the MultiFab associated with level data on the specifed level number.

◆ GetGeometry()

const ::amrex::Geometry& fub::amrex::IntegratorContext::GetGeometry ( int  level) const
inherited

Returns the geometry object for the specified refinement level.

◆ GetGriddingAlgorithm()

const std::shared_ptr<GriddingAlgorithm>& fub::amrex::IntegratorContext::GetGriddingAlgorithm ( ) const
noexceptinherited

Returns a shared pointer to the underlying GriddingAlgorithm which owns the simulation.

◆ GetMpiCommunicator()

MPI_Comm fub::amrex::IntegratorContext::GetMpiCommunicator ( ) const
noexceptinherited

Returns the MPI communicator which is associated with this context.

◆ GetPatchHierarchy() [1/2]

const PatchHierarchy& fub::amrex::IntegratorContext::GetPatchHierarchy ( ) const
noexceptinherited

Returns a reference to const PatchHierarchy which is a member of the GriddingAlgorithm.

◆ GetPatchHierarchy() [2/2]

PatchHierarchy& fub::amrex::IntegratorContext::GetPatchHierarchy ( )
noexceptinherited

Returns a reference to PatchHierarchy which is a member of the GriddingAlgorithm.

◆ GetRatioToCoarserLevel() [1/2]

::amrex::IntVect fub::amrex::IntegratorContext::GetRatioToCoarserLevel ( int  level) const
noexceptinherited

Returns the refinement ratio for all directions.

◆ GetRatioToCoarserLevel() [2/2]

int fub::amrex::IntegratorContext::GetRatioToCoarserLevel ( int  level,
Direction  dir 
) const
noexceptinherited

Returns the refinement ratio in the specified direction.

◆ GetScratch() [1/2]

::amrex::MultiFab& fub::amrex::IntegratorContext::GetScratch ( int  level)
inherited

Returns the MultiFab associated with level data with ghost cells on the specifed level number and direction.

◆ GetScratch() [2/2]

const ::amrex::MultiFab& fub::amrex::IntegratorContext::GetScratch ( int  level) const
inherited

Returns the MultiFab associated with level data on the specifed level number.

◆ GetTimePoint()

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

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

◆ LevelExists()

bool fub::amrex::IntegratorContext::LevelExists ( int  level) const
noexceptinherited

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

◆ operator=() [1/2]

CompressibleAdvectionIntegratorContext& fub::amrex::CompressibleAdvectionIntegratorContext::operator= ( CompressibleAdvectionIntegratorContext &&  )
default

◆ operator=() [2/2]

CompressibleAdvectionIntegratorContext fub::amrex::CompressibleAdvectionIntegratorContext::operator= ( const CompressibleAdvectionIntegratorContext )

◆ PostAdvanceHierarchy()

void fub::amrex::IntegratorContext::PostAdvanceHierarchy ( )
inherited

Updates time point and cycle counter for the patch hierarchy.

◆ PostAdvanceLevel()

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

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

◆ PreAdvanceLevel()

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

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

Returns
Returns the coarsest level that changed. This function returns the maximum number of levels if no change happened.

◆ Rank()

int fub::amrex::IntegratorContext::Rank ( ) const
noexceptinherited

Returns a shared pointer to the underlying GriddingAlgorithm which owns the simulation.

◆ ResetCoarseFineFluxes()

void fub::amrex::IntegratorContext::ResetCoarseFineFluxes ( int  fine,
int  coarse 
)
inherited

Resets all accumulates fluxes to zero.

◆ ResetHierarchyConfiguration() [1/2]

void fub::amrex::CompressibleAdvectionIntegratorContext::ResetHierarchyConfiguration ( int  level = 0)
overridevirtual

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.

Reimplemented from fub::amrex::IntegratorContext.

◆ ResetHierarchyConfiguration() [2/2]

void fub::amrex::CompressibleAdvectionIntegratorContext::ResetHierarchyConfiguration ( std::shared_ptr< GriddingAlgorithm gridding)
overridevirtual

Replaces the underlying gridding algorithm with the specified one.

Reimplemented from fub::amrex::IntegratorContext.

◆ SetCycles()

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

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

◆ SetTimePoint()

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

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

◆ UpdateConservatively()

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

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

Member Data Documentation

◆ cell_ghost_cell_width_

int fub::amrex::IntegratorContext::cell_ghost_cell_width_
privateinherited

◆ count_per_level

bool fub::amrex::IntegratorContext::count_per_level
inherited

◆ data_

std::vector<LevelData> fub::amrex::IntegratorContext::data_
privateinherited

◆ face_ghost_cell_width_

int fub::amrex::IntegratorContext::face_ghost_cell_width_
privateinherited

◆ gridding_

std::shared_ptr<GriddingAlgorithm> fub::amrex::IntegratorContext::gridding_
privateinherited

◆ method_

HyperbolicMethod fub::amrex::IntegratorContext::method_
privateinherited

◆ Pv_

std::vector<CompressibleAdvectionAdvectiveFluxes> fub::amrex::CompressibleAdvectionIntegratorContext::Pv_
private

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