Block-Structured AMR Software Framework
amrex::BndryRegister Class 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::BndryRegister:
amrex::BndryData amrex::FluxRegister amrex::InterpBndryData amrex::MacBndry amrex::MLMGBndry

Public Member Functions

 BndryRegister () noexcept
 The default constructor. More...
 
 BndryRegister (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...
 
 BndryRegister (const BndryRegister &src)
 The copy constructor. More...
 
BndryRegisteroperator= (const BndryRegister &src)
 The copy assignment operator. More...
 
virtual ~BndryRegister ()
 The destructor. More...
 
 BndryRegister (BndryRegister &&rhs) noexcept=default
 
BndryRegisteroperator= (BndryRegister &&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 FabSetoperator[] (Orientation face) const noexcept
 Return const set of FABs bounding the domain grid boxes on a given orientation. More...
 
FabSetoperator[] (Orientation face) noexcept
 Return set of FABs bounding the domain grid boxes on a given orientation. More...
 
void setVal (Real v)
 Set all boundary FABs to given value. More...
 
BndryRegisteroperator+= (const BndryRegister &rhs)
 register += rhs More...
 
BndryRegisterplus (const BndryRegister &rhs)
 
BndryRegistercopyFrom (const MultiFab &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 MultiFab. More...
 
BndryRegisterplusFrom (const MultiFab &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 MultiFab. More...
 
BndryRegisterlinComb (Real a, const MultiFab &mfa, int a_comp, Real b, const MultiFab &mfb, int b_comp, int dest_comp, int num_comp, int n_ghost=0)
 Linear combination: this := a*mfa + b*mfb on intersection of MultiFabs 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...
 
void init (const BndryRegister &src)
 Used by the copy constructor and assignment operator. More...
 

Static Public Member Functions

static void Copy (BndryRegister &dst, const BndryRegister &src)
 Local copy function. More...
 

Protected Attributes

FabSet bndry [2 *AMREX_SPACEDIM]
 The data. More...
 
BoxArray grids
 

Detailed Description

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,

Constructor & Destructor Documentation

◆ BndryRegister() [1/4]

amrex::BndryRegister::BndryRegister ( )
noexcept

The default constructor.

◆ BndryRegister() [2/4]

amrex::BndryRegister::BndryRegister ( 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)

◆ BndryRegister() [3/4]

amrex::BndryRegister::BndryRegister ( const BndryRegister src)

The copy constructor.

◆ ~BndryRegister()

amrex::BndryRegister::~BndryRegister ( )
virtual

The destructor.

◆ BndryRegister() [4/4]

amrex::BndryRegister::BndryRegister ( BndryRegister &&  rhs)
defaultnoexcept

Member Function Documentation

◆ boxes()

const BoxArray& amrex::BndryRegister::boxes ( ) const
inlinenoexcept

Get box domain (as an array of boxes).

◆ clear()

void amrex::BndryRegister::clear ( )

◆ Copy()

void amrex::BndryRegister::Copy ( BndryRegister dst,
const BndryRegister src 
)
static

Local copy function.

◆ copyFrom()

BndryRegister & amrex::BndryRegister::copyFrom ( const MultiFab 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 MultiFab.

◆ define() [1/2]

void amrex::BndryRegister::define ( const BoxArray grids_,
const DistributionMapping dmap,
int  in_rad,
int  out_rad,
int  extent_rad,
int  ncomp 
)

◆ define() [2/2]

void amrex::BndryRegister::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()

const DistributionMapping& amrex::BndryRegister::DistributionMap ( ) const
inlinenoexcept

Returns constant reference to associated DistributionMapping.

◆ init()

void amrex::BndryRegister::init ( const BndryRegister src)

Used by the copy constructor and assignment operator.

◆ linComb()

BndryRegister & amrex::BndryRegister::linComb ( Real  a,
const MultiFab mfa,
int  a_comp,
Real  b,
const MultiFab mfb,
int  b_comp,
int  dest_comp,
int  num_comp,
int  n_ghost = 0 
)

Linear combination: this := a*mfa + b*mfb on intersection of MultiFabs with the boundary FABs.

◆ operator+=()

BndryRegister & amrex::BndryRegister::operator+= ( const BndryRegister rhs)

register += rhs

◆ operator=() [1/2]

BndryRegister& amrex::BndryRegister::operator= ( BndryRegister &&  rhs)
delete

◆ operator=() [2/2]

BndryRegister & amrex::BndryRegister::operator= ( const BndryRegister src)

The copy assignment operator.

◆ operator[]() [1/2]

const FabSet& amrex::BndryRegister::operator[] ( Orientation  face) const
inlinenoexcept

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

◆ operator[]() [2/2]

FabSet& amrex::BndryRegister::operator[] ( Orientation  face)
inlinenoexcept

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

◆ plus()

BndryRegister & amrex::BndryRegister::plus ( const BndryRegister rhs)

◆ plusFrom()

BndryRegister & amrex::BndryRegister::plusFrom ( const MultiFab 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 MultiFab.

◆ read()

void amrex::BndryRegister::read ( const std::string &  name,
std::istream &  is 
)

Read (used for reading from checkpoint)

◆ setBoxes()

void amrex::BndryRegister::setBoxes ( const BoxArray grids)

Set box domain, if not set previously.

◆ setVal()

void amrex::BndryRegister::setVal ( Real  v)

Set all boundary FABs to given value.

◆ size()

int amrex::BndryRegister::size ( ) const
inlinenoexcept

Return the number of grids in this domain.

◆ write()

void amrex::BndryRegister::write ( const std::string &  name,
std::ostream &  os 
) const

Write (used for writing to checkpoint)

Member Data Documentation

◆ bndry

FabSet amrex::BndryRegister::bndry[2 *AMREX_SPACEDIM]
protected

The data.

◆ grids

BoxArray amrex::BndryRegister::grids
protected

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