Block-Structured AMR Software Framework
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
AMReX_IntVect.H
Go to the documentation of this file.
1#ifndef AMREX_INTVECT_H_
2#define AMREX_INTVECT_H_
3#include <AMReX_Config.H>
4
5#include <AMReX_INT.H>
6#include <AMReX_SPACE.H>
7#include <AMReX_Array.H>
8#include <AMReX_Vector.H>
9#include <AMReX_Dim3.H>
10#include <AMReX_BLassert.H>
11#include <AMReX_Extension.H>
12#include <AMReX_GpuQualifiers.H>
13#include <AMReX_Math.H>
14#include <AMReX_Tuple.H>
15#include <AMReX_TypeTraits.H>
16
17#include <iosfwd>
18#include <cstdlib>
19#include <cmath>
20#include <limits>
21#include <climits>
22#include <algorithm>
23
24namespace amrex {
25
27int coarsen (int i, int ratio) noexcept
28{
29 switch (ratio) {
30 case 1: return i;
31 case 2: return (i<0) ? -std::abs(i+1)/2 -1 : i/2;
32 case 4: return (i<0) ? -std::abs(i+1)/4 -1 : i/4;
33 default: return (i<0) ? -std::abs(i+1)/ratio-1 : i/ratio;
34 }
35}
36
46template<int dim>
48{
49public:
50 static_assert(dim >= 1, "The number of dimensions of IntVectND must be positive");
51
52 struct shift_hasher {
53 std::size_t operator()(const IntVectND<dim>& vec) const noexcept
54 {
55 static constexpr unsigned shift1 = sizeof(size_t)>=8 ? 20 : 10;
56 static constexpr unsigned shift2 = sizeof(size_t)>=8 ? 40 : 20;
57 if constexpr (dim == 1) {
60 return static_cast<std::size_t>(vec[0]);
61 } else if constexpr (dim == 2) {
63 return static_cast<std::size_t>(vec[0]) ^
64 (static_cast<std::size_t>(vec[1]) << shift1);
65 } else if constexpr (dim == 3) {
66 return static_cast<std::size_t>(vec[0]) ^
67 (static_cast<std::size_t>(vec[1]) << shift1) ^
68 (static_cast<std::size_t>(vec[2]) << shift2);
69 } else {
70 std::size_t seed = dim;
71 // hash function from
72 // https://stackoverflow.com/questions/20511347/a-good-hash-function-for-a-vector
73 for (int i=0; i<dim; ++i) {
74 auto x = static_cast<unsigned int>(vec[i]);
75 x = ((x >> 16) ^ x) * 0x45d9f3b;
76 x = ((x >> 16) ^ x) * 0x45d9f3b;
77 x = (x >> 16) ^ x;
78 seed ^= x + 0x9e3779b9 + (seed << 6) + (seed >> 2);
79 }
80 return seed;
81 }
82 }
83 };
84
86
88
91 constexpr IntVectND () noexcept {} // cannot use = default due to Clang bug // NOLINT
92
98 template <class...Args,
99 std::enable_if_t<
100 (sizeof...(Args)+2 == dim) &&
101 IsConvertible_v<int, Args...>,
102 int> = 0>
104 constexpr IntVectND (int i, int j, Args...ks) noexcept : vect{i, j, static_cast<int>(ks)...} {}
105
110 explicit constexpr IntVectND (int s) noexcept {
111 for (int i=0; i<dim; ++i) {
112 vect[i] = s;
113 }
114 }
115
121 explicit IntVectND (const int* a) noexcept {
122 for (int i=0; i<dim; ++i) {
123 vect[i] = a[i];
124 }
125 }
126
132 explicit IntVectND (const Vector<int>& a) noexcept {
133 BL_ASSERT(a.size() == dim);
134 for (int i=0; i<dim; ++i) {
135 vect[i] = a[i];
136 }
137 }
138
142 explicit IntVectND (const Array<int,dim>& a) noexcept {
143 for (int i=0; i<dim; ++i) {
144 vect[i] = a[i];
145 }
146 }
147
148 template <int N=dim, std::enable_if_t<( 1<=N && N<=3 ), int> = 0>
149 explicit constexpr IntVectND (Dim3 const& a) noexcept {
150 vect[0] = a.x;
151 if constexpr (dim >= 2) {
152 vect[1] = a.y;
153 }
154 if constexpr (dim == 3) {
155 vect[2] = a.z;
156 }
157 }
158
159 // dtor, copy-ctor, copy-op=, move-ctor, and move-op= are compiler generated.
160
161 template <int N=dim, std::enable_if_t<( 1<=N && N<=3 ), int> = 0>
162 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
163 Dim3 dim3 () const noexcept {
164 if constexpr (dim == 1) {
165 return Dim3{vect[0],0,0};
166 } else if constexpr (dim == 2) {
167 return Dim3{vect[0],vect[1],0};
168 } else {
169 return Dim3{vect[0],vect[1],vect[2]};
170 }
171 }
172
173 template <int N=dim, std::enable_if_t<( 1<=N && N<=3 ), int> = 0>
174 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
175 Dim3 dim3 ([[maybe_unused]] int fill_extra) const noexcept {
176 if constexpr (dim == 1) {
177 return Dim3{vect[0],fill_extra,fill_extra};
178 } else if constexpr (dim == 2) {
179 return Dim3{vect[0],vect[1],fill_extra};
180 } else {
181 return Dim3{vect[0],vect[1],vect[2]};
182 }
183 }
184
185 template< typename T = int >
188 toArray () const noexcept {
189 Array<T, dim> ret {};
190 for (int i=0; i<dim; ++i) {
191 ret[i] = T(vect[i]);
192 }
193 return ret;
194 }
195
197
201 int sum () const noexcept
202 {
203 int retval = vect[0];
204 for (int i=1; i<dim; ++i) {
205 retval += vect[i];
206 }
207 return retval;
208 }
209
212 int max () const noexcept
213 {
214 int retval = vect[0];
215 for (int i=1; i<dim; ++i) {
216 retval = retval > vect[i] ? retval : vect[i];
217 }
218 return retval;
219 }
220
223 int min () const noexcept
224 {
225 int retval = vect[0];
226 for (int i=1; i<dim; ++i) {
227 retval = retval < vect[i] ? retval : vect[i];
228 }
229 return retval;
230 }
231
232 //return coordinate with largest value
234 int maxDir(bool a_doAbsValue) const noexcept;
235
237 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr
238 int& operator[] (int i) noexcept { BL_ASSERT(i>=0 && i < dim); return vect[i]; }
239
241 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr
242 const int& operator[] (int i) const noexcept { BL_ASSERT(i>=0 && i < dim); return vect[i]; }
243
245 template<std::size_t i>
246 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr
247 int& get () noexcept {static_assert(0<=i && i<dim); return vect[i];}
248
250 template<std::size_t i>
251 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr
252 const int& get () const noexcept {static_assert(0<=i && i<dim); return vect[i];}
253
255 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr
256 int* begin () noexcept { return &vect[0]; }
257
259 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr
260 const int* begin () const noexcept { return &vect[0]; }
261
263 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr
264 int* end () noexcept { return &vect[dim]; }
265
267 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr
268 const int* end () const noexcept { return &vect[dim]; }
269
272 IntVectND& setVal (int i, int val) noexcept
273 {
274 BL_ASSERT(i>=0 && i<dim); vect[i] = val; return *this;
275 }
276
282 const int* getVect () const& noexcept { return vect; }
284 int* getVect () & noexcept { return vect; }
286 int* getVect () && = delete;
287
290 bool operator== (int val) const noexcept
291 {
292 bool retval = vect[0] == val;
293 for (int i=1; i<dim; ++i) {
294 retval = retval && vect[i] == val;
295 }
296 return retval;
297 }
298
301 bool operator!= (int val) const noexcept
302 {
303 bool retval = vect[0] != val;
304 for (int i=1; i<dim; ++i) {
305 retval = retval || vect[i] != val;
306 }
307 return retval;
308 }
309
312 bool operator== (const IntVectND<dim>& rhs) const noexcept
313 {
314 bool retval = vect[0] == rhs[0];
315 for (int i=1; i<dim; ++i) {
316 retval = retval && vect[i] == rhs[i];
317 }
318 return retval;
319 }
322 bool operator!= (const IntVectND<dim>& rhs) const noexcept
323 {
324 bool retval = vect[0] != rhs[0];
325 for (int i=1; i<dim; ++i) {
326 retval = retval || vect[i] != rhs[i];
327 }
328 return retval;
329 }
332 bool operator< (const IntVectND<dim>& rhs) const noexcept
333 {
334 for (int i=dim-1; i>=0; --i) {
335 if (vect[i] < rhs[i]) {
336 return true;
337 } else if (vect[i] > rhs[i]) {
338 return false;
339 }
340 }
341 return false;
342 }
345 bool operator<= (const IntVectND<dim>& rhs) const noexcept
346 {
347 return !(rhs < *this);
348 }
351 bool operator> (const IntVectND<dim>& rhs) const noexcept
352 {
353 return rhs < *this;
354 }
357 bool operator>= (const IntVectND<dim>& rhs) const noexcept
358 {
359 return !(*this < rhs);
360 }
366 bool allLT (const IntVectND<dim>& rhs) const noexcept
367 {
368 bool retval = vect[0] < rhs[0];
369 for (int i=1; i<dim; ++i) {
370 retval = retval && vect[i] < rhs[i];
371 }
372 return retval;
373 }
378 bool allLT (int rhs) const noexcept
379 {
380 bool retval = vect[0] < rhs;
381 for (int i=1; i<dim; ++i) {
382 retval = retval && vect[i] < rhs;
383 }
384 return retval;
385 }
391 bool allLE (const IntVectND<dim>& rhs) const noexcept
392 {
393 bool retval = vect[0] <= rhs[0];
394 for (int i=1; i<dim; ++i) {
395 retval = retval && vect[i] <= rhs[i];
396 }
397 return retval;
398 }
403 bool allLE (int rhs) const noexcept
404 {
405 bool retval = vect[0] <= rhs;
406 for (int i=1; i<dim; ++i) {
407 retval = retval && vect[i] <= rhs;
408 }
409 return retval;
410 }
416 bool allGT (const IntVectND<dim>& rhs) const noexcept
417 {
418 bool retval = vect[0] > rhs[0];
419 for (int i=1; i<dim; ++i) {
420 retval = retval && vect[i] > rhs[i];
421 }
422 return retval;
423 }
428 bool allGT (int rhs) const noexcept
429 {
430 bool retval = vect[0] > rhs;
431 for (int i=1; i<dim; ++i) {
432 retval = retval && vect[i] > rhs;
433 }
434 return retval;
435 }
441 bool allGE (const IntVectND<dim>& rhs) const noexcept
442 {
443 bool retval = vect[0] >= rhs[0];
444 for (int i=1; i<dim; ++i) {
445 retval = retval && vect[i] >= rhs[i];
446 }
447 return retval;
448 }
453 bool allGE (int rhs) const noexcept
454 {
455 bool retval = vect[0] >= rhs;
456 for (int i=1; i<dim; ++i) {
457 retval = retval && vect[i] >= rhs;
458 }
459 return retval;
460 }
463 IntVectND<dim> operator+ () const noexcept { return *this; }
466 IntVectND<dim> operator- () const noexcept {
467 IntVectND<dim> retval(0);
468 for (int i=0; i<dim; ++i) {
469 retval[i] = -vect[i];
470 }
471 return retval;
472 }
476 {
477 for (int i=0; i<dim; ++i) {
478 vect[i] += s;
479 }
480 return *this;
481 }
485 {
486 for (int i=0; i<dim; ++i) {
487 vect[i] += p[i];
488 }
489 return *this;
490 }
494 {
495 for (int i=0; i<dim; ++i) {
496 vect[i] *= s;
497 }
498 return *this;
499 }
503 {
504 for (int i=0; i<dim; ++i) {
505 vect[i] *= p[i];
506 }
507 return *this;
508 }
512 {
513 for (int i=0; i<dim; ++i) {
514 vect[i] /= s;
515 }
516 return *this;
517 }
521 {
522 for (int i=0; i<dim; ++i) {
523 vect[i] /= p[i];
524 }
525 return *this;
526 }
530 {
531 for (int i=0; i<dim; ++i) {
532 vect[i] -= s;
533 }
534 return *this;
535 }
539 {
540 for (int i=0; i<dim; ++i) {
541 vect[i] -= p[i];
542 }
543 return *this;
544 }
547 IntVectND<dim> operator+ (const IntVectND<dim>& p) const noexcept
548 {
549 IntVectND<dim> retval = *this;
550 return retval += p;
551 }
554 IntVectND<dim> operator+ (int s) const noexcept
555 {
556 IntVectND<dim> retval = *this;
557 return retval += s;
558 }
561 IntVectND<dim> operator- (const IntVectND<dim>& p) const noexcept
562 {
563 IntVectND<dim> retval = *this;
564 return retval -= p;
565 }
568 IntVectND<dim> operator- (int s) const noexcept
569 {
570 IntVectND<dim> retval = *this;
571 return retval -= s;
572 }
575 IntVectND<dim> operator* (const IntVectND<dim>& p) const noexcept
576 {
577 IntVectND<dim> retval = *this;
578 return retval *= p;
579 }
582 IntVectND<dim> operator* (int s) const noexcept
583 {
584 IntVectND<dim> retval = *this;
585 return retval *= s;
586 }
589 IntVectND<dim> operator/ (const IntVectND<dim>& p) const noexcept
590 {
591 IntVectND<dim> retval = *this;
592 return retval /= p;
593 }
596 IntVectND<dim> operator/ (int s) const noexcept
597 {
598 IntVectND<dim> retval = *this;
599 return retval /= s;
600 }
603 IntVectND<dim>& min (const IntVectND<dim>& p) noexcept
604 {
605 for (int i=0; i<dim; ++i) {
606 vect[i] = (vect[i] < p.vect[i] ? vect[i] : p.vect[i]);
607 }
608 return *this;
609 }
612 IntVectND<dim>& max (const IntVectND<dim>& p) noexcept
613 {
614 for (int i=0; i<dim; ++i) {
615 vect[i] = (vect[i] > p.vect[i] ? vect[i] : p.vect[i]);
616 }
617 return *this;
618 }
621 IntVectND<dim>& scale (int s) noexcept {
622 for (int i=0; i<dim; ++i) {
623 vect[i] *= s;
624 }
625 return *this;
626 }
632 IntVectND<dim>& reflect (int ref_ix, int idir) noexcept
633 {
634 BL_ASSERT(idir >= 0 && idir < dim);
635 vect[idir] = -vect[idir] + 2*ref_ix;
636 return *this;
637 }
640 IntVectND<dim>& shift (int coord, int s) noexcept
641 {
642 BL_ASSERT(coord >= 0 && coord < dim); vect[coord] += s; return *this;
643 }
646 IntVectND<dim>& shift (const IntVectND<dim>& iv) noexcept { *this += iv; return *this; }
649 IntVectND<dim>& diagShift (int s) noexcept
650 {
651 for (int i=0; i<dim; ++i) {
652 vect[i] += s;
653 }
654 return *this;
655 }
661 IntVectND<dim>& coarsen (int p) noexcept;
662
670 static constexpr IntVectND<dim> TheZeroVector () noexcept {
671 return IntVectND<dim>(0);
672 }
680 static constexpr IntVectND<dim> TheUnitVector () noexcept {
681 return IntVectND<dim>(1);
682 }
689 static constexpr IntVectND<dim> TheDimensionVector (int d) noexcept {
690 IntVectND<dim> retval(0);
691 retval[d] = 1;
692 return retval;
693 }
700 static constexpr IntVectND<dim> TheNodeVector () noexcept {
701 return IntVectND<dim>(1);
702 }
709 static constexpr IntVectND<dim> TheCellVector () noexcept {
710 return IntVectND<dim>(0);
711 }
712
714 static constexpr IntVectND<dim> TheMaxVector () noexcept {
715 return IntVectND<dim>(std::numeric_limits<int>::max());
716 }
718 static constexpr IntVectND<dim> TheMinVector () noexcept {
719 return IntVectND<dim>(std::numeric_limits<int>::lowest());
720 }
721
723 static constexpr std::size_t size () noexcept {
724 return static_cast<std::size_t>(dim);
725 }
726
728 static constexpr int isize () noexcept {
729 return dim;
730 }
731
733
738 template<int new_dim>
740 IntVectND<new_dim> shrink () const noexcept {
741 static_assert(new_dim <= dim);
742 return IntVectND<new_dim>(this->begin());
743 }
744
749 template<int new_dim>
751 IntVectND<new_dim> expand (int fill_extra=0) const noexcept {
752 static_assert(new_dim >= dim);
753 IntVectND<new_dim> retval(fill_extra);
754 for (int i=0; i<dim; ++i) {
755 retval[i] = vect[i];
756 }
757 return retval;
758 }
759
764 template<int new_dim>
766 IntVectND<new_dim> resize (int fill_extra=0) const noexcept {
767 if constexpr (new_dim > dim) {
768 return expand<new_dim>(fill_extra);
769 } else {
770 return shrink<new_dim>();
771 }
772 }
773
777 static const IntVectND<dim> Zero;
778
782 static const IntVectND<dim> Unit;
783
784private:
785
786 int vect[dim] = {};
787};
788
789template <int dim>
790inline constexpr const IntVectND<dim> IntVectND<dim>::Zero{0};
791
792template <int dim>
793inline constexpr const IntVectND<dim> IntVectND<dim>::Unit{1};
794
795// Template deduction guide for IntVectND
796template<std::size_t dim>
797AMREX_GPU_HOST_DEVICE // __device__ for HIP
799
800// Template deduction guide for IntVectND
801template <class...Args,
802 std::enable_if_t<
803 IsConvertible_v<int, Args...>,
804 int> = 0>
805AMREX_GPU_HOST_DEVICE // __device__ for HIP
806IntVectND(int, int, Args...) -> IntVectND<sizeof...(Args)+2>;
807
809
810template<int dim>
815{
816 BL_ASSERT(s > 0);
817 switch (s) {
818 case 1:
819 break;
820 case 2:
821 for (int i=0; i<dim; ++i) {
822 vect[i] = (vect[i]<0) ? -std::abs(vect[i]+1)/2-1 : vect[i]/2;
823 }
824 break;
825 case 4:
826 for (int i=0; i<dim; ++i) {
827 vect[i] = (vect[i]<0) ? -std::abs(vect[i]+1)/4-1 : vect[i]/4;
828 }
829 break;
830 default:
831 for (int i=0; i<dim; ++i) {
832 vect[i] = (vect[i]<0) ? -std::abs(vect[i]+1)/s-1 : vect[i]/s;
833 }
834 }
835 return *this;
836}
837
838template<int dim>
843{
844 BL_ASSERT(p.allGT(0));
845 for (int i=0; i<dim; ++i) {
846 vect[i] = amrex::coarsen(vect[i], p.vect[i]);
847 }
848 return *this;
849}
850
851template<int dim>
854int
855IntVectND<dim>::maxDir(bool a_doAbsValue) const noexcept
856{
857 int retval = 0;
858 if(a_doAbsValue)
859 {
860 int maxval = std::abs((*this)[0]);
861 for(int idir = 1; idir < dim; idir++)
862 {
863 int curval = std::abs((*this)[idir]);
864 if(curval > maxval)
865 {
866 maxval = curval;
867 retval = idir;
868 }
869 }
870 }
871 else
872 {
873 int maxval = (*this)[0];
874 for(int idir = 1; idir < dim; idir++)
875 {
876 int curval = (*this)[idir];
877 if(curval > maxval)
878 {
879 maxval = curval;
880 retval = idir;
881 }
882 }
883 }
884 return retval;
885}
886
888template<int dim>
891IntVectND<dim> operator+ (int s, const IntVectND<dim>& p) noexcept
892{
893 IntVectND<dim> retval = p;
894 for (int i=0; i<dim; ++i) {
895 retval[i] = s + retval[i];
896 }
897 return retval;
898}
899
901template<int dim>
905IntVectND<dim> operator- (int s, const IntVectND<dim>& p) noexcept
906{
907 IntVectND<dim> retval = p;
908 for (int i=0; i<dim; ++i) {
909 retval[i] = s - retval[i];
910 }
911 return retval;
912}
913
915template<int dim>
918IntVectND<dim> operator* (int s, const IntVectND<dim>& p) noexcept
919{
920 IntVectND<dim> retval = p;
921 for (int i=0; i<dim; ++i) {
922 retval[i] = s * retval[i];
923 }
924 return retval;
925}
926
931template<int dim>
934IntVectND<dim>
935min (const IntVectND<dim>& p1, const IntVectND<dim>& p2) noexcept
936{
937 IntVectND<dim> p(p1);
938 p.min(p2);
939 return p;
940}
941
942template<int dim>
945IntVectND<dim>
946elemwiseMin (const IntVectND<dim>& p1, const IntVectND<dim>& p2) noexcept
947{
948 IntVectND<dim> p(p1);
949 p.min(p2);
950 return p;
951}
952
957template<int dim>
960IntVectND<dim>
961max (const IntVectND<dim>& p1, const IntVectND<dim>& p2) noexcept
962{
963 IntVectND<dim> p(p1);
964 p.max(p2);
965 return p;
966}
967
968template<int dim>
971IntVectND<dim>
972elemwiseMax (const IntVectND<dim>& p1, const IntVectND<dim>& p2) noexcept
973{
974 IntVectND<dim> p(p1);
975 p.max(p2);
976 return p;
977}
978
984template<int dim = AMREX_SPACEDIM>
987IntVectND<dim>
988BASISV (int dir) noexcept
989{
990 BL_ASSERT(dir >= 0 && dir < dim);
991 IntVectND<dim> tmp(0);
992 tmp[dir] = 1;
993 return tmp;
994}
995
1000template<int dim>
1003IntVectND<dim>
1004scale (const IntVectND<dim>& p, int s) noexcept
1005{
1006 return IntVectND<dim>(p).scale(s);
1007}
1008
1014template<int dim>
1017IntVectND<dim>
1018reflect (const IntVectND<dim>& a, int ref_ix, int idir) noexcept
1019{
1020 return IntVectND<dim>(a).reflect(ref_ix, idir);
1021}
1022
1027template<int dim>
1030IntVectND<dim>
1031diagShift (const IntVectND<dim>& p, int s) noexcept
1032{
1033 return p + s;
1034}
1035
1040template<int dim>
1043IntVectND<dim>
1044coarsen (const IntVectND<dim>& p, int s) noexcept
1045{
1046 BL_ASSERT(s > 0);
1047 IntVectND<dim> v = p;
1048 v.coarsen(s);
1049 return v;
1050}
1051
1056template<int dim>
1059IntVectND<dim>
1060coarsen (const IntVectND<dim>& p1, const IntVectND<dim>& p2) noexcept
1061{
1062 IntVectND<dim> v = p1;
1063 v.coarsen(p2);
1064 return v;
1065}
1066
1067template<int dim, std::enable_if_t<( 1<=dim && dim<=3 ), int> = 0>
1068AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
1069Dim3 refine (Dim3 const& coarse, IntVectND<dim> const& ratio) noexcept
1070{
1071 if constexpr (dim == 1) {
1072 return Dim3{coarse.x*ratio[0], coarse.y, coarse.z};
1073 } else if constexpr (dim == 2) {
1074 return Dim3{coarse.x*ratio[0], coarse.y*ratio[1], coarse.z};
1075 } else {
1076 return Dim3{coarse.x*ratio[0], coarse.y*ratio[1], coarse.z*ratio[2]};
1077 }
1078}
1079
1080template<int dim, std::enable_if_t<( 1<=dim && dim<=3 ), int> = 0>
1081AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
1082Dim3 coarsen (Dim3 const& fine, IntVectND<dim> const& ratio) noexcept
1083{
1084 if constexpr (dim == 1) {
1085 return Dim3{amrex::coarsen(fine.x, ratio[0]),
1086 fine.y,
1087 fine.z};
1088 } else if constexpr (dim == 2) {
1089 return Dim3{amrex::coarsen(fine.x, ratio[0]),
1090 amrex::coarsen(fine.y, ratio[1]),
1091 fine.z};
1092 } else {
1093 return Dim3{amrex::coarsen(fine.x, ratio[0]),
1094 amrex::coarsen(fine.y, ratio[1]),
1095 amrex::coarsen(fine.z, ratio[2])};
1096 }
1097}
1098
1099namespace detail {
1100 std::ostream& int_vector_write (std::ostream& os, const int* iv, int dim);
1101 std::istream& int_vector_read (std::istream& is, int* iv, int dim);
1102
1103 template<int dim>
1105 void IntVectCat_imp (int*& dst, const IntVectND<dim>& src) noexcept {
1106 for (int i=0; i<dim; ++i) {
1107 dst[i] = src[i];
1108 }
1109 dst += dim;
1110 }
1111
1112 template<int dim>
1114 void IntVectSplit_imp2 (IntVectND<dim>& dst, const int*& src) noexcept {
1115 for (int i=0; i<dim; ++i) {
1116 dst[i] = src[i];
1117 }
1118 src += dim;
1119 }
1120
1121 template<class T, std::size_t...Ns>
1123 T IntVectSplit_imp (T& retval, std::index_sequence<Ns...>, const int * src) noexcept {
1124 (IntVectSplit_imp2(amrex::get<Ns>(retval), src), ...);
1125 return retval;
1126 }
1127
1128 template<int...dims>
1130 int get_sum () {
1131 return (0 + ... + dims);
1132 }
1133}
1134
1135template<int dim>
1136std::ostream&
1137operator<< (std::ostream& os, const IntVectND<dim>& iv)
1138{
1139 return detail::int_vector_write(os, iv.begin(), dim);
1140}
1141
1142template<int dim>
1143std::istream&
1144operator>> (std::istream& is, IntVectND<dim>& iv)
1145{
1146 return detail::int_vector_read(is, iv.begin(), dim);
1147}
1148
1153template<int d, int...dims>
1156constexpr IntVectND<detail::get_sum<d, dims...>()>
1157IntVectCat (const IntVectND<d>& v, const IntVectND<dims>&...vects) noexcept {
1158 IntVectND<detail::get_sum<d, dims...>()> retval (0);
1159 int* dst = retval.begin();
1160 detail::IntVectCat_imp(dst, v);
1161 (detail::IntVectCat_imp(dst, vects), ...);
1162 return retval;
1163}
1164
1169template<int d, int...dims>
1172constexpr GpuTuple<IntVectND<d>, IntVectND<dims>...>
1173IntVectSplit (const IntVectND<detail::get_sum<d, dims...>()>& v) noexcept {
1175 return detail::IntVectSplit_imp(retval,
1176 std::make_index_sequence<1 + sizeof...(dims)>(),
1177 v.begin());
1178}
1179
1184template<int new_dim, int old_dim>
1187constexpr IntVectND<new_dim>
1188IntVectShrink (const IntVectND<old_dim>& iv) noexcept {
1189 return iv.template shrink<new_dim>();
1190}
1191
1196template<int new_dim, int old_dim>
1199constexpr IntVectND<new_dim>
1200IntVectExpand (const IntVectND<old_dim>& iv, int fill_extra=0) noexcept {
1201 return iv.template expand<new_dim>(fill_extra);
1202}
1203
1208template<int new_dim, int old_dim>
1211constexpr IntVectND<new_dim>
1212IntVectResize (const IntVectND<old_dim>& iv, int fill_extra=0) noexcept {
1213 return iv.template resize<new_dim>(fill_extra);
1214}
1215
1216} // namespace amrex
1217
1218// Spcialize std::tuple_size for IntVectND. Used by structured bindings.
1219template<int dim>
1220struct std::tuple_size<amrex::IntVectND<dim>> {
1221 static constexpr std::size_t value = dim;
1222};
1223
1224// Spcialize std::tuple_element for IntVectND. Used by structured bindings.
1225template<std::size_t s, int dim>
1226struct std::tuple_element<s, amrex::IntVectND<dim>> {
1227 using type = int;
1228};
1229
1230#endif /*AMREX_INTVECT_H*/
std::ostream & operator<<(std::ostream &os, const BLProfStats::TimeRange &tr)
Definition AMReX_BLProfStats.cpp:344
#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
Definition AMReX_Tuple.H:93
Definition AMReX_IntVect.H:48
IntVectND(const Array< int, dim > &a) noexcept
Construct an IntVectND from an Array<int,dim>.
Definition AMReX_IntVect.H:142
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr const int & get() const noexcept
Returns a reference to the i'th coordinate of the IntVectND. Used by structured bindings.
Definition AMReX_IntVect.H:252
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr const int * begin() const noexcept
Returns a pointer to the first element of the IntVectND.
Definition AMReX_IntVect.H:260
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr IntVectND< dim > TheMinVector() noexcept
Definition AMReX_IntVect.H:718
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & operator/=(int s) noexcept
Modifies IntVectND by division by a scalar to each component.
Definition AMReX_IntVect.H:511
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allGE(const IntVectND< dim > &rhs) const noexcept
Returns true if this is greater than or equal to argument for all components. NOTE: This is NOT a str...
Definition AMReX_IntVect.H:441
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator<(const IntVectND< dim > &rhs) const noexcept
Return true if this is lexicographically less than rhs.
Definition AMReX_IntVect.H:332
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allLE(const IntVectND< dim > &rhs) const noexcept
Returns true if this is less than or equal to argument for all components. NOTE: This is NOT a strict...
Definition AMReX_IntVect.H:391
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allLE(int rhs) const noexcept
Returns true if this is less than or equal to argument for all components.
Definition AMReX_IntVect.H:403
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allLT(int rhs) const noexcept
Returns true if this is less than argument for all components.
Definition AMReX_IntVect.H:378
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator/(const IntVectND< dim > &p) const noexcept
Returns component-wise division of IntVectND by argument.
Definition AMReX_IntVect.H:589
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & max(const IntVectND< dim > &p) noexcept
Modifies IntVectND by taking component-wise max with argument.
Definition AMReX_IntVect.H:612
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr IntVectND< dim > TheNodeVector() noexcept
This static member function returns a reference to a constant IntVectND object, all of whose dim argu...
Definition AMReX_IntVect.H:700
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr int isize() noexcept
Definition AMReX_IntVect.H:728
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr int * begin() noexcept
Returns a pointer to the first element of the IntVectND.
Definition AMReX_IntVect.H:256
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int sum() const noexcept
Definition AMReX_IntVect.H:201
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr int & get() noexcept
Returns a reference to the i'th coordinate of the IntVectND. Used by structured bindings.
Definition AMReX_IntVect.H:247
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & coarsen(int p) noexcept
Modify IntVectND<dim> by component-wise integer projection.
Definition AMReX_IntVect.H:814
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:842
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator-() const noexcept
Unary Minus – negates all components.
Definition AMReX_IntVect.H:466
int value_type
Definition AMReX_IntVect.H:732
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Array< T, dim > toArray() const noexcept
Definition AMReX_IntVect.H:188
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int maxDir(bool a_doAbsValue) const noexcept
Definition AMReX_IntVect.H:855
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & shift(const IntVectND< dim > &iv) noexcept
Equivalent to shift(0,iv[0]).shift(1,iv[1]) ...
Definition AMReX_IntVect.H:646
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allGT(const IntVectND< dim > &rhs) const noexcept
Returns true if this is greater than argument for all components. NOTE: This is NOT a strict weak ord...
Definition AMReX_IntVect.H:416
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & operator+=(int s) noexcept
Modifies IntVectND by addition of a scalar to each component.
Definition AMReX_IntVect.H:475
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator!=(int val) const noexcept
Returns true if any component is not equal to the argument val.
Definition AMReX_IntVect.H:301
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int * getVect() &noexcept
Definition AMReX_IntVect.H:284
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allGE(int rhs) const noexcept
Returns true if this is greater than or equal to argument for all components.
Definition AMReX_IntVect.H:453
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & min(const IntVectND< dim > &p) noexcept
Modifies IntVectND by taking component-wise min with argument.
Definition AMReX_IntVect.H:603
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator==(int val) const noexcept
Returns true if all components are equal to the argument val.
Definition AMReX_IntVect.H:290
IntVectND(const Vector< int > &a) noexcept
Construct an IntVectND from an Vector<int>. It is an error if the Vector<int> doesn't have the same d...
Definition AMReX_IntVect.H:132
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator*(const IntVectND< dim > &p) const noexcept
Returns component-wise product of IntVectND and argument.
Definition AMReX_IntVect.H:575
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr IntVectND< dim > TheUnitVector() noexcept
This static member function returns a reference to a constant IntVectND object, all of whose dim argu...
Definition AMReX_IntVect.H:680
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr int & operator[](int i) noexcept
Returns a reference to the i'th coordinate of the IntVectND.
Definition AMReX_IntVect.H:238
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & shift(int coord, int s) noexcept
Modify IntVectND by adding s to given coordinate.
Definition AMReX_IntVect.H:640
static const IntVectND< dim > Unit
Definition AMReX_IntVect.H:782
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & diagShift(int s) noexcept
Modify IntVectND by adding s to each coordinate.
Definition AMReX_IntVect.H:649
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allGT(int rhs) const noexcept
Returns true if this is greater than argument for all components.
Definition AMReX_IntVect.H:428
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr std::size_t size() noexcept
Definition AMReX_IntVect.H:723
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr IntVectND< dim > TheDimensionVector(int d) noexcept
This static member function returns a reference to a constant IntVectND object, all of whose dim argu...
Definition AMReX_IntVect.H:689
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator<=(const IntVectND< dim > &rhs) const noexcept
Return true if this is lexicographically less than or equal to rhs.
Definition AMReX_IntVect.H:345
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const int * getVect() const &noexcept
Returns a const pointer to an array of coordinates of the IntVectND. Useful for arguments to FORTRAN ...
Definition AMReX_IntVect.H:282
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< new_dim > resize(int fill_extra=0) const noexcept
Returns a new IntVectND of size new_dim by either shrinking or expanding this IntVectND.
Definition AMReX_IntVect.H:766
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int min() const noexcept
minimum (no absolute values) value
Definition AMReX_IntVect.H:223
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< new_dim > expand(int fill_extra=0) const noexcept
Returns a new IntVectND of size new_dim and assigns all values of this IntVectND to it and fill_extra...
Definition AMReX_IntVect.H:751
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr IntVectND< dim > TheZeroVector() noexcept
This static member function returns a reference to a constant IntVectND object, all of whose dim argu...
Definition AMReX_IntVect.H:670
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & scale(int s) noexcept
Modify IntVectND by multiplying each coordinate by s.
Definition AMReX_IntVect.H:621
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator>(const IntVectND< dim > &rhs) const noexcept
Return true if this is lexicographically greater than rhs.
Definition AMReX_IntVect.H:351
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int max() const noexcept
maximum (no absolute values) value
Definition AMReX_IntVect.H:212
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr const int * end() const noexcept
Returns a pointer to the (last+1) element of the IntVectND.
Definition AMReX_IntVect.H:268
AMREX_GPU_HOST_DEVICE IntVectND(const int *a) noexcept
Construct an IntVectND setting the coordinates to the corresponding values in the integer array a.
Definition AMReX_IntVect.H:121
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator+() const noexcept
Unary plus – for completeness.
Definition AMReX_IntVect.H:463
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:272
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< new_dim > shrink() const noexcept
Returns a new IntVectND of size new_dim and assigns the first new_dim values of this IntVectND to it.
Definition AMReX_IntVect.H:740
AMREX_GPU_HOST_DEVICE constexpr IntVectND(int i, int j, Args...ks) noexcept
Construct an IntVectND given the specific values for its coordinates. The inputs for this constructor...
Definition AMReX_IntVect.H:104
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & reflect(int ref_ix, int idir) noexcept
Modify IntVectND by reflecting it in the plane defined by the index ref_ix and with normal in the dir...
Definition AMReX_IntVect.H:632
static const IntVectND< dim > Zero
Definition AMReX_IntVect.H:777
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & operator*=(int s) noexcept
Modifies IntVectND by multiplication of a scalar to each component.
Definition AMReX_IntVect.H:493
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & operator-=(int s) noexcept
Modifies IntVectND by subtraction of a scalar to each component.
Definition AMReX_IntVect.H:529
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr IntVectND< dim > TheMaxVector() noexcept
Definition AMReX_IntVect.H:714
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr int * end() noexcept
Returns a pointer to the (last+1) element of the IntVectND.
Definition AMReX_IntVect.H:264
constexpr IntVectND() noexcept
Construct an IntVectND whose components are all zero.
Definition AMReX_IntVect.H:91
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator>=(const IntVectND< dim > &rhs) const noexcept
Return true if this is lexicographically greater than or equal to rhs.
Definition AMReX_IntVect.H:357
int vect[dim]
Definition AMReX_IntVect.H:786
AMREX_GPU_HOST_DEVICE constexpr IntVectND(int s) noexcept
Construct an IntVectND whose components are all the same.
Definition AMReX_IntVect.H:110
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allLT(const IntVectND< dim > &rhs) const noexcept
Returns true if this is less than argument for all components. NOTE: This is NOT a strict weak orderi...
Definition AMReX_IntVect.H:366
AMREX_GPU_HOST_DEVICE int * getVect() &&=delete
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr IntVectND< dim > TheCellVector() noexcept
This static member function returns a reference to a constant IntVectND object, all of whose dim argu...
Definition AMReX_IntVect.H:709
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 AMREX_FORCE_INLINE constexpr T IntVectSplit_imp(T &retval, std::index_sequence< Ns... >, const int *src) noexcept
Definition AMReX_IntVect.H:1123
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr int get_sum()
Definition AMReX_IntVect.H:1130
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr void IntVectCat_imp(int *&dst, const IntVectND< dim > &src) noexcept
Definition AMReX_IntVect.H:1105
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr void IntVectSplit_imp2(IntVectND< dim > &dst, const int *&src) noexcept
Definition AMReX_IntVect.H:1114
Definition AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > BASISV(int dir) noexcept
Returns a basis vector in the given coordinate direction; eg. IntVectND<3> BASISV<3>(1) == (0,...
Definition AMReX_IntVect.H:988
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > diagShift(const IntVectND< dim > &p, int s) noexcept
Returns IntVectND obtained by adding s to each of the components of this IntVectND.
Definition AMReX_IntVect.H:1031
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > reflect(const IntVectND< dim > &a, int ref_ix, int idir) noexcept
Returns an IntVectND that is the reflection of input in the plane which passes through ref_ix and nor...
Definition AMReX_IntVect.H:1018
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > operator+(const GpuComplex< T > &a_x)
Identity operation on a complex number.
Definition AMReX_GpuComplex.H:166
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr const T & min(const T &a, const T &b) noexcept
Definition AMReX_Algorithm.H:21
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr T elemwiseMin(T const &a, T const &b) noexcept
Definition AMReX_Algorithm.H:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > scale(const IntVectND< dim > &p, int s) noexcept
Returns a IntVectND obtained by multiplying each of the components of this IntVectND by s.
Definition AMReX_IntVect.H:1004
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr 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:1173
constexpr bool IsConvertible_v
Definition AMReX_TypeTraits.H:262
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr IntVectND< new_dim > IntVectResize(const IntVectND< old_dim > &iv, int fill_extra=0) noexcept
Returns a new IntVectND of size new_dim by either shrinking or expanding iv.
Definition AMReX_IntVect.H:1212
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > coarsen(const BoxND< dim > &b, int ref_ratio) noexcept
Coarsen BoxND by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo/rati...
Definition AMReX_Box.H:1304
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > operator*(const GpuComplex< T > &a_x, const GpuComplex< T > &a_y) noexcept
Multiply two complex numbers.
Definition AMReX_GpuComplex.H:252
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr IntVectND< new_dim > IntVectShrink(const IntVectND< old_dim > &iv) noexcept
Returns a new IntVectND of size new_dim and assigns the first new_dim values of iv to it.
Definition AMReX_IntVect.H:1188
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ignore_unused(const Ts &...)
This shuts up the compiler about unused variables.
Definition AMReX.H:127
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr IntVectND< new_dim > IntVectExpand(const IntVectND< old_dim > &iv, int fill_extra=0) noexcept
Returns a new IntVectND of size new_dim and assigns all values of iv to it and fill_extra to the rema...
Definition AMReX_IntVect.H:1200
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr const T & max(const T &a, const T &b) noexcept
Definition AMReX_Algorithm.H:35
const int[]
Definition AMReX_BLProfiler.cpp:1664
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > operator-(const GpuComplex< T > &a_x)
Negate a complex number.
Definition AMReX_GpuComplex.H:173
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr T elemwiseMax(T const &a, T const &b) noexcept
Definition AMReX_Algorithm.H:62
std::array< T, N > Array
Definition AMReX_Array.H:24
Definition AMReX_IntVect.H:52
std::size_t operator()(const IntVectND< dim > &vec) const noexcept
Definition AMReX_IntVect.H:53
int type
Definition AMReX_IntVect.H:1227