2#ifndef AMREX_BNDRYDATA_H_
3#define AMREX_BNDRYDATA_H_
4#include <AMReX_Config.H>
94 return this->
bndry[face];
181 static constexpr int NTangHalfWidth = 5;
184template <
typename MF>
193 define(_grids,_dmap,_ncomp,_geom);
196template <
typename MF>
203 bcond[_n][_face][_comp] = _bcn;
206template <
typename MF>
213 bcond[mfi][_face][_comp] = _bcn;
216template <
typename MF>
222 bcloc[_n][_face] = _val;
225template <
typename MF>
231 bcloc[mfi][_face] = _val;
234template <
typename MF>
241template <
typename MF>
248template <
typename MF>
255template <
typename MF>
262template <
typename MF>
272 if (m_ncomp == _ncomp && _geom.
Domain() == geom.Domain() &&
274 _grids == this->boxes() && _dmap == this->DistributionMap()) {
279 amrex::Abort(
"BndryDataT<MF>::define(): object already built");
287 masks.resize(2*AMREX_SPACEDIM);
292 masks[face].define(_grids, _dmap, geom, face, 0, 2, NTangHalfWidth, 1,
true);
302 bcloc.define(_grids, _dmap);
303 bcond.define(_grids, _dmap);
308 abc.resize(2*AMREX_SPACEDIM);
310 abc[fi()].resize(_ncomp);
317template <
typename MF>
321 auto& fab = this->bndry[face][n];
322 auto arr = fab.array();
323 const Box& bx = fab.box();
324 const int ncomp = m_ncomp;
#define BL_PROFILE(a)
Definition AMReX_BLProfiler.H:551
Infrastructure for storing per-face boundary data in FabSets.
Lightweight wrapper for integer boundary-condition identifiers.
#define AMREX_HOST_DEVICE_PARALLEL_FOR_4D(...)
Definition AMReX_GpuLaunchMacrosC.nolint.H:111
MultiFab-style container that stores Mask objects per grid.
A BndryData stores and manipulates boundary data information on each side of each box in a BoxArray.
Definition AMReX_BndryData.H:46
LayoutData< Vector< Vector< BoundCond > > > bcond
Map of boundary condition type specifiers. The outer Array dimension is over Orientation.
Definition AMReX_BndryData.H:167
int nComp() const noexcept
Return number of components this boundary data manages.
Definition AMReX_BndryData.H:123
BndryDataT() noexcept=default
Default constructor.
bool m_defined
Definition AMReX_BndryData.H:175
const FabSetT< MF > & bndryValues(Orientation face) const noexcept
Access the boundary values stored on orientation face.
Definition AMReX_BndryData.H:93
const Geometry & getGeom() const noexcept
Return geometry used to define masks.
Definition AMReX_BndryData.H:129
const MultiMask & bndryMasks(Orientation face) const noexcept
Return the per-face mask built during define() for orientation face.
Definition AMReX_BndryData.H:90
void define(const BoxArray &grids, const DistributionMapping &dmap, int ncomp, const Geometry &geom)
Allocate masks and boundary registers for the supplied grids.
Definition AMReX_BndryData.H:264
const Box & getDomain() const noexcept
Return domain used to define masks.
Definition AMReX_BndryData.H:126
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.
Definition AMReX_BndryData.H:198
Vector< MultiMask > masks
Boundary condition mask.
Definition AMReX_BndryData.H:171
typename MF::value_type value_type
Definition AMReX_BndryData.H:54
void setBoundLoc(Orientation face, int n, value_type val) noexcept
Set the physical boundary location val for grid index n and face face.
Definition AMReX_BndryData.H:218
MaskVal
Mask classification used for each boundary cell.
Definition AMReX_BndryData.H:49
@ not_covered
Location is inside the domain but does not coincide with any valid grid points.
Definition AMReX_BndryData.H:50
@ NumMaskVals
Definition AMReX_BndryData.H:52
@ covered
Location coincides with a valid grid point at the same AMR level.
Definition AMReX_BndryData.H:49
@ outside_domain
Location lies outside the physical domain.
Definition AMReX_BndryData.H:51
void setValue(Orientation face, int n, Real val) noexcept
Set all components on boundary face face of grid n to scalar value val.
Definition AMReX_BndryData.H:319
Array< value_type, 2 *3 > RealTuple
Some useful typedefs.
Definition AMReX_BndryData.H:98
int m_ncomp
Definition AMReX_BndryData.H:174
const Vector< Vector< BoundCond > > & bndryConds(int igrid) const noexcept
Return boundary type specifiers stored for a grid.
Definition AMReX_BndryData.H:236
Geometry geom
Domain used for mask definitions.
Definition AMReX_BndryData.H:173
const RealTuple & bndryLocs(int igrid) const noexcept
Return physical boundary locations for all faces owned by a grid.
Definition AMReX_BndryData.H:250
LayoutData< RealTuple > bcloc
Definition AMReX_BndryData.H:169
const FabSetT< MF > & operator[](Orientation face) const noexcept
Provide access to boundary registers for orientation face.
Definition AMReX_BndryData.H:157
A BndryRegister organizes FabSets bounding each grid in a BoxArray. A FabSet is maintained for each b...
Definition AMReX_BndryRegister.H:46
void setBoxes(const BoxArray &grids)
Set the BoxArray domain to grids once prior to calling define().
Definition AMReX_BndryRegister.H:239
BoxArray grids
Definition AMReX_BndryRegister.H:173
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.
Definition AMReX_BndryRegister.H:193
FabSetT< MF > bndry[2 *3]
The data.
Definition AMReX_BndryRegister.H:172
Maintain an identifier for boundary condition types.
Definition AMReX_BoundCond.H:25
A collection of Boxes stored in an Array.
Definition AMReX_BoxArray.H:568
Calculates the distribution of FABs to MPI processes.
Definition AMReX_DistributionMapping.H:43
Convenience iterator that reuses MFIter semantics for FabSet traversal.
Definition AMReX_FabSet.H:281
A FabSet is a group of FArrayBox's. The grouping is designed specifically to represent regions along ...
Definition AMReX_FabSet.H:51
Rectangular problem domain geometry.
Definition AMReX_Geometry.H:74
const Box & Domain() const noexcept
Returns our rectangular domain.
Definition AMReX_Geometry.H:211
Periodicity periodicity() const noexcept
Definition AMReX_Geometry.H:356
__host__ static __device__ constexpr IndexTypeND< dim > TheCellType() noexcept
This static member function returns an IndexTypeND object of value IndexTypeND::CELL....
Definition AMReX_IndexType.H:152
a one-thingy-per-box distributed object
Definition AMReX_LayoutData.H:13
Iterator for looping ever tiles and boxes of amrex::FabArray based containers.
Definition AMReX_MFIter.H:85
bool isValid() const noexcept
Is the iterator valid i.e. is it associated with a FAB?
Definition AMReX_MFIter.H:169
Definition AMReX_MultiMask.H:23
An Iterator over the Orientation of Faces of a Box.
Definition AMReX_Orientation.H:135
Encapsulation of the Orientation of the Faces of a Box.
Definition AMReX_Orientation.H:29
@ low
Definition AMReX_Orientation.H:34
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition AMReX_Vector.H:28
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:79
std::array< T, N > Array
Definition AMReX_Array.H:26
Definition AMReX_Amr.cpp:49
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition AMReX.cpp:240