2 #ifndef AMREX_BNDRYDATA_H_
3 #define AMREX_BNDRYDATA_H_
4 #include <AMReX_Config.H>
38 template <
typename MF>
78 return this->
bndry[face];
159 template <
typename MF>
168 define(_grids,_dmap,_ncomp,_geom);
171 template <
typename MF>
178 bcond[_n][_face][_comp] = _bcn;
181 template <
typename MF>
188 bcond[mfi][_face][_comp] = _bcn;
191 template <
typename MF>
197 bcloc[_n][_face] = _val;
200 template <
typename MF>
206 bcloc[mfi][_face] = _val;
209 template <
typename MF>
216 template <
typename MF>
223 template <
typename MF>
230 template <
typename MF>
237 template <
typename MF>
247 if (_grids == this->boxes() && m_ncomp == _ncomp && _geom.
Domain() == geom.Domain()) {
252 amrex::Abort(
"BndryDataT<MF>::define(): object already built");
260 masks.resize(2*AMREX_SPACEDIM);
265 masks[face].define(_grids, _dmap, geom, face, 0, 2, NTangHalfWidth, 1,
true);
275 bcloc.define(_grids, _dmap);
276 bcond.define(_grids, _dmap);
281 abc.resize(2*AMREX_SPACEDIM);
283 abc[
fi()].resize(_ncomp);
290 template <
typename MF>
294 auto& fab = this->bndry[face][n];
295 auto arr = fab.array();
296 const Box& bx = fab.box();
297 const int ncomp = m_ncomp;
#define BL_PROFILE(a)
Definition: AMReX_BLProfiler.H:551
#define AMREX_HOST_DEVICE_PARALLEL_FOR_4D(...)
Definition: AMReX_GpuLaunch.nolint.H:55
A BndryData stores and manipulates boundary data information on each side of each box in a BoxArray.
Definition: AMReX_BndryData.H:41
LayoutData< Vector< Vector< BoundCond > > > bcond
Map of boundary condition type specifiers. The outer Array dimension is over Orientation.
Definition: AMReX_BndryData.H:142
int nComp() const noexcept
return number of components for which this object is intended
Definition: AMReX_BndryData.H:100
BndryDataT() noexcept=default
Default constructor.
bool m_defined
Definition: AMReX_BndryData.H:150
const MultiMask & bndryMasks(Orientation face) const noexcept
Definition: AMReX_BndryData.H:74
Array< value_type, 2 *AMREX_SPACEDIM > RealTuple
Some useful typedefs.
Definition: AMReX_BndryData.H:82
const Geometry & getGeom() const noexcept
return geometry used to define masks
Definition: AMReX_BndryData.H:106
void define(const BoxArray &grids, const DistributionMapping &dmap, int ncomp, const Geometry &geom)
allocate bndry fabs along given face
Definition: AMReX_BndryData.H:239
const FabSetT< MF > & operator[](Orientation face) const noexcept
implement public access to const BndryRegister::operator[]
Definition: AMReX_BndryData.H:132
void setBoundCond(Orientation face, int n, int comp, const BoundCond &bcn) noexcept
set boundary type specifier for given orientation on nth grid
Definition: AMReX_BndryData.H:173
const Box & getDomain() const noexcept
return domain used to define masks
Definition: AMReX_BndryData.H:103
Vector< MultiMask > masks
Boundary condition mask.
Definition: AMReX_BndryData.H:146
typename MF::value_type value_type
Definition: AMReX_BndryData.H:46
void setBoundLoc(Orientation face, int n, value_type val) noexcept
set boundary location for given orientation on nth grid
Definition: AMReX_BndryData.H:193
MaskVal
mask values enumeration
Definition: AMReX_BndryData.H:44
@ not_covered
Definition: AMReX_BndryData.H:44
@ NumMaskVals
Definition: AMReX_BndryData.H:44
@ covered
Definition: AMReX_BndryData.H:44
@ outside_domain
Definition: AMReX_BndryData.H:44
void setValue(Orientation face, int n, Real val) noexcept
set values of boundary Fab for given orientation on nth grid
Definition: AMReX_BndryData.H:292
int m_ncomp
Definition: AMReX_BndryData.H:149
const FabSetT< MF > & bndryValues(Orientation face) const noexcept
Return FabSet on given face.
Definition: AMReX_BndryData.H:77
const Vector< Vector< BoundCond > > & bndryConds(int igrid) const noexcept
Return boundary type specifier on given face for grids we own. It's an error if we don't own that gri...
Definition: AMReX_BndryData.H:211
Geometry geom
Domain used for mask definitions.
Definition: AMReX_BndryData.H:148
static constexpr int NTangHalfWidth
Definition: AMReX_BndryData.H:156
const RealTuple & bndryLocs(int igrid) const noexcept
Return boundary location on given face for grids we own. It's an error if we don't own that grid....
Definition: AMReX_BndryData.H:225
LayoutData< RealTuple > bcloc
Definition: AMReX_BndryData.H:144
A BndryRegister organizes FabSets bounding each grid in a BoxArray. A FabSet is maintained for each b...
Definition: AMReX_BndryRegister.H:41
void setBoxes(const BoxArray &grids)
Set box domain, if not set previously.
Definition: AMReX_BndryRegister.H:193
BoxArray grids
Definition: AMReX_BndryRegister.H:126
FabSetT< MF > bndry[2 *AMREX_SPACEDIM]
The data.
Definition: AMReX_BndryRegister.H:125
void define(const BoxArray &grids_, const DistributionMapping &dmap, int in_rad, int out_rad, int extent_rad, int ncomp)
Definition: AMReX_BndryRegister.H:147
Maintain an identifier for boundary condition types.
Definition: AMReX_BoundCond.H:20
A collection of Boxes stored in an Array.
Definition: AMReX_BoxArray.H:549
Calculates the distribution of FABs to MPI processes.
Definition: AMReX_DistributionMapping.H:41
Definition: AMReX_FabSet.H:149
A FabSet is a group of FArrayBox's. The grouping is designed specifically to represent regions along ...
Definition: AMReX_FabSet.H:46
Rectangular problem domain geometry.
Definition: AMReX_Geometry.H:73
const Box & Domain() const noexcept
Returns our rectangular domain.
Definition: AMReX_Geometry.H:210
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IndexTypeND< dim > TheCellType() noexcept
This static member function returns an IndexTypeND object of value IndexTypeND::CELL....
Definition: AMReX_IndexType.H:149
a one-thingy-per-box distributed object
Definition: AMReX_LayoutData.H:13
Definition: AMReX_MFIter.H:57
bool isValid() const noexcept
Is the iterator valid i.e. is it associated with a FAB?
Definition: AMReX_MFIter.H:141
Definition: AMReX_MultiMask.H:18
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:27
static int fi(amrex::Real t, N_Vector y_data, N_Vector y_rhs, void *user_data)
Definition: AMReX_SundialsIntegrator.H:49
Definition: AMReX_Amr.cpp:49
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition: AMReX.cpp:225
std::array< T, N > Array
Definition: AMReX_Array.H:24