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

A BndryData stores and manipulates boundary data information on each side of each box in a BoxArray. More...

#include <AMReX_BndryData.H>

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

Public Types

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

 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 MultiMaskbndryMasks (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 RealTuplebndryLocs (int igrid) const noexcept
 Return physical boundary locations for all faces owned by a grid.
 
const RealTuplebndryLocs (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 BoxgetDomain () const noexcept
 Return domain used to define masks.
 
const GeometrygetGeom () const noexcept
 Return geometry used to define masks.
 
void setValue (Orientation face, int n, Real 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
 
BndryRegisterToperator= (const BndryRegisterT< MF > &src)=delete
 
BndryRegisterToperator= (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 BoxArrayboxes () 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 DistributionMappingDistributionMap () 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).
 

Protected Attributes

LayoutData< Vector< Vector< BoundCond > > > bcond
 Map of boundary condition type specifiers. The outer Array dimension is over Orientation.
 
LayoutData< RealTuplebcloc
 
Vector< MultiMaskmasks
 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
 

Additional Inherited Members

- 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.
 

Detailed Description

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

A BndryData stores and manipulates boundary data information on each side of each box in a BoxArray.

A BndryData contains a BndryRegister about each side of each grid in a Boxarray. These data are used to store information along the outer layer of each grid (at the same level of coarseness), such as the value of boundary conditions there. Also, for each boundary, this class maintains a BoundCond identifier and a location. This "location" often specifies where, in physical space, a value, which is stored in the boundary registers, will be applied by a solver (although interpretation of this information is application-specific).

In addition to boundary condition values, types and locations, and BndryDate object maintains a mask for each boundary value. Given a Geometry describing the physical "domain" of application, a BndryData object fills the mask arrays with a mask value to indicate if the node is outside the domain (outside_domain), or, if not, whether it lays within the valid region of an adjacent grid (covered), or not (not_covered). This mask data is created upon non-default class instantiation.

Member Typedef Documentation

◆ RealTuple

template<typename MF >
using amrex::BndryDataT< MF >::RealTuple = Array<value_type,2*3>

Some useful typedefs.

◆ value_type

template<typename MF >
using amrex::BndryDataT< MF >::value_type = typename MF::value_type

Member Enumeration Documentation

◆ MaskVal

template<typename MF >
enum amrex::BndryDataT::MaskVal

Mask classification used for each boundary cell.

Enumerator
covered 

Location coincides with a valid grid point at the same AMR level.

not_covered 

Location is inside the domain but does not coincide with any valid grid points.

outside_domain 

Location lies outside the physical domain.

NumMaskVals 

Constructor & Destructor Documentation

◆ BndryDataT() [1/4]

template<typename MF >
amrex::BndryDataT< MF >::BndryDataT ( )
defaultnoexcept

Default constructor.

◆ BndryDataT() [2/4]

template<typename MF >
amrex::BndryDataT< MF >::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()

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

destructor

◆ BndryDataT() [3/4]

template<typename MF >
amrex::BndryDataT< MF >::BndryDataT ( const BndryDataT< MF > &  src)
delete

◆ BndryDataT() [4/4]

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

Member Function Documentation

◆ bndryConds() [1/2]

template<typename MF >
const Vector< Vector< BoundCond > > & amrex::BndryDataT< MF >::bndryConds ( const MFIter mfi) const
noexcept

Same as bndryConds(int) but locates the grid via iterator mfi.

◆ bndryConds() [2/2]

template<typename MF >
const Vector< Vector< BoundCond > > & amrex::BndryDataT< MF >::bndryConds ( int  igrid) const
noexcept

Return boundary type specifiers stored for a grid.

Parameters
igridIndex into the level's BoxArray (global grid id owned by this rank).
Returns
Vector per face, containing per-component BoundCond identifiers.

◆ bndryLocs() [1/2]

template<typename MF >
const BndryDataT< MF >::RealTuple & amrex::BndryDataT< MF >::bndryLocs ( const MFIter mfi) const
noexcept

Same as bndryLocs(int) but uses iterator mfi to reference the grid.

◆ bndryLocs() [2/2]

template<typename MF >
const BndryDataT< MF >::RealTuple & amrex::BndryDataT< MF >::bndryLocs ( int  igrid) const
noexcept

Return physical boundary locations for all faces owned by a grid.

Parameters
igridIndex into the level's BoxArray (global grid id owned by this rank).
Returns
Array indexed by Orientation giving the face locations.

◆ bndryMasks()

template<typename MF >
const MultiMask & amrex::BndryDataT< MF >::bndryMasks ( Orientation  face) const
inlinenoexcept

Return the per-face mask built during define() for orientation face.

◆ bndryValues()

template<typename MF >
const FabSetT< MF > & amrex::BndryDataT< MF >::bndryValues ( Orientation  face) const
inlinenoexcept

Access the boundary values stored on orientation face.

◆ define()

template<typename MF >
void amrex::BndryDataT< MF >::define ( const BoxArray grids,
const DistributionMapping dmap,
int  ncomp,
const Geometry geom 
)

Allocate masks and boundary registers for the supplied grids.

Parameters
gridsGrid layout at the current AMR level.
dmapDistribution mapping for the grids.
ncompNumber of boundary components.
geomGeometry describing the physical domain.

◆ getDomain()

template<typename MF >
const Box & amrex::BndryDataT< MF >::getDomain ( ) const
inlinenoexcept

Return domain used to define masks.

◆ getGeom()

template<typename MF >
const Geometry & amrex::BndryDataT< MF >::getGeom ( ) const
inlinenoexcept

Return geometry used to define masks.

◆ nComp()

template<typename MF >
int amrex::BndryDataT< MF >::nComp ( ) const
inlinenoexcept

Return number of components this boundary data manages.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

template<typename MF >
BndryDataT< MF > & amrex::BndryDataT< MF >::operator= ( const BndryDataT< MF > &  src)
delete

◆ operator[]() [1/2]

template<typename MF >
const FabSetT< MF > & amrex::BndryDataT< MF >::operator[] ( Orientation  face) const
inlinenoexcept

Provide access to boundary registers for orientation face.

◆ operator[]() [2/2]

template<typename MF >
FabSetT< MF > & amrex::BndryDataT< MF >::operator[] ( Orientation  face)
inlinenoexcept

Provide mutable access to boundary registers for orientation face.

◆ setBoundCond() [1/2]

template<typename MF >
void amrex::BndryDataT< MF >::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.

◆ setBoundCond() [2/2]

template<typename MF >
void amrex::BndryDataT< MF >::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.

◆ setBoundLoc() [1/2]

template<typename MF >
void amrex::BndryDataT< MF >::setBoundLoc ( Orientation  face,
const MFIter mfi,
value_type  val 
)
noexcept

Set the boundary location value val by MFIter mfi on face face.

◆ setBoundLoc() [2/2]

template<typename MF >
void amrex::BndryDataT< MF >::setBoundLoc ( Orientation  face,
int  n,
value_type  val 
)
noexcept

Set the physical boundary location val for grid index n and face face.

◆ setValue()

template<typename MF >
void amrex::BndryDataT< MF >::setValue ( Orientation  face,
int  n,
Real  val 
)
noexcept

Set all components on boundary face face of grid n to scalar value val.

Member Data Documentation

◆ bcloc

template<typename MF >
LayoutData<RealTuple> amrex::BndryDataT< MF >::bcloc
protected

◆ bcond

template<typename MF >
LayoutData<Vector< Vector<BoundCond> > > amrex::BndryDataT< MF >::bcond
protected

Map of boundary condition type specifiers. The outer Array dimension is over Orientation.

◆ geom

template<typename MF >
Geometry amrex::BndryDataT< MF >::geom
protected

Domain used for mask definitions.

◆ m_defined

template<typename MF >
bool amrex::BndryDataT< MF >::m_defined {false}
protected

◆ m_ncomp

template<typename MF >
int amrex::BndryDataT< MF >::m_ncomp {-1}
protected

◆ masks

template<typename MF >
Vector<MultiMask> amrex::BndryDataT< MF >::masks
protected

Boundary condition mask.


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