![]() |
Block-Structured AMR Software Framework
|
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>
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 | |
| 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 | 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 |
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,
| using amrex::BndryRegisterT< MF >::value_type = typename MF::value_type |
|
defaultnoexcept |
The default constructor.
| 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)
|
default |
The destructor.
|
defaultnoexcept |
|
delete |
|
inlinenoexcept |
Get box domain (as an array of boxes).
| void amrex::BndryRegisterT< MF >::clear | ( | ) |
Release all FABs and clear the associated BoxArray.
|
static |
Local copy function for duplicating boundary registers.
| dst | Destination register to populate. |
| src | Source register supplying data. |
| 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.
| 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.
| grids_ | Grid layout for this register. |
| dmap | Distribution mapping for the grids. |
| in_rad | Number of layers inside each grid face. |
| out_rad | Number of layers outside each grid face. |
| extent_rad | Tangential stencil extent. |
| ncomp | Number of components. |
| 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.
| face | Orientation to populate. |
| typ | IndexType describing staggering. |
| in_rad | Number of inward cells. |
| out_rad | Number of outward cells. |
| extent_rad | Tangential stencil width. |
| ncomp | Number of components. |
| dm | Distribution mapping for this face. |
|
inlinenoexcept |
Returns the DistributionMapping describing which MPI ranks own each boundary FAB.
| 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.
| BndryRegisterT< MF > & amrex::BndryRegisterT< MF >::operator+= | ( | const BndryRegisterT< MF > & | rhs | ) |
Accumulate another register with identical layout into this one.
|
delete |
|
delete |
|
inlinenoexcept |
Return const set of FABs bounding the domain grid boxes on orientation face.
|
inlinenoexcept |
Return set of FABs bounding the domain grid boxes on orientation face.
| BndryRegisterT< MF > & amrex::BndryRegisterT< MF >::plus | ( | const BndryRegisterT< MF > & | rhs | ) |
Convenience alias for operator+=.
| 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().
| void amrex::BndryRegisterT< MF >::read | ( | const std::string & | name, |
| std::istream & | is | ||
| ) |
Read all FabSets from disk (used for checkpoint data).
| name | Base name for the saved data. |
| is | Input stream describing the register metadata. |
| void amrex::BndryRegisterT< MF >::setBoxes | ( | const BoxArray & | grids | ) |
| void amrex::BndryRegisterT< MF >::setVal | ( | value_type | v | ) |
Set all boundary FABs to the scalar value v across every component.
|
inlinenoexcept |
Return the number of grids in this domain.
| void amrex::BndryRegisterT< MF >::write | ( | const std::string & | name, |
| std::ostream & | os | ||
| ) | const |
Write all FabSets to disk (used for checkpoint data).
| name | Base name for the output file per orientation. |
| os | Output stream already opened by the caller. |
|
protected |
The data.
|
protected |