Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::MLMGBndryT< MF > Class Template Reference

Boundary helper for MLMG that manages coarse/fine and physical BC metadata. More...

#include <AMReX_MLMGBndry.H>

Inheritance diagram for amrex::MLMGBndryT< MF >:
amrex::InterpBndryDataT< MF > amrex::BndryDataT< MF > amrex::BndryRegisterT< MF >

Public Types

using BCTuple = Array< BoundCond, 2 *3 >
 
using RealTuple = typename BndryDataT< MF >::RealTuple
 
- Public Types inherited from amrex::InterpBndryDataT< MF >
using value_type = typename MF::value_type
 
- Public Types inherited from amrex::BndryDataT< MF >
enum  MaskVal { covered = 0 , not_covered = 1 , outside_domain = 2 , NumMaskVals = 3 }
 Mask classification used for each boundary cell. More...
 
using value_type = typename MF::value_type
 
using RealTuple = Array< value_type, 2 *3 >
 Some useful typedefs.
 
- Public Types inherited from amrex::BndryRegisterT< MF >
using value_type = typename MF::value_type
 

Public Member Functions

 MLMGBndryT (const BoxArray &_grids, const DistributionMapping &_dmap, int _ncomp, const Geometry &_geom)
 Allocate BC metadata for _grids/_geom.
 
 ~MLMGBndryT ()=default
 
 MLMGBndryT (MLMGBndryT< MF > &&rhs)=delete
 
 MLMGBndryT (const MLMGBndryT< MF > &rhs)=delete
 
MLMGBndryT< MF > & operator= (const MLMGBndryT< MF > &rhs)=delete
 
MLMGBndryT< MF > & operator= (MLMGBndryT< MF > &&rhs)=delete
 
void setLOBndryConds (const Vector< Array< LinOpBCType, 3 > > &lo, const Vector< Array< LinOpBCType, 3 > > &hi, int ratio, const RealVect &a_loc, LinOpBCType a_crse_fine_bc_type=LinOpBCType::Dirichlet)
 Populate BC tags at coarse/fine and physical boundaries for an integer refinement ratio.
 
void setLOBndryConds (const Vector< Array< LinOpBCType, 3 > > &lo, const Vector< Array< LinOpBCType, 3 > > &hi, IntVect const &ratio, const RealVect &a_loc, LinOpBCType a_crse_fine_bc_type=LinOpBCType::Dirichlet)
 Populate BC tags at coarse/fine and physical boundaries for anisotropic refinement ratios.
 
- Public Member Functions inherited from amrex::InterpBndryDataT< MF >
 InterpBndryDataT () noexcept=default
 default constructor
 
 InterpBndryDataT (const BoxArray &_grids, const DistributionMapping &_dmap, int _ncomp, const Geometry &geom)
 constructor for given BoxArray, etc
 
 ~InterpBndryDataT ()=default
 
 InterpBndryDataT (const InterpBndryDataT< MF > &rhs)=delete
 
 InterpBndryDataT (InterpBndryDataT< MF > &&rhs)=delete
 
InterpBndryDataT< MF > & operator= (const InterpBndryDataT< MF > &rhs)=delete
 
InterpBndryDataT< MF > & operator= (InterpBndryDataT< MF > &&rhs)=delete
 
void setPhysBndryValues (const MF &mf, int mf_start, int bnd_start, int num_comp)
 Set bndry values at physical boundaries.
 
void setBndryValues (BndryRegisterT< MF > const &crse, int c_start, const MF &fine, int f_start, int bnd_start, int num_comp, const IntVect &ratio, int max_order=IBD_max_order_DEF, int max_width=2)
 Sset bndry values at coarse/fine and physical boundaries.
 
void updateBndryValues (BndryRegisterT< MF > &crse, int c_start, int bnd_start, int num_comp, const IntVect &ratio, int max_order=IBD_max_order_DEF, int max_width=2)
 Update boundary values at coarse/fine boundaries.
 
void setHomogValues ()
 Set boundary values to zero.
 
- Public Member Functions inherited from amrex::BndryDataT< MF >
 BndryDataT () noexcept=default
 Default constructor.
 
 BndryDataT (const BoxArray &grids, const DistributionMapping &dmap, int ncomp, const Geometry &geom)
 constructor specifying number of components and box of physical domain (cell-centered)
 
 ~BndryDataT ()=default
 destructor
 
 BndryDataT (const BndryDataT< MF > &src)=delete
 
 BndryDataT (BndryDataT< MF > &&rhs)=delete
 
BndryDataT< MF > & operator= (const BndryDataT< MF > &src)=delete
 
BndryDataT< MF > & operator= (BndryDataT< MF > &&rhs)=delete
 
void define (const BoxArray &grids, const DistributionMapping &dmap, int ncomp, const Geometry &geom)
 Allocate masks and boundary registers for the supplied grids.
 
const MultiMask & bndryMasks (Orientation face) const noexcept
 Return the per-face mask built during define() for orientation face.
 
const FabSetT< MF > & bndryValues (Orientation face) const noexcept
 Access the boundary values stored on orientation face.
 
const RealTuple & bndryLocs (int igrid) const noexcept
 Return physical boundary locations for all faces owned by a grid.
 
const RealTuple & bndryLocs (const MFIter &mfi) const noexcept
 Same as bndryLocs(int) but uses iterator mfi to reference the grid.
 
const Vector< Vector< BoundCond > > & bndryConds (int igrid) const noexcept
 Return boundary type specifiers stored for a grid.
 
const Vector< Vector< BoundCond > > & bndryConds (const MFIter &mfi) const noexcept
 Same as bndryConds(int) but locates the grid via iterator mfi.
 
int nComp () const noexcept
 Return number of components this boundary data manages.
 
const Box & getDomain () const noexcept
 Return domain used to define masks.
 
const Geometry & getGeom () const noexcept
 Return geometry used to define masks.
 
void setValue (Orientation face, int n, value_type val) noexcept
 Set all components on boundary face face of grid n to scalar value val.
 
void setBoundCond (Orientation face, int n, int comp, const BoundCond &bcn) noexcept
 Set boundary type at grid index n, component comp, and face face to bcn.
 
void setBoundCond (Orientation face, const MFIter &mfi, int comp, const BoundCond &bcn) noexcept
 Set boundary type using MFIter mfi to identify the grid, component comp, and identifier bcn.
 
void setBoundLoc (Orientation face, int n, value_type val) noexcept
 Set the physical boundary location val for grid index n and face face.
 
void setBoundLoc (Orientation face, const MFIter &mfi, value_type val) noexcept
 Set the boundary location value val by MFIter mfi on face face.
 
const FabSetT< MF > & operator[] (Orientation face) const noexcept
 Provide access to boundary registers for orientation face.
 
FabSetT< MF > & operator[] (Orientation face) noexcept
 Provide mutable access to boundary registers for orientation face.
 
- Public Member Functions inherited from amrex::BndryRegisterT< MF >
 BndryRegisterT () noexcept=default
 The default constructor.
 
 BndryRegisterT (const BoxArray &grids_, const DistributionMapping &dmap, int in_rad, int out_rad, int extent_rad, int ncomp)
 The constructor, given number of cells in/out, extent and number of components (assumes cell-centered boxes, and allocates cell-centered FABs)
 
 ~BndryRegisterT ()=default
 The destructor.
 
 BndryRegisterT (BndryRegisterT< MF > &&rhs) noexcept=default
 
 BndryRegisterT (const BndryRegisterT< MF > &src)=delete
 
BndryRegisterT & operator= (const BndryRegisterT< MF > &src)=delete
 
BndryRegisterT & operator= (BndryRegisterT< MF > &&rhs)=delete
 
void define (const BoxArray &grids_, const DistributionMapping &dmap, int in_rad, int out_rad, int extent_rad, int ncomp)
 Allocate boundary FabSets for all faces.
 
void define (Orientation face, IndexType typ, int in_rad, int out_rad, int extent_rad, int ncomp, const DistributionMapping &dm)
 Build FABs along a particular face orientation.
 
void clear ()
 Release all FABs and clear the associated BoxArray.
 
const BoxArray & boxes () const noexcept
 Get box domain (as an array of boxes).
 
int size () const noexcept
 Return the number of grids in this domain.
 
const FabSetT< MF > & operator[] (Orientation face) const noexcept
 Return const set of FABs bounding the domain grid boxes on orientation face.
 
FabSetT< MF > & operator[] (Orientation face) noexcept
 Return set of FABs bounding the domain grid boxes on orientation face.
 
void setVal (value_type v)
 Set all boundary FABs to the scalar value v across every component.
 
BndryRegisterT< MF > & operator+= (const BndryRegisterT< MF > &rhs)
 Accumulate another register with identical layout into this one.
 
BndryRegisterT< MF > & plus (const BndryRegisterT< MF > &rhs)
 Convenience alias for operator+=.
 
BndryRegisterT< MF > & copyFrom (const MF &src, int nghost, int src_comp, int dest_comp, int num_comp, const Periodicity &period=Periodicity::NonPeriodic())
 Fill boundary FABs with num_comp components copied from src (component src_comp) into dest_comp, sampling nghost layers and honoring period.
 
BndryRegisterT< MF > & plusFrom (const MF &src, int nghost, int src_comp, int dest_comp, int num_comp, const Periodicity &period=Periodicity::NonPeriodic())
 Increment boundary FABs with num_comp components from src, using the same arguments as copyFrom().
 
BndryRegisterT< MF > & linComb (value_type a, const MF &mfa, int a_comp, value_type b, const MF &mfb, int b_comp, int dest_comp, int num_comp, int n_ghost=0)
 Linear combination: this := a * mfa + b * mfb on the boundary, using components a_comp/b_comp and writing to dest_comp for num_comp entries with n_ghost layers.
 
void setBoxes (const BoxArray &grids)
 Set the BoxArray domain to grids once prior to calling define().
 
const DistributionMapping & DistributionMap () const noexcept
 Returns the DistributionMapping describing which MPI ranks own each boundary FAB.
 
void write (const std::string &name, std::ostream &os) const
 Write all FabSets to disk (used for checkpoint data).
 
void read (const std::string &name, std::istream &is)
 Read all FabSets from disk (used for checkpoint data).
 

Static Public Member Functions

static void setBoxBC (RealTuple &bloc, BCTuple &bctag, const Box &bx, const Box &domain, const Array< LinOpBCType, 3 > &lo, const Array< LinOpBCType, 3 > &hi, const Real *dx, IntVect const &ratio, const RealVect &interior_bloc, const Array< Real, 3 > &domain_bloc_lo, const Array< Real, 3 > &domain_bloc_hi, const GpuArray< int, 3 > &is_periodic, LinOpBCType a_crse_fine_bc_type)
 Helper that sets up BC tuples for a single box.
 
- Static Public Member Functions inherited from amrex::BndryRegisterT< MF >
static void Copy (BndryRegisterT< MF > &dst, const BndryRegisterT< MF > &src)
 Local copy function for duplicating boundary registers.
 

Additional Inherited Members

- Static Public Attributes inherited from amrex::InterpBndryDataT< MF >
static constexpr int IBD_max_order_DEF = 3
 
- Protected Attributes inherited from amrex::BndryDataT< MF >
LayoutData< Vector< Vector< BoundCond > > > bcond
 Map of boundary condition type specifiers. The outer Array dimension is over Orientation.
 
LayoutData< RealTuple > bcloc
 
Vector< MultiMask > masks
 Boundary condition mask.
 
Geometry geom
 Domain used for mask definitions.
 
int m_ncomp {-1}
 
bool m_defined {false}
 
- Protected Attributes inherited from amrex::BndryRegisterT< MF >
FabSetT< MF > bndry [2 *3]
 The data.
 
BoxArray grids
 

Detailed Description

template<typename MF>
class amrex::MLMGBndryT< MF >

Boundary helper for MLMG that manages coarse/fine and physical BC metadata.

Member Typedef Documentation

◆ BCTuple

template<typename MF >
using amrex::MLMGBndryT< MF >::BCTuple = Array<BoundCond,2* 3 >

◆ RealTuple

template<typename MF >
using amrex::MLMGBndryT< MF >::RealTuple = typename BndryDataT<MF>::RealTuple

Constructor & Destructor Documentation

◆ MLMGBndryT() [1/3]

template<typename MF >
amrex::MLMGBndryT< MF >::MLMGBndryT ( const BoxArray &  _grids,
const DistributionMapping &  _dmap,
int  _ncomp,
const Geometry &  _geom 
)

Allocate BC metadata for _grids/_geom.

Parameters
_gridsGrid array whose ghost faces require BCs.
_dmapDistribution mapping for the grids.
_ncompNumber of components handled.
_geomGeometry describing the domain.

◆ ~MLMGBndryT()

template<typename MF >
amrex::MLMGBndryT< MF >::~MLMGBndryT ( )
default

◆ MLMGBndryT() [2/3]

template<typename MF >
amrex::MLMGBndryT< MF >::MLMGBndryT ( MLMGBndryT< MF > &&  rhs)
delete

◆ MLMGBndryT() [3/3]

template<typename MF >
amrex::MLMGBndryT< MF >::MLMGBndryT ( const MLMGBndryT< MF > &  rhs)
delete

Member Function Documentation

◆ operator=() [1/2]

template<typename MF >
MLMGBndryT< MF > & amrex::MLMGBndryT< MF >::operator= ( const MLMGBndryT< MF > &  rhs)
delete

◆ operator=() [2/2]

template<typename MF >
MLMGBndryT< MF > & amrex::MLMGBndryT< MF >::operator= ( MLMGBndryT< MF > &&  rhs)
delete

◆ setBoxBC()

template<typename MF >
void amrex::MLMGBndryT< MF >::setBoxBC ( RealTuple &  bloc,
BCTuple &  bctag,
const Box &  bx,
const Box &  domain,
const Array< LinOpBCType, 3 > &  lo,
const Array< LinOpBCType, 3 > &  hi,
const Real *  dx,
IntVect const &  ratio,
const RealVect &  interior_bloc,
const Array< Real, 3 > &  domain_bloc_lo,
const Array< Real, 3 > &  domain_bloc_hi,
const GpuArray< int, 3 > &  is_periodic,
LinOpBCType  a_crse_fine_bc_type 
)
static

Helper that sets up BC tuples for a single box.

Parameters
blocOutput BC offsets (distance to boundary).
bctagOutput BC tags.
bxTarget box.
domainDomain bounding box.
loLow-side BC types.
hiHigh-side BC types.
dxCell size array.
ratioRefinement ratio relative to the interior.
interior_blocDistance from the coarse/fine boundary face to the boundary data.
domain_bloc_loLow-side offsets for domain boundaries.
domain_bloc_hiHigh-side offsets for domain boundaries.
is_periodicPeriodicity mask.
a_crse_fine_bc_typeType imposed at coarse/fine interfaces.

◆ setLOBndryConds() [1/2]

template<typename MF >
void amrex::MLMGBndryT< MF >::setLOBndryConds ( const Vector< Array< LinOpBCType, 3 > > &  lo,
const Vector< Array< LinOpBCType, 3 > > &  hi,
int  ratio,
const RealVect &  a_loc,
LinOpBCType  a_crse_fine_bc_type = LinOpBCType::Dirichlet 
)

Populate BC tags at coarse/fine and physical boundaries for an integer refinement ratio.

Parameters
loPer-level low-side BC types.
hiPer-level high-side BC types.
ratioRefinement ratio between coarse/fine.
a_locDistance from the coarse/fine boundary face to the coarse/fine boundary data.
a_crse_fine_bc_typeType imposed at coarse/fine interfaces.

◆ setLOBndryConds() [2/2]

template<typename MF >
void amrex::MLMGBndryT< MF >::setLOBndryConds ( const Vector< Array< LinOpBCType, 3 > > &  lo,
const Vector< Array< LinOpBCType, 3 > > &  hi,
IntVect const &  ratio,
const RealVect &  a_loc,
LinOpBCType  a_crse_fine_bc_type = LinOpBCType::Dirichlet 
)

Populate BC tags at coarse/fine and physical boundaries for anisotropic refinement ratios.

Parameters
loPer-level low-side BC types.
hiPer-level high-side BC types.
ratioDirectional refinement ratios.
a_locDistance from the coarse/fine boundary face to the coarse/fine boundary data.
a_crse_fine_bc_typeType imposed at coarse/fine interfaces.

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