Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
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.
 
 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).
 

Static Public Member Functions

static void Copy (BndryRegisterT< MF > &dst, const BndryRegisterT< MF > &src)
 Local copy function for duplicating boundary registers.
 

Protected Attributes

FabSetT< MF > bndry [2 *3]
 The data.
 
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 ( )

Release all FABs and clear the associated BoxArray.

◆ Copy()

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

Local copy function for duplicating boundary registers.

Parameters
dstDestination register to populate.
srcSource register supplying data.

◆ 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 boundary FABs with num_comp components copied from src (component src_comp) into dest_comp, sampling nghost layers and honoring period.

◆ 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 
)

Allocate boundary FabSets for all faces.

Parameters
grids_Grid layout for this register.
dmapDistribution mapping for the grids.
in_radNumber of layers inside each grid face.
out_radNumber of layers outside each grid face.
extent_radTangential stencil extent.
ncompNumber of components.

◆ 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 a particular face orientation.

Parameters
faceOrientation to populate.
typIndexType describing staggering.
in_radNumber of inward cells.
out_radNumber of outward cells.
extent_radTangential stencil width.
ncompNumber of components.
dmDistribution mapping for this face.

◆ DistributionMap()

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

Returns the DistributionMapping describing which MPI ranks own each boundary FAB.

◆ 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 the boundary, using components a_comp/b_comp and writing to dest_comp for num_comp entries with n_ghost layers.

◆ operator+=()

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

Accumulate another register with identical layout into this one.

◆ 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 orientation face.

◆ 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 orientation face.

◆ plus()

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

Convenience alias for operator+=.

◆ 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 boundary FABs with num_comp components from src, using the same arguments as copyFrom().

◆ read()

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

Read all FabSets from disk (used for checkpoint data).

Parameters
nameBase name for the saved data.
isInput stream describing the register metadata.

◆ setBoxes()

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

Set the BoxArray domain to grids once prior to calling define().

Parameters
gridsCell-centered grid layout that subsequent define() calls will honor.

◆ setVal()

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

Set all boundary FABs to the scalar value v across every component.

◆ 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 all FabSets to disk (used for checkpoint data).

Parameters
nameBase name for the output file per orientation.
osOutput stream already opened by the caller.

Member Data Documentation

◆ bndry

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

The data.

◆ grids

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

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