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

This class modifies and initializes a PatchLevel in a PatchHierarchy. More...

#include <GriddingAlgorithm.hpp>

Public Member Functions

Constructors
 GriddingAlgorithm ()
 Constructs an empty and invalid GriddingAlgorithm. More...
 
 GriddingAlgorithm (PatchHierarchy hier, AnyInitialData initial_data, AnyTaggingMethod tagging, AnyBoundaryCondition boundary=AnyBoundaryCondition())
 Constructs a gridding algorithm and defines all customization points. More...
 
 GriddingAlgorithm (const GriddingAlgorithm &other)
 The copy constructor makes a deep copy of the all data for each MPI rank. More...
 
GriddingAlgorithmoperator= (const GriddingAlgorithm &other)
 The copy assignment makes a deep copy of the all data for each MPI rank. More...
 
 GriddingAlgorithm (GriddingAlgorithm &&other) noexcept=default
 The move constructor moves a gridding algorithm without allocating any memory. More...
 
GriddingAlgorithmoperator= (GriddingAlgorithm &&other) noexcept=default
 The move assignment moves a gridding algorithm without allocating any memory. More...
 
 ~GriddingAlgorithm () noexcept override=default
 Constructs an empty and invalid GriddingAlgorithm. More...
 
Accessors
PatchHierarchyGetPatchHierarchy () noexcept
 
const PatchHierarchyGetPatchHierarchy () const noexcept
 
const AnyBoundaryConditionGetBoundaryCondition () const noexcept
 
AnyBoundaryConditionGetBoundaryCondition () noexcept
 
const AnyInitialDataGetInitialCondition () const noexcept
 
const AnyTaggingMethodGetTagging () const noexcept
 
Observers
std::ptrdiff_t GetCycles () const noexcept
 Returns the number of time steps taken on the coarsest refinement level. More...
 
Duration GetTimePoint () const noexcept
 Returns the current time point on the coarsest refinement level. More...
 
Modifiers
int RegridAllFinerlevels (int which_level)
 Attempt to regrid all finer level than the specified which_level. More...
 
void InitializeHierarchy (double level_time=0.0)
 Initializes the underlying patch hierarchy using the stored initial data method. More...
 
Actions
void FillMultiFabFromLevel (::amrex::MultiFab &mf, int level_number)
 Fill the ghost layer boundary specified of the specifed MultiFab mf. More...
 
void FillMultiFabFromLevel (::amrex::MultiFab &mf, int level_number, AnyBoundaryCondition &bc)
 Fill the ghost layer boundary specified of the specifed MultiFab mf. More...
 

Private Member Functions

void ErrorEst (int level, ::amrex::TagBoxArray &tags, double time_point, int) override
 
void MakeNewLevelFromScratch (int level, double time_point, const ::amrex::BoxArray &box_array, const ::amrex::DistributionMapping &distribution_mapping) override
 
void MakeNewLevelFromCoarse (int level, double time_point, const ::amrex::BoxArray &box_array, const ::amrex::DistributionMapping &distribution_mapping) override
 
void RemakeLevel (int level, double time_point, const ::amrex::BoxArray &box_array, const ::amrex::DistributionMapping &distribution_mapping) override
 
void ClearLevel ([[maybe_unused]] int level) override
 

Private Attributes

PatchHierarchy hierarchy_
 
AnyInitialData initial_data_
 
AnyTaggingMethod tagging_
 
AnyBoundaryCondition boundary_condition_
 

Detailed Description

This class modifies and initializes a PatchLevel in a PatchHierarchy.

Constructor & Destructor Documentation

◆ GriddingAlgorithm() [1/4]

fub::amrex::GriddingAlgorithm::GriddingAlgorithm ( )

Constructs an empty and invalid GriddingAlgorithm.

◆ GriddingAlgorithm() [2/4]

fub::amrex::GriddingAlgorithm::GriddingAlgorithm ( PatchHierarchy  hier,
AnyInitialData  initial_data,
AnyTaggingMethod  tagging,
AnyBoundaryCondition  boundary = AnyBoundaryCondition() 
)

Constructs a gridding algorithm and defines all customization points.

Parameters
hierThe base PatchHierarchy that will be modified. It also contains options that influence the box generation step.
initial_dataAn InitialCondition policy object
taggingA tagging routine masks cells that need further refinement.
boundaryThe boundary condition fills the ghost layer for physical domain boundary.
Exceptions
Throwsstd::bad_alloc if a memory allocation fails.

◆ GriddingAlgorithm() [3/4]

fub::amrex::GriddingAlgorithm::GriddingAlgorithm ( const GriddingAlgorithm other)

The copy constructor makes a deep copy of the all data for each MPI rank.

◆ GriddingAlgorithm() [4/4]

fub::amrex::GriddingAlgorithm::GriddingAlgorithm ( GriddingAlgorithm &&  other)
defaultnoexcept

The move constructor moves a gridding algorithm without allocating any memory.

◆ ~GriddingAlgorithm()

fub::amrex::GriddingAlgorithm::~GriddingAlgorithm ( )
overridedefaultnoexcept

Constructs an empty and invalid GriddingAlgorithm.

Member Function Documentation

◆ ClearLevel()

void fub::amrex::GriddingAlgorithm::ClearLevel ( [[maybe_unused] ] int  level)
overrideprivate

◆ ErrorEst()

void fub::amrex::GriddingAlgorithm::ErrorEst ( int  level,
::amrex::TagBoxArray &  tags,
double  time_point,
int   
)
overrideprivate

◆ FillMultiFabFromLevel() [1/2]

void fub::amrex::GriddingAlgorithm::FillMultiFabFromLevel ( ::amrex::MultiFab &  mf,
int  level_number 
)

Fill the ghost layer boundary specified of the specifed MultiFab mf.

◆ FillMultiFabFromLevel() [2/2]

void fub::amrex::GriddingAlgorithm::FillMultiFabFromLevel ( ::amrex::MultiFab &  mf,
int  level_number,
AnyBoundaryCondition bc 
)

Fill the ghost layer boundary specified of the specifed MultiFab mf.

◆ GetBoundaryCondition() [1/2]

const AnyBoundaryCondition& fub::amrex::GriddingAlgorithm::GetBoundaryCondition ( ) const
noexcept

◆ GetBoundaryCondition() [2/2]

AnyBoundaryCondition& fub::amrex::GriddingAlgorithm::GetBoundaryCondition ( )
noexcept

◆ GetCycles()

std::ptrdiff_t fub::amrex::GriddingAlgorithm::GetCycles ( ) const
inlinenoexcept

Returns the number of time steps taken on the coarsest refinement level.

◆ GetInitialCondition()

const AnyInitialData& fub::amrex::GriddingAlgorithm::GetInitialCondition ( ) const
noexcept

◆ GetPatchHierarchy() [1/2]

const PatchHierarchy& fub::amrex::GriddingAlgorithm::GetPatchHierarchy ( ) const
inlinenoexcept

◆ GetPatchHierarchy() [2/2]

PatchHierarchy& fub::amrex::GriddingAlgorithm::GetPatchHierarchy ( )
inlinenoexcept

◆ GetTagging()

const AnyTaggingMethod& fub::amrex::GriddingAlgorithm::GetTagging ( ) const
noexcept

◆ GetTimePoint()

Duration fub::amrex::GriddingAlgorithm::GetTimePoint ( ) const
inlinenoexcept

Returns the current time point on the coarsest refinement level.

◆ InitializeHierarchy()

void fub::amrex::GriddingAlgorithm::InitializeHierarchy ( double  level_time = 0.0)

Initializes the underlying patch hierarchy using the stored initial data method.

Note
This function might recreate a refinement level if nesting conditions are violated upon creating a new refinement level. This implies that the initial condition might be called multiple times for one refinement level.

◆ MakeNewLevelFromCoarse()

void fub::amrex::GriddingAlgorithm::MakeNewLevelFromCoarse ( int  level,
double  time_point,
const ::amrex::BoxArray &  box_array,
const ::amrex::DistributionMapping &  distribution_mapping 
)
overrideprivate

◆ MakeNewLevelFromScratch()

void fub::amrex::GriddingAlgorithm::MakeNewLevelFromScratch ( int  level,
double  time_point,
const ::amrex::BoxArray &  box_array,
const ::amrex::DistributionMapping &  distribution_mapping 
)
overrideprivate

◆ operator=() [1/2]

GriddingAlgorithm& fub::amrex::GriddingAlgorithm::operator= ( const GriddingAlgorithm other)

The copy assignment makes a deep copy of the all data for each MPI rank.

◆ operator=() [2/2]

GriddingAlgorithm& fub::amrex::GriddingAlgorithm::operator= ( GriddingAlgorithm &&  other)
defaultnoexcept

The move assignment moves a gridding algorithm without allocating any memory.

◆ RegridAllFinerlevels()

int fub::amrex::GriddingAlgorithm::RegridAllFinerlevels ( int  which_level)

Attempt to regrid all finer level than the specified which_level.

Returns
Returns the coarsest level which was regrid. If no level changed this function returns the maximum number of levels.

◆ RemakeLevel()

void fub::amrex::GriddingAlgorithm::RemakeLevel ( int  level,
double  time_point,
const ::amrex::BoxArray &  box_array,
const ::amrex::DistributionMapping &  distribution_mapping 
)
overrideprivate

Member Data Documentation

◆ boundary_condition_

AnyBoundaryCondition fub::amrex::GriddingAlgorithm::boundary_condition_
private

◆ hierarchy_

PatchHierarchy fub::amrex::GriddingAlgorithm::hierarchy_
private

◆ initial_data_

AnyInitialData fub::amrex::GriddingAlgorithm::initial_data_
private

◆ tagging_

AnyTaggingMethod fub::amrex::GriddingAlgorithm::tagging_
private

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