Block-Structured AMR Software Framework
amrex::BndryRegisterT< MF > Class Template Reference

A BndryRegister organizes FabSets bounding each grid in a BoxArray. A FabSet is maintained for each boundary orientation, as well as the BoxArray domain of definition. More...

#include <AMReX_BndryRegister.H>

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

Public Types

using value_type = typename MF::value_type
 

Public Member Functions

 BndryRegisterT () noexcept=default
 The default constructor. More...
 
 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) More...
 
 ~BndryRegisterT ()=default
 The destructor. More...
 
 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)
 
void define (Orientation face, IndexType typ, int in_rad, int out_rad, int extent_rad, int ncomp, const DistributionMapping &dm)
 Build FABs along given face, specifying the DistributionMapping. More...
 
void clear ()
 
const BoxArrayboxes () const noexcept
 Get box domain (as an array of boxes). More...
 
int size () const noexcept
 Return the number of grids in this domain. More...
 
const FabSetT< MF > & operator[] (Orientation face) const noexcept
 Return const set of FABs bounding the domain grid boxes on a given orientation. More...
 
FabSetT< MF > & operator[] (Orientation face) noexcept
 Return set of FABs bounding the domain grid boxes on a given orientation. More...
 
void setVal (value_type v)
 Set all boundary FABs to given value. More...
 
BndryRegisterT< MF > & operator+= (const BndryRegisterT< MF > &rhs)
 register += rhs More...
 
BndryRegisterT< MF > & plus (const BndryRegisterT< MF > &rhs)
 
BndryRegisterT< MF > & copyFrom (const MF &src, int nghost, int src_comp, int dest_comp, int num_comp, const Periodicity &period=Periodicity::NonPeriodic())
 Fill the boundary FABs on intersection with given MF. More...
 
BndryRegisterT< MF > & plusFrom (const MF &src, int nghost, int src_comp, int dest_comp, int num_comp, const Periodicity &period=Periodicity::NonPeriodic())
 Increment the boundary FABs on intersect with given MF. More...
 
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 intersection of MFs with the boundary FABs. More...
 
void setBoxes (const BoxArray &grids)
 Set box domain, if not set previously. More...
 
const DistributionMappingDistributionMap () const noexcept
 Returns constant reference to associated DistributionMapping. More...
 
void write (const std::string &name, std::ostream &os) const
 Write (used for writing to checkpoint) More...
 
void read (const std::string &name, std::istream &is)
 Read (used for reading from checkpoint) More...
 

Static Public Member Functions

static void Copy (BndryRegisterT< MF > &dst, const BndryRegisterT< MF > &src)
 Local copy function. More...
 

Protected Attributes

FabSetT< MF > bndry [2 *AMREX_SPACEDIM]
 The data. More...
 
BoxArray grids
 

Detailed Description

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

A BndryRegister organizes FabSets bounding each grid in a BoxArray. A FabSet is maintained for each boundary orientation, as well as the BoxArray domain of definition.

A BndryRegister object contains a list of FabSets bounding the grids in a BoxArray. The FabSet FABs are at the same refinement level as the grids they bound, and are accessed and modified via a variety of member functions.

Non-default instantiation allocates a set of FABs, grown into and out of the bounding surfaces of each box in the BoxArray. The width of the layer (in/out), as well as the "extent" of a bounding FABs (the number of nodes beyond the box boundaries, parallel to the grid surface) are determined by constructor argument. All boxes and FABs in this context are assumed to be cell-centered.

A small number of linear mathematical operations are provided for BndryRegisters, as well as overloaded [] operators for access based on grid boundary orientation. The BoxArray domain of definition is accessible, but not resettable,

Member Typedef Documentation

◆ value_type

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

Constructor & Destructor Documentation

◆ BndryRegisterT() [1/4]

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

The default constructor.

◆ BndryRegisterT() [2/4]

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

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

The destructor.

◆ BndryRegisterT() [3/4]

template<typename MF >
amrex::BndryRegisterT< MF >::BndryRegisterT ( BndryRegisterT< MF > &&  rhs)
defaultnoexcept

◆ BndryRegisterT() [4/4]

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

Member Function Documentation

◆ boxes()

template<typename MF >
const BoxArray& amrex::BndryRegisterT< MF >::boxes ( ) const
inlinenoexcept

Get box domain (as an array of boxes).

◆ clear()

template<typename MF >
void amrex::BndryRegisterT< MF >::clear

◆ Copy()

template<typename MF >
void amrex::BndryRegisterT< MF >::Copy ( BndryRegisterT< MF > &  dst,
const BndryRegisterT< MF > &  src 
)
static

Local copy function.

◆ copyFrom()

template<typename MF >
BndryRegisterT< MF > & amrex::BndryRegisterT< MF >::copyFrom ( const MF &  src,
int  nghost,
int  src_comp,
int  dest_comp,
int  num_comp,
const Periodicity period = Periodicity::NonPeriodic() 
)

Fill the boundary FABs on intersection with given MF.

◆ define() [1/2]

template<typename MF >
void amrex::BndryRegisterT< MF >::define ( const BoxArray grids_,
const DistributionMapping dmap,
int  in_rad,
int  out_rad,
int  extent_rad,
int  ncomp 
)

◆ define() [2/2]

template<typename MF >
void amrex::BndryRegisterT< MF >::define ( Orientation  face,
IndexType  typ,
int  in_rad,
int  out_rad,
int  extent_rad,
int  ncomp,
const DistributionMapping dm 
)

Build FABs along given face, specifying the DistributionMapping.

◆ DistributionMap()

template<typename MF >
const DistributionMapping& amrex::BndryRegisterT< MF >::DistributionMap ( ) const
inlinenoexcept

Returns constant reference to associated DistributionMapping.

◆ linComb()

template<typename MF >
BndryRegisterT< MF > & amrex::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 intersection of MFs with the boundary FABs.

◆ operator+=()

template<typename MF >
BndryRegisterT< MF > & amrex::BndryRegisterT< MF >::operator+= ( const BndryRegisterT< MF > &  rhs)

register += rhs

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator[]() [1/2]

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

Return const set of FABs bounding the domain grid boxes on a given orientation.

◆ operator[]() [2/2]

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

Return set of FABs bounding the domain grid boxes on a given orientation.

◆ plus()

template<typename MF >
BndryRegisterT< MF > & amrex::BndryRegisterT< MF >::plus ( const BndryRegisterT< MF > &  rhs)

◆ plusFrom()

template<typename MF >
BndryRegisterT< MF > & amrex::BndryRegisterT< MF >::plusFrom ( const MF &  src,
int  nghost,
int  src_comp,
int  dest_comp,
int  num_comp,
const Periodicity period = Periodicity::NonPeriodic() 
)

Increment the boundary FABs on intersect with given MF.

◆ read()

template<typename MF >
void amrex::BndryRegisterT< MF >::read ( const std::string &  name,
std::istream &  is 
)

Read (used for reading from checkpoint)

◆ setBoxes()

template<typename MF >
void amrex::BndryRegisterT< MF >::setBoxes ( const BoxArray grids)

Set box domain, if not set previously.

◆ setVal()

template<typename MF >
void amrex::BndryRegisterT< MF >::setVal ( value_type  v)

Set all boundary FABs to given value.

◆ size()

template<typename MF >
int amrex::BndryRegisterT< MF >::size ( ) const
inlinenoexcept

Return the number of grids in this domain.

◆ write()

template<typename MF >
void amrex::BndryRegisterT< MF >::write ( const std::string &  name,
std::ostream &  os 
) const

Write (used for writing to checkpoint)

Member Data Documentation

◆ bndry

template<typename MF >
FabSetT<MF> amrex::BndryRegisterT< MF >::bndry[2 *AMREX_SPACEDIM]
protected

The data.

◆ grids

template<typename MF >
BoxArray amrex::BndryRegisterT< MF >::grids
protected

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