4 #include <AMReX_Config.H>
26 using Box = BoxND<AMREX_SPACEDIM>;
94 template <
typename T,
int Tdim=dim, std::enable_if_t<( 1<=Tdim && Tdim<=3 ),
int> = 0>
96 explicit BoxND (Array4<T> const& a) noexcept
98 bigend(IntVectND<dim>(a.end) - 1)
104 [[nodiscard]] AMREX_GPU_HOST_DEVICE
105 const IntVectND<dim>& smallEnd () const& noexcept { return smallend; }
108 [[nodiscard]] const IntVectND<dim>& smallEnd () && = delete;
111 [[nodiscard]] AMREX_GPU_HOST_DEVICE
112 int smallEnd (
int dir) const& noexcept { return smallend[dir]; }
115 [[nodiscard]] AMREX_GPU_HOST_DEVICE
116 const IntVectND<dim>& bigEnd () const& noexcept { return bigend; }
119 [[nodiscard]] const IntVectND<dim>& bigEnd () && = delete;
122 [[nodiscard]] AMREX_GPU_HOST_DEVICE
123 int bigEnd (
int dir) const noexcept { return bigend[dir]; }
126 [[nodiscard]] AMREX_GPU_HOST_DEVICE
127 IndexTypeND<dim> ixType () const noexcept { return btype; }
130 [[nodiscard]] AMREX_GPU_HOST_DEVICE
131 IntVectND<dim> type () const noexcept { return btype.ixType(); }
134 [[nodiscard]] AMREX_GPU_HOST_DEVICE
135 IndexType::CellIndex type (
int dir) const noexcept { return btype.ixType(dir); }
138 [[nodiscard]] AMREX_GPU_HOST_DEVICE
139 IntVectND<dim> size () const noexcept
141 return bigend - smallend + 1;
145 [[nodiscard]] AMREX_GPU_HOST_DEVICE
146 IntVectND<dim> length () const noexcept
148 return bigend - smallend + 1;
152 [[nodiscard]] AMREX_GPU_HOST_DEVICE
153 int length (
int dir) const noexcept { return bigend[dir] - smallend[dir] + 1; }
155 template <
int N=dim, std::enable_if_t<( 1<=N && N<=3 ),
int> = 0>
156 [[nodiscard]] AMREX_GPU_HOST_DEVICE
157 GpuArray<
int,3> length3d () const noexcept {
158 Dim3 len3d = length().dim3(1);
159 return {{len3d.x, len3d.y, len3d.z}};
162 template <
int N=dim, std::enable_if_t<( 1<=N && N<=3 ),
int> = 0>
163 [[nodiscard]] AMREX_GPU_HOST_DEVICE
164 GpuArray<
int,3> loVect3d () const noexcept {
165 Dim3 lo3d = smallend.dim3(0);
166 return {{lo3d.x, lo3d.y, lo3d.z}};
169 template <
int N=dim, std::enable_if_t<( 1<=N && N<=3 ),
int> = 0>
170 [[nodiscard]] AMREX_GPU_HOST_DEVICE
171 GpuArray<
int,3> hiVect3d () const noexcept {
172 Dim3 hi3d = bigend.dim3(0);
173 return {{hi3d.x, hi3d.y, hi3d.z}};
177 [[nodiscard]] AMREX_GPU_HOST_DEVICE
178 const
int* loVect () const& noexcept { return smallend.getVect(); }
179 AMREX_GPU_HOST_DEVICE
180 const
int* loVect () && = delete;
182 [[nodiscard]] AMREX_GPU_HOST_DEVICE
183 const
int* hiVect () const& noexcept { return bigend.getVect(); }
184 AMREX_GPU_HOST_DEVICE
185 const
int* hiVect () && = delete;
188 [[nodiscard]] AMREX_GPU_HOST_DEVICE
189 int operator[] (Orientation face) const noexcept {
190 const
int dir = face.coordDir();
191 return face.isLow() ? smallend[dir] : bigend[dir];
195 [[nodiscard]] AMREX_GPU_HOST_DEVICE
196 bool isEmpty () const noexcept { return !ok(); }
199 [[nodiscard]] AMREX_GPU_HOST_DEVICE
200 bool ok () const noexcept { return bigend.allGE(smallend) && btype.ok(); }
203 [[nodiscard]] AMREX_GPU_HOST_DEVICE
204 bool contains (const IntVectND<dim>& p) const noexcept {
205 return p.allGE(smallend) && p.allLE(bigend);
209 template <
int N=dim, std::enable_if_t<( 1<=N && N<=3 ),
int> = 0>
210 [[nodiscard]] AMREX_GPU_HOST_DEVICE
211 bool contains (const Dim3& p) const noexcept {
212 IntVectND<dim> piv{p};
213 return contains(piv);
217 template <
int N=dim, std::enable_if_t<( 1<=N && N<=3 ),
int> = 0>
218 [[nodiscard]] AMREX_GPU_HOST_DEVICE
219 bool contains (
int i,
int j,
int k) const noexcept {
221 return contains(p3d);
227 [[nodiscard]] AMREX_GPU_HOST_DEVICE
228 bool contains (const BoxND& b) const noexcept
230 BL_ASSERT(sameType(b));
231 return b.smallend.allGE(smallend) && b.bigend.allLE(bigend);
235 [[nodiscard]] AMREX_GPU_HOST_DEVICE
236 bool strictly_contains (const IntVectND<dim>& p) const noexcept {
237 return p.allGT(smallend) && p.allLT(bigend);
244 [[nodiscard]] AMREX_GPU_HOST_DEVICE
245 bool strictly_contains (const BoxND& b) const noexcept
247 BL_ASSERT(sameType(b));
248 return b.smallend.allGT(smallend) && b.bigend.allLT(bigend);
252 template <
int N=dim, std::enable_if_t<( 1<=N && N<=3 ),
int> = 0>
253 [[nodiscard]] AMREX_GPU_HOST_DEVICE
254 bool strictly_contains (const Dim3& p) const noexcept {
255 IntVectND<dim> piv{p};
256 return strictly_contains(piv);
260 template <
int N=dim, std::enable_if_t<( 1<=N && N<=3 ),
int> = 0>
261 [[nodiscard]] AMREX_GPU_HOST_DEVICE
262 bool strictly_contains (
int i,
int j,
int k) const noexcept {
264 return strictly_contains(p3d);
271 [[nodiscard]] AMREX_GPU_HOST_DEVICE
272 bool intersects (const BoxND& b) const noexcept { BoxND isect(*this); isect &= b; return isect.ok(); }
278 [[nodiscard]] AMREX_GPU_HOST_DEVICE
279 bool sameSize (const BoxND& b) const noexcept {
280 BL_ASSERT(sameType(b));
281 return length() == b.length();
285 [[nodiscard]] AMREX_GPU_HOST_DEVICE
286 bool sameType (const BoxND &b) const noexcept { return btype == b.btype; }
289 [[nodiscard]] AMREX_GPU_HOST_DEVICE
290 bool operator== (const BoxND& b) const noexcept { return smallend == b.smallend && bigend == b.bigend && b.btype == btype; }
293 [[nodiscard]] AMREX_GPU_HOST_DEVICE
294 bool operator!= (const BoxND& b) const noexcept { return !operator==(b); }
296 [[nodiscard]] AMREX_GPU_HOST_DEVICE
297 bool operator< (const BoxND& rhs) const noexcept
299 return btype < rhs.btype ||
300 ((btype == rhs.btype) &&
301 ( (smallend < rhs.smallend) ||
302 ((smallend == rhs.smallend) && (bigend < rhs.bigend)) ));
304 [[nodiscard]] AMREX_GPU_HOST_DEVICE
305 bool operator <= (const BoxND& rhs) const noexcept {
306 return !(rhs < *this);
308 [[nodiscard]] AMREX_GPU_HOST_DEVICE
309 bool operator> (const BoxND& rhs) const noexcept {
312 [[nodiscard]] AMREX_GPU_HOST_DEVICE
313 bool operator>= (const BoxND& rhs) const noexcept {
314 return !(*this < rhs);
318 [[nodiscard]] AMREX_GPU_HOST_DEVICE
319 bool cellCentered () const noexcept { return !btype.any(); }
322 void checkOverflow () const noexcept {
324 for (
int i = 0; i < dim; ++i) {
325 auto lo = static_cast<Long>(smallend[i]);
326 auto hi = static_cast<Long>(bigend[i]);
327 Long len = hi - lo + 1;
328 AMREX_ALWAYS_ASSERT_WITH_MESSAGE(len>=0 && len<std::numeric_limits<
int>::max(),
329 "Overflow when computing length of box");
331 auto num_pts = static_cast<Long>(length(0));
332 for (
int i = 1; i < dim; ++i) {
333 auto len = static_cast<Long>(length(i));
334 AMREX_ALWAYS_ASSERT_WITH_MESSAGE(num_pts == 0 || len == 0 ||
335 num_pts <= std::numeric_limits<Long>::max() / len,
336 "Overflow when computing numPts of box");
345 [[nodiscard]] AMREX_GPU_HOST_DEVICE
346 Long numPts () const noexcept {
347 #if defined(AMREX_DEBUG) || defined(AMREX_USE_ASSERTION)
348 AMREX_IF_ON_HOST((checkOverflow();))
351 auto num_pts = static_cast<Long>(length(0));
352 for (
int i = 1; i < dim; ++i) {
353 num_pts *= static_cast<Long>(length(i));
365 [[nodiscard]] AMREX_GPU_HOST_DEVICE
366 double d_numPts () const noexcept {
368 auto num_pts = static_cast<
double>(length(0));
369 for (
int i = 1; i < dim; ++i) {
370 num_pts *= static_cast<
double>(length(i));
383 [[nodiscard]] AMREX_GPU_HOST_DEVICE
384 Long volume () const noexcept {
386 auto num_pts = static_cast<Long>(length(0)-btype[0]);
387 for (
int i = 1; i < dim; ++i) {
388 num_pts *= static_cast<Long>(length(i)-btype[i]);
400 [[nodiscard]] AMREX_GPU_HOST_DEVICE
401 int longs
ide (
int& dir) const noexcept {
402 int maxlen = length(0);
404 for (
int i = 1; i < dim; i++)
406 if (length(i) > maxlen)
416 [[nodiscard]] AMREX_GPU_HOST_DEVICE
417 int longs
ide () const noexcept {
419 return
longs
ide(ignore);
426 [[nodiscard]] AMREX_GPU_HOST_DEVICE
427 int shorts
ide (
int& dir) const noexcept {
428 int minlen = length(0);
430 for (
int i = 1; i < dim; i++)
432 if (length(i) < minlen)
442 [[nodiscard]] AMREX_GPU_HOST_DEVICE
443 int shorts
ide () const noexcept {
445 return
shorts
ide(ignore);
453 [[nodiscard]] AMREX_GPU_HOST_DEVICE
454 Long index (const IntVectND<dim>& v) const noexcept;
457 [[nodiscard]] AMREX_GPU_HOST_DEVICE
458 IntVectND<dim> atOffset (Long offset) const noexcept;
460 template <
int N=dim, std::enable_if_t<( 1<=N && N<=3 ),
int> = 0>
461 [[nodiscard]] AMREX_GPU_HOST_DEVICE
462 GpuArray<
int,3> atOffset3d (Long offset) const noexcept;
465 AMREX_GPU_HOST_DEVICE
466 BoxND& setSmall (const IntVectND<dim>& sm) noexcept { smallend = sm; return *this; }
469 AMREX_GPU_HOST_DEVICE
470 BoxND& setSmall (
int dir,
int sm_index) noexcept { smallend.setVal(dir,sm_index); return *this; }
473 AMREX_GPU_HOST_DEVICE
474 BoxND& setBig (const IntVectND<dim>& bg) noexcept { bigend = bg; return *this; }
477 AMREX_GPU_HOST_DEVICE
478 BoxND& setBig (
int dir,
int bg_index) noexcept { bigend.setVal(dir,bg_index); return *this; }
485 AMREX_GPU_HOST_DEVICE
486 BoxND& setRange (
int dir,
488 int n_cells = 1) noexcept;
491 AMREX_GPU_HOST_DEVICE
492 BoxND& setType (const IndexTypeND<dim>& t) noexcept { btype = t; return *this; }
495 AMREX_GPU_HOST_DEVICE
496 BoxND& shift (
int dir,
int nzones) noexcept { smallend.shift(dir,nzones); bigend.shift(dir,nzones); return *this; }
499 AMREX_GPU_HOST_DEVICE
500 BoxND& shift (const IntVectND<dim>& iv) noexcept { smallend.shift(iv); bigend.shift(iv); return *this; }
511 AMREX_GPU_HOST_DEVICE
512 BoxND& shiftHalf (
int dir,
int num_halfs) noexcept;
515 AMREX_GPU_HOST_DEVICE
516 BoxND& shiftHalf (const IntVectND<dim>& iv) noexcept;
525 AMREX_GPU_HOST_DEVICE
526 BoxND& convert (IndexTypeND<dim> typ) noexcept;
535 AMREX_GPU_HOST_DEVICE
536 BoxND& convert (const IntVectND<dim>& typ) noexcept;
539 AMREX_GPU_HOST_DEVICE
540 BoxND& surroundingNodes () noexcept;
543 AMREX_GPU_HOST_DEVICE
544 BoxND& surroundingNodes (
int dir) noexcept;
546 AMREX_GPU_HOST_DEVICE
547 BoxND& surroundingNodes (Direction d) noexcept { return surroundingNodes(static_cast<
int>(d)); }
550 AMREX_GPU_HOST_DEVICE
551 BoxND& enclosedCells () noexcept;
554 AMREX_GPU_HOST_DEVICE
555 BoxND& enclosedCells (
int dir) noexcept;
557 AMREX_GPU_HOST_DEVICE
558 BoxND& enclosedCells (Direction d) noexcept { return enclosedCells(static_cast<
int>(d)); }
564 AMREX_GPU_HOST_DEVICE
565 BoxND operator& (const BoxND& rhs) const noexcept { BoxND lhs(*this); lhs &= rhs; return lhs; }
568 AMREX_GPU_HOST_DEVICE
569 BoxND& operator&= (const BoxND& rhs) noexcept
571 BL_ASSERT(sameType(rhs));
572 smallend.max(rhs.smallend);
573 bigend.min(rhs.bigend);
582 AMREX_GPU_HOST_DEVICE
583 BoxND& minBox (const BoxND& b) noexcept {
585 BL_ASSERT(sameType(b));
586 smallend.min(b.smallend);
587 bigend.max(b.bigend);
592 AMREX_GPU_HOST_DEVICE
593 BoxND& operator+= (const IntVectND<dim>& v) noexcept { smallend += v; bigend += v; return *this; }
596 AMREX_GPU_HOST_DEVICE
597 BoxND operator+ (const IntVectND<dim>& v) const noexcept { BoxND r(*this); r += v; return r; }
600 AMREX_GPU_HOST_DEVICE
601 BoxND& operator-= (const IntVectND<dim>& v) noexcept { smallend -= v; bigend -= v; return *this; }
604 AMREX_GPU_HOST_DEVICE
605 BoxND operator- (const IntVectND<dim>& v) const noexcept { BoxND r(*this); r -= v; return r; }
619 AMREX_GPU_HOST_DEVICE
620 BoxND chop (
int dir,
int chop_pnt) noexcept;
626 AMREX_GPU_HOST_DEVICE
627 BoxND& grow (
int i) noexcept { smallend.diagShift(-i); bigend.diagShift(i); return *this; }
630 AMREX_GPU_HOST_DEVICE
631 BoxND& grow (const IntVectND<dim>& v) noexcept { smallend -= v; bigend += v; return *this;}
637 AMREX_GPU_HOST_DEVICE
638 BoxND& grow (
int idir,
int n_cell) noexcept { smallend.shift(
idir, -n_cell); bigend.shift(
idir, n_cell); return *this; }
640 AMREX_GPU_HOST_DEVICE
641 BoxND& grow (Direction d,
int n_cell) noexcept { return grow(static_cast<
int>(d), n_cell); }
647 AMREX_GPU_HOST_DEVICE
648 BoxND& growLo (
int idir,
int n_cell = 1) noexcept { smallend.shift(
idir, -n_cell); return *this; }
650 AMREX_GPU_HOST_DEVICE
651 BoxND& growLo (Direction d,
int n_cell = 1) noexcept { return growLo(static_cast<
int>(d), n_cell); }
658 AMREX_GPU_HOST_DEVICE
659 BoxND& growHi (
int idir,
int n_cell = 1) noexcept { bigend.shift(
idir,n_cell); return *this; }
661 AMREX_GPU_HOST_DEVICE
662 BoxND& growHi (Direction d,
int n_cell = 1) noexcept { return growHi(static_cast<
int>(d), n_cell); }
665 AMREX_GPU_HOST_DEVICE
666 BoxND& grow (Orientation face,
int n_cell = 1) noexcept {
667 int idir = face.coordDir();
669 smallend.shift(
idir, -n_cell);
671 bigend.shift(
idir,n_cell);
683 AMREX_GPU_HOST_DEVICE
684 BoxND& refine (
int ref_ratio) noexcept {
685 return this->refine(IntVectND<dim>(ref_ratio));
695 AMREX_GPU_HOST_DEVICE
696 BoxND& refine (const IntVectND<dim>& ref_ratio) noexcept;
707 AMREX_GPU_HOST_DEVICE
708 BoxND& coarsen (
int ref_ratio) noexcept {
747 if (!
size().allGE(refrat*min_width)) {
750 BoxND testBox = *
this;
753 return (*
this == testBox);
771 for (
int idim=0; idim < dim; ++idim) {
772 if (this->
length(idim) == 0) {
781 smallend[direction] = slab_index;
782 bigend[direction] = slab_index;
787 static constexpr std::size_t
ndims () noexcept {
788 return static_cast<std::size_t
>(dim);
792 static constexpr
int indims () noexcept {
800 template<
int new_dim>
803 static_assert(new_dim <= dim);
804 auto lo = smallend.template shrink<new_dim>();
805 auto hi = bigend.template shrink<new_dim>();
806 auto typ = btype.template shrink<new_dim>();
815 template<
int new_dim>
818 static_assert(new_dim >= dim);
819 auto lo = smallend.template expand<new_dim>(0);
820 auto hi = bigend.template expand<new_dim>(0);
821 auto typ = btype.template expand<new_dim>(IndexType::CellIndex::CELL);
829 template<
int new_dim>
832 if constexpr (new_dim > dim) {
833 return expand<new_dim>();
835 return shrink<new_dim>();
851 if (ref_ratio != 1) {
853 shft -= btype.ixType();
854 smallend *= ref_ratio;
870 smallend.coarsen(ref_ratio);
875 for (
int dir = 0; dir < dim; dir++)
878 if (bigend[dir]%ref_ratio[dir]) {
914 for (
int dir = 0; dir < dim; dir++)
916 const auto typ = t[dir];
917 const auto bitval = btype[dir];
918 const int off = typ - bitval;
919 bigend.shift(dir,off);
948 for (
int i = 0; i < dim; ++i) {
949 if ((btype[i] == 0)) {
965 bigend.shift(dir,-1);
980 for (
int i = 0 ; i < dim; ++i) {
998 for (
int i = 1 ; i < dim; ++i) {
999 result += mult * vz[i];
1013 if constexpr (dim > 1) {
1016 for (
int i = 1 ; i < dim-1; ++i) {
1017 mult[i] = mult[i-1] *
length(i);
1019 for (
int i = dim-1 ; i > 0; --i) {
1020 Long idx =
offset / mult[i-1];
1021 offset -= idx * mult[i-1];
1022 result[i] +=
static_cast<int>(idx);
1026 result[0] +=
static_cast<int>(
offset);
1032 template <
int N, std::enable_if_t<( 1<=N && N<=3 ),
int>>
1033 AMREX_GPU_HOST_DEVICE
1036 BoxND<dim>::atOffset3d (Long offset) const noexcept
1038 Dim3 iv3d = atOffset(offset).dim3(0);
1039 return {{iv3d.x, iv3d.y, iv3d.z}};
1048 int n_cells) noexcept
1050 smallend.setVal(dir,sm_index);
1051 bigend.setVal(dir,sm_index+n_cells-1);
1065 for (
int i = 0 ; i < dim-1; ++i) {
1066 if (p[i] > bigend[i]) {
1081 if constexpr (dim == 1) {
1084 bool is_square =
true;
1086 for (
int i = 0 ; i < dim-1; ++i) {
1087 is_square = is_square && (sz[i] == sz[i+1]);
1116 BL_ASSERT(chop_pnt > smallend[dir] && chop_pnt < bigend[dir]);
1120 bigend.setVal(dir,chop_pnt);
1127 BL_ASSERT(chop_pnt > smallend[dir] && chop_pnt <= bigend[dir]);
1131 bigend.setVal(dir,chop_pnt-1);
1142 const int nbit = (num_halfs<0 ? -num_halfs : num_halfs)%2;
1143 int nshift = num_halfs/2;
1147 const unsigned int bit_dir = btype[dir];
1151 if (num_halfs < 0) {
1152 nshift -= (bit_dir ? nbit : 0);
1154 nshift += (bit_dir ? 0 : nbit);
1156 smallend.
shift(dir,nshift);
1157 bigend.
shift(dir,nshift);
1167 for (
int i = 0; i < dim; i++) {
1179 [[nodiscard]]
int*
data () const& noexcept {
return p; }
1186 [[nodiscard]]
static int size () noexcept {
return 3*AMREX_SPACEDIM; }
1248 return grow(
b,
static_cast<int>(d), n_cell);
1268 return growLo(
b,
static_cast<int>(d), n_cell);
1288 return growHi(
b,
static_cast<int>(d), n_cell);
1363 result.
refine(ref_ratio);
1375 result.
shift(dir, nzones);
1386 result.
shift(nzones);
1507 low.
setVal(dir,sm-len+1);
1529 auto const bitval =
b.type()[dir];
1530 int bg = hi[dir] + 1 - bitval%2;
1557 low.
setVal(dir,sm-len+1);
1562 int bitval =
b.type()[dir];
1563 int bg = hi[dir] + 1 - bitval%2;
1597 low.
setVal(dir,sm - len);
1617 int bitval =
b.type()[dir];
1618 int bg = hi[dir] + 1 - bitval%2;
1620 hi.
setVal(dir,bg + len - 1);
1643 low.
setVal(dir,sm - len);
1648 int bitval =
b.type()[dir];
1649 int bg = hi[dir] + 1 - bitval%2;
1651 hi.
setVal(dir,bg + len - 1);
1678 std::ostream&
box_write (std::ostream& os,
const int * smallend,
const int * bigend,
1679 const int * type,
int dim);
1680 std::istream&
box_read (std::istream& is,
int * smallend,
int * bigend,
int * type,
int dim);
1682 template<std::size_t...Ns,
class T,
class U>
1685 const T& lo,
const T& hi,
const U& typ) noexcept {
1686 return makeTuple(
BoxND(get<Ns>(lo), get<Ns>(hi), get<Ns>(typ))...);
1713 template<
int d,
int...dims>
1728 template<
int d,
int...dims>
1731 constexpr GpuTuple<BoxND<d>, BoxND<dims>...>
1743 template<
int new_dim,
int old_dim>
1746 constexpr BoxND<new_dim>
1748 return bx.template shrink<new_dim>();
1756 template<
int new_dim,
int old_dim>
1759 constexpr BoxND<new_dim>
1761 return bx.template expand<new_dim>();
1768 template<
int new_dim,
int old_dim>
1771 constexpr BoxND<new_dim>
1773 return bx.template resize<new_dim>();
1782 return box.smallEnd();
1791 return box.bigEnd();
1800 return box.smallEnd();
1809 return box.bigEnd() + 1;
1818 return box.bigEnd() - box.smallEnd() + 1;
1828 return max(b1.smallEnd(), b2.smallEnd());
1837 return max(b1.smallEnd(), lo);
1847 return min(b1.bigEnd(), b2.bigEnd());
1856 return min(b1.bigEnd(), hi);
1859 template<
int dim, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
1861 AMREX_GPU_HOST_DEVICE
1863 Dim3 lbound (BoxND<dim> const& box) noexcept
1865 return box.smallEnd().dim3();
1868 template<
int dim, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
1870 AMREX_GPU_HOST_DEVICE
1872 Dim3 ubound (BoxND<dim> const& box) noexcept
1874 return box.bigEnd().dim3();
1877 template<
int dim, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
1879 AMREX_GPU_HOST_DEVICE
1881 Dim3 begin (BoxND<dim> const& box) noexcept
1883 return box.smallEnd().dim3();
1886 template<
int dim, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
1888 AMREX_GPU_HOST_DEVICE
1890 Dim3 end (BoxND<dim> const& box) noexcept
1892 return (box.bigEnd() + 1).dim3(1);
1895 template<
int dim, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
1897 AMREX_GPU_HOST_DEVICE
1899 Dim3 length (BoxND<dim> const& box) noexcept
1901 return (box.bigEnd() - box.smallEnd() + 1).dim3(1);
1905 template<
int dim, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
1907 AMREX_GPU_HOST_DEVICE
1909 Dim3 max_lbound (BoxND<dim> const& b1, BoxND<dim> const& b2) noexcept
1911 return max(b1.smallEnd(), b2.smallEnd()).dim3();
1914 template<
int dim, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
1916 AMREX_GPU_HOST_DEVICE
1918 Dim3 max_lbound (BoxND<dim> const& b1, Dim3 const& lo) noexcept
1920 return max(b1.smallEnd(), IntVectND<dim>(lo)).dim3();
1924 template<
int dim, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
1926 AMREX_GPU_HOST_DEVICE
1928 Dim3 min_ubound (BoxND<dim> const& b1, BoxND<dim> const& b2) noexcept
1930 return min(b1.bigEnd(), b2.bigEnd()).dim3();
1933 template<
int dim, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
1935 AMREX_GPU_HOST_DEVICE
1937 Dim3 min_ubound (BoxND<dim> const& b1, Dim3 const& hi) noexcept
1939 return min(b1.bigEnd(), IntVectND<dim>(hi)).dim3();
1960 b.setType(b2.ixType());
1965 template <
class T,
class ... Ts>
1981 Long ncells_subtotal = 0;
1983 for (ibox = 0; ibox < nboxes; ++ibox) {
1984 const Long n = boxes[ibox].
numPts();
1985 ncells_subtotal += n;
1986 if (icell < ncells_subtotal) {
1987 offset = icell - (ncells_subtotal - n);
2001 r.makeSlab(direction,slab_index);
2005 template<
int dim=AMREX_SPACEDIM, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
2007 AMREX_GPU_HOST_DEVICE
2009 BoxND<dim> makeSingleCellBox (
int i,
int j,
int k, IndexTypeND<dim> typ = IndexTypeND<dim>::TheCellType())
2012 IntVectND<dim> vect{p3d};
2013 return BoxND<dim>{vect, vect, typ};
2033 : npts(box.numPts()),
2036 std::uint64_t mult = 1;
2037 for (
int i=0; i<dim-1; ++i) {
2048 for (
int i=dim-1; i>0; --i) {
2049 std::uint64_t quotient, remainder;
2050 fdm[i-1](quotient, remainder, icell);
2051 retval[i] += quotient;
2060 template <
int N=dim, std::enable_if_t<( 1<=N && N<=3 ),
int> = 0>
2061 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
2062 Dim3 operator() (std::u
int64_t icell) const
2064 return
intVect(icell).dim3();
2067 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
2068 std::u
int64_t numPts () const { return npts; }
2079 : npts(box.numPts()),
2090 Dim3 operator() (std::uint64_t icell)
const
2092 return {
int(icell)+lo, 0, 0};
2096 std::uint64_t
numPts ()
const {
return npts; }
#define BL_ASSERT(EX)
Definition: AMReX_BLassert.H:39
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
int idir
Definition: AMReX_HypreMLABecLap.cpp:1093
Array4< int const > offset
Definition: AMReX_HypreMLABecLap.cpp:1089
Array4< Real > fine
Definition: AMReX_InterpFaceRegister.cpp:90
int MPI_Datatype
Definition: AMReX_ccse-mpi.H:49
Definition: AMReX_Box.H:1174
int * p
Definition: AMReX_Box.H:1189
Box make_box() const noexcept
Definition: AMReX_Box.H:1182
int * data() const &noexcept
Definition: AMReX_Box.H:1179
std::vector< int > v
Definition: AMReX_Box.H:1190
static int size() noexcept
Definition: AMReX_Box.H:1186
Definition: AMReX_Box.H:1193
virtual Box doit(const Box &fine) const =0
virtual ~BoxConverter()=default
virtual BoxConverter * clone() const =0
A Rectangular Domain on an Integer Lattice.
Definition: AMReX_Box.H:43
AMREX_GPU_HOST_DEVICE BoxND & surroundingNodes() noexcept
Convert to NODE type in all directions.
Definition: AMReX_Box.H:946
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< new_dim > resize() const noexcept
Returns a new BoxND of size new_dim by either shrinking or expanding this BoxND.
Definition: AMReX_Box.H:831
IntVectND< dim > smallend
Definition: AMReX_Box.H:840
AMREX_GPU_HOST_DEVICE BoxND & minBox(const BoxND &b) noexcept
Modify BoxND to that of the minimum BoxND containing both the original BoxND and the argument....
Definition: AMReX_Box.H:583
AMREX_GPU_HOST_DEVICE IntVectND< dim > atOffset(Long offset) const noexcept
Given the offset, compute IntVectND<dim>
Definition: AMReX_Box.H:1009
AMREX_GPU_HOST_DEVICE const IntVectND< dim > & smallEnd() const &noexcept
Get the smallend of the BoxND.
Definition: AMReX_Box.H:105
static AMREX_GPU_HOST_DEVICE BoxND TheUnitBox() noexcept
This static member function returns a constant reference to an object of type BoxND representing the ...
Definition: AMReX_Box.H:737
AMREX_GPU_HOST_DEVICE BoxND & refine(int ref_ratio) noexcept
Refine BoxND by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo*ratio...
Definition: AMReX_Box.H:684
IndexTypeND< dim > btype
Definition: AMReX_Box.H:842
AMREX_GPU_HOST_DEVICE bool isSquare() const noexcept
Definition: AMReX_Box.H:1079
AMREX_GPU_HOST_DEVICE BoxND & shift(int dir, int nzones) noexcept
Shift this BoxND nzones indexing positions in coordinate direction dir.
Definition: AMReX_Box.H:496
AMREX_GPU_HOST_DEVICE BoxND(const IntVectND< dim > &small, const int *vec_len) noexcept
Construct BoxND with specified lengths.
Definition: AMReX_Box.H:68
AMREX_GPU_HOST_DEVICE void next(IntVectND< dim > &) const noexcept
Step through the rectangle. It is a runtime error to give a point not inside rectangle....
Definition: AMReX_Box.H:1059
constexpr AMREX_GPU_HOST_DEVICE BoxND(const IntVectND< dim > &small, const IntVectND< dim > &big) noexcept
Construct cell-centered type BoxND.
Definition: AMReX_Box.H:61
AMREX_GPU_HOST_DEVICE BoxND & grow(int i) noexcept
Definition: AMReX_Box.H:627
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< new_dim > shrink() const noexcept
Returns a new BoxND of dimension new_dim and assigns the first new_dim dimension of this BoxND to it.
Definition: AMReX_Box.H:802
AMREX_GPU_HOST_DEVICE IndexTypeND< dim > ixType() const noexcept
Returns the indexing type.
Definition: AMReX_Box.H:127
AMREX_GPU_HOST_DEVICE BoxND & makeSlab(int direction, int slab_index) noexcept
Definition: AMReX_Box.H:779
AMREX_GPU_HOST_DEVICE BoxND & convert(IndexTypeND< dim > typ) noexcept
Convert the BoxND from the current type into the argument type. This may change the BoxND coordinates...
Definition: AMReX_Box.H:912
AMREX_GPU_HOST_DEVICE IntVectND< dim > type() const noexcept
Returns the indexing type.
Definition: AMReX_Box.H:131
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< new_dim > expand() const noexcept
Returns a new BoxND of size new_dim and assigns all values of this BoxND to it and (small=0,...
Definition: AMReX_Box.H:817
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int indims() noexcept
Definition: AMReX_Box.H:792
AMREX_GPU_HOST_DEVICE bool coarsenable(int refrat, int min_width=1) const noexcept
Definition: AMReX_Box.H:758
AMREX_GPU_HOST_DEVICE const IntVectND< dim > & bigEnd() const &noexcept
Get the bigend.
Definition: AMReX_Box.H:116
AMREX_GPU_HOST_DEVICE BoxND & enclosedCells() noexcept
Convert to CELL type in all directions.
Definition: AMReX_Box.H:978
IntVectND< dim > bigend
Definition: AMReX_Box.H:841
AMREX_GPU_HOST_DEVICE void normalize() noexcept
Definition: AMReX_Box.H:769
AMREX_GPU_HOST_DEVICE BoxND & coarsen(const IntVectND< dim > &ref_ratio) noexcept
Coarsen BoxND by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo/rati...
Definition: AMReX_Box.H:866
AMREX_GPU_HOST_DEVICE IntVectND< dim > length() const noexcept
Return the length of the BoxND.
Definition: AMReX_Box.H:146
AMREX_GPU_HOST_DEVICE bool coarsenable(const IntVectND< dim > &refrat, int min_width=1) const noexcept
Definition: AMReX_Box.H:763
AMREX_GPU_HOST_DEVICE BoxND & growHi(int idir, int n_cell=1) noexcept
Grow the BoxND on the high end by n_cell cells in direction idir. NOTE: n_cell negative shrinks the B...
Definition: AMReX_Box.H:659
AMREX_GPU_HOST_DEVICE BoxND(const IntVectND< dim > &small, const IntVectND< dim > &big, const IntVectND< dim > &typ) noexcept
Construct BoxND with given type. small and big are expected to be consistent with given type.
Definition: AMReX_Box.H:78
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE std::size_t ndims() noexcept
Definition: AMReX_Box.H:787
AMREX_GPU_HOST_DEVICE BoxND & growLo(int idir, int n_cell=1) noexcept
Grow the BoxND on the low end by n_cell cells in direction idir. NOTE: n_cell negative shrinks the Bo...
Definition: AMReX_Box.H:648
AMREX_GPU_HOST_DEVICE BoxND(const IntVectND< dim > &small, const IntVectND< dim > &big, IndexTypeND< dim > t) noexcept
Construct dimension specific Boxes.
Definition: AMReX_Box.H:88
constexpr AMREX_GPU_HOST_DEVICE BoxND() noexcept
Definition: AMReX_Box.H:54
AMREX_GPU_HOST_DEVICE BoxND & coarsen(int ref_ratio) noexcept
Coarsen BoxND by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo/rati...
Definition: AMReX_Box.H:708
AMREX_GPU_HOST_DEVICE Long numPts() const noexcept
Returns the number of points contained in the BoxND.
Definition: AMReX_Box.H:346
Cell-Based or Node-Based Indices.
Definition: AMReX_IndexType.H:33
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void unset(int dir) noexcept
Set IndexTypeND to be CELL based in direction dir.
Definition: AMReX_IndexType.H:72
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void set(int dir) noexcept
Set IndexTypeND to be NODE based in direction dir.
Definition: AMReX_IndexType.H:69
Definition: AMReX_IntVect.H:48
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & coarsen(const IntVectND< dim > &p) noexcept
Modify IntVectND<dim> by component-wise integer projection.
Definition: AMReX_IntVect.H:844
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND & setVal(int i, int val) noexcept
Set i'th coordinate of IntVectND to val.
Definition: AMReX_IntVect.H:274
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE int * begin() noexcept
Returns a pointer to the first element of the IntVectND.
Definition: AMReX_IntVect.H:258
Encapsulation of the Orientation of the Faces of a Box.
Definition: AMReX_Orientation.H:29
AMREX_GPU_HOST_DEVICE int coordDir() const noexcept
Returns the coordinate direction.
Definition: AMReX_Orientation.H:83
AMREX_GPU_HOST_DEVICE bool isLow() const noexcept
Returns true if Orientation is low.
Definition: AMReX_Orientation.H:89
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition: AMReX_Vector.H:27
AMREX_GPU_HOST_DEVICE Long size(T const &b) noexcept
integer version
Definition: AMReX_GpuRange.H:26
@ min
Definition: AMReX_ParallelReduce.H:18
@ max
Definition: AMReX_ParallelReduce.H:17
std::istream & box_read(std::istream &is, int *smallend, int *bigend, int *type, int dim)
Definition: AMReX_Box.cpp:44
std::ostream & box_write(std::ostream &os, const int *smallend, const int *bigend, const int *type, int dim)
Definition: AMReX_Box.cpp:20
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE int get_sum()
Definition: AMReX_IntVect.H:1132
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE auto BoxSplit_imp(std::index_sequence< Ns... >, const T &lo, const T &hi, const U &typ) noexcept
Definition: AMReX_Box.H:1684
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > min_ubound_iv(BoxND< dim > const &b1, IntVectND< dim > const &hi) noexcept
Definition: AMReX_Box.H:1854
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE BoxND< new_dim > BoxResize(const BoxND< old_dim > &bx) noexcept
Returns a new BoxND of size new_dim by either shrinking or expanding this BoxND.
Definition: AMReX_Box.H:1772
AMREX_FORCE_INLINE auto getIndexBounds(T const &b1, T const &b2, Ts const &... b3) noexcept
Definition: AMReX_Box.H:1968
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > adjCellLo(const BoxND< dim > &b, int dir, int len=1) noexcept
Returns the cell centered BoxND of length len adjacent to b on the low end along the coordinate direc...
Definition: AMReX_Box.H:1591
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE BoxND< new_dim > BoxShrink(const BoxND< old_dim > &bx) noexcept
Returns a new BoxND of dimension new_dim and assigns the first new_dim dimension of this BoxND to it.
Definition: AMReX_Box.H:1747
BoxND< AMREX_SPACEDIM > Box
Definition: AMReX_BaseFwd.H:27
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > growHi(const BoxND< dim > &b, Direction d, int n_cell) noexcept
Definition: AMReX_Box.H:1286
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > ubound_iv(BoxND< dim > const &box) noexcept
Definition: AMReX_Box.H:1789
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > adjCellHi(const BoxND< dim > &b, int dir, int len=1) noexcept
Similar to adjCellLo but builds an adjacent BoxND on the high end.
Definition: AMReX_Box.H:1612
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 length(BoxND< dim > const &box) noexcept
Definition: AMReX_Box.H:1899
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE BoxND< new_dim > BoxExpand(const BoxND< old_dim > &bx) noexcept
Returns a new BoxND of size new_dim and assigns all values of this BoxND to it and (small=0,...
Definition: AMReX_Box.H:1760
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE IndexTypeND< detail::get_sum< d, dims... >)> IndexTypeCat(const IndexTypeND< d > &v, const IndexTypeND< dims > &...vects) noexcept
Returns a IndexTypeND obtained by concatenating the input IndexTypeNDs. The dimension of the return v...
Definition: AMReX_IndexType.H:290
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > adjCell(const BoxND< dim > &b, Orientation face, int len=1) noexcept
Similar to adjCellLo and adjCellHi; operates on given face.
Definition: AMReX_Box.H:1634
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE GpuTuple< IntVectND< d >, IntVectND< dims >... > IntVectSplit(const IntVectND< detail::get_sum< d, dims... >()> &v) noexcept
Returns a tuple of IntVectND obtained by splitting the input IntVectND according to the dimensions sp...
Definition: AMReX_IntVect.H:1175
constexpr AMREX_GPU_HOST_DEVICE GpuTuple< detail::tuple_decay_t< Ts >... > makeTuple(Ts &&... args)
Definition: AMReX_Tuple.H:252
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > bdryNode(const BoxND< dim > &b, Orientation face, int len=1) noexcept
Similar to bdryLo and bdryHi except that it operates on the given face of box b.
Definition: AMReX_Box.H:1549
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > getCell(BoxND< dim > const *boxes, int nboxes, Long icell) noexcept
Definition: AMReX_Box.H:1978
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > bdryLo(const BoxND< dim > &b, int dir, int len=1) noexcept
Returns the edge-centered BoxND (in direction dir) defining the low side of BoxND b.
Definition: AMReX_Box.H:1502
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > begin_iv(BoxND< dim > const &box) noexcept
Definition: AMReX_Box.H:1798
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE BoxND< detail::get_sum< d, dims... >)> BoxCat(const BoxND< d > &bx, const BoxND< dims > &...boxes) noexcept
Returns a BoxND obtained by concatenating the input BoxNDs. The dimension of the return value equals ...
Definition: AMReX_Box.H:1717
std::ostream & operator<<(std::ostream &os, const BoxND< dim > &bx)
Write an ASCII representation to the ostream.
Definition: AMReX_Box.H:1692
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > growLo(const BoxND< dim > &b, Direction d, int n_cell) noexcept
Definition: AMReX_Box.H:1266
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > refine(const BoxND< dim > &b, const IntVectND< dim > &ref_ratio) noexcept
Refine BoxND by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo*ratio...
Definition: AMReX_Box.H:1360
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > surroundingNodes(const BoxND< dim > &b) noexcept
Returns a BoxND with NODE based coordinates in all directions that encloses BoxND b.
Definition: AMReX_Box.H:1423
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE GpuTuple< BoxND< d >, BoxND< dims >... > BoxSplit(const BoxND< detail::get_sum< d, dims... >()> &bx) noexcept
Returns a tuple of BoxNDs obtained by splitting the input BoxND according to the dimensions specified...
Definition: AMReX_Box.H:1732
IntVectND< AMREX_SPACEDIM > IntVect
Definition: AMReX_BaseFwd.H:30
Direction
Definition: AMReX_Orientation.H:14
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > lbound_iv(BoxND< dim > const &box) noexcept
Definition: AMReX_Box.H:1780
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > grow(const BoxND< dim > &b, Direction d, int n_cell) noexcept
Definition: AMReX_Box.H:1246
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > length_iv(BoxND< dim > const &box) noexcept
Definition: AMReX_Box.H:1816
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > end_iv(BoxND< dim > const &box) noexcept
Definition: AMReX_Box.H:1807
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > max_lbound_iv(BoxND< dim > const &b1, IntVectND< dim > const &lo) noexcept
Definition: AMReX_Box.H:1835
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > minBox(const BoxND< dim > &b1, const BoxND< dim > &b2) noexcept
Modify BoxND to that of the minimum BoxND containing both the original BoxND and the argument....
Definition: AMReX_Box.H:1670
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 length(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:322
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > shift(const BoxND< dim > &b, const IntVectND< dim > &nzones) noexcept
Definition: AMReX_Box.H:1383
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > coarsen(const BoxND< dim > &b, const IntVectND< dim > &ref_ratio) noexcept
Coarsen BoxND by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo/rati...
Definition: AMReX_Box.H:1324
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > convert(const BoxND< dim > &b, const IndexTypeND< dim > &typ) noexcept
Definition: AMReX_Box.H:1446
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > growHi(const BoxND< dim > &b, int idir, int n_cell) noexcept
Definition: AMReX_Box.H:1275
const int[]
Definition: AMReX_BLProfiler.cpp:1664
void AllGatherBoxes(Vector< Box > &bxs, int n_extra_reserve)
Definition: AMReX_Box.cpp:120
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > makeSlab(BoxND< dim > const &b, int direction, int slab_index) noexcept
Definition: AMReX_Box.H:1998
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > makeSingleCellBox(IntVectND< dim > const &vect, IndexTypeND< dim > typ=IndexTypeND< dim >::TheCellType())
Definition: AMReX_Box.H:2020
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE GpuTuple< IndexTypeND< d >, IndexTypeND< dims >... > IndexTypeSplit(const IndexTypeND< detail::get_sum< d, dims... >()> &v) noexcept
Returns a tuple of IndexTypeND obtained by splitting the input IndexTypeND according to the dimension...
Definition: AMReX_IndexType.H:310
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE IntVectND< detail::get_sum< d, dims... >)> IntVectCat(const IntVectND< d > &v, const IntVectND< dims > &...vects) noexcept
Returns a IntVectND obtained by concatenating the input IntVectNDs. The dimension of the return value...
Definition: AMReX_IntVect.H:1159
std::istream & operator>>(std::istream &is, BoxND< dim > &bx)
Read from istream.
Definition: AMReX_Box.H:1700
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > bdryHi(const BoxND< dim > &b, int dir, int len=1) noexcept
Returns the edge-centered BoxND (in direction dir) defining the high side of BoxND b.
Definition: AMReX_Box.H:1525
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > enclosedCells(const BoxND< dim > &b) noexcept
Returns a BoxND with CELL based coordinates in all directions that is enclosed by b.
Definition: AMReX_Box.H:1487
Definition: AMReX_FabArrayCommI.H:896
Definition: AMReX_Box.H:2073
BoxIndexerND(BoxND< 1 > const &box)
Definition: AMReX_Box.H:2078
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE std::uint64_t numPts() const
Definition: AMReX_Box.H:2096
std::uint64_t npts
Definition: AMReX_Box.H:2074
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< 1 > intVect(std::uint64_t icell) const
Definition: AMReX_Box.H:2084
int lo
Definition: AMReX_Box.H:2076
Definition: AMReX_Box.H:2027
BoxIndexerND(BoxND< dim > const &box)
Definition: AMReX_Box.H:2032
IntVectND< dim > lo
Definition: AMReX_Box.H:2030
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > intVect(std::uint64_t icell) const
Definition: AMReX_Box.H:2044
std::uint64_t npts
Definition: AMReX_Box.H:2028
CellIndex
The cell index type: one of CELL or NODE.
Definition: AMReX_IndexType.H:20
Definition: AMReX_Dim3.H:12
Definition: AMReX_Array.H:34
Definition: AMReX_Math.H:343
static MPI_Datatype type()