1 #ifndef AMREX_INTVECT_H_
2 #define AMREX_INTVECT_H_
3 #include <AMReX_Config.H>
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;
50 static_assert(dim >= 1,
"The number of dimensions of IntVectND must be positive");
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);
70 std::size_t seed = dim;
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;
78 seed ^=
x + 0x9e3779b9 + (seed << 6) + (seed >> 2);
98 template <
class...Args,
100 (
sizeof...(Args)+2 == dim) &&
104 constexpr
IntVectND (
int i,
int j, Args...ks) noexcept :
vect{i, j,
static_cast<int>(ks)...} {}
111 for (
int i=0; i<dim; ++i) {
122 for (
int i=0; i<dim; ++i) {
134 for (
int i=0; i<dim; ++i) {
143 for (
int i=0; i<dim; ++i) {
148 template <
int N=dim, std::enable_if_t<( 1<=N && N<=3 ),
int> = 0>
149 explicit constexpr IntVectND (Dim3 const& a) noexcept {
151 if constexpr (dim >= 2) {
154 if constexpr (dim == 3) {
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};
169 return Dim3{vect[0],vect[1],vect[2]};
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};
181 return Dim3{vect[0],vect[1],vect[2]};
185 #if __cplusplus >= 201402L
186 template<
typename T =
int >
189 toArray () const noexcept {
191 for (
int i=0; i<dim; ++i) {
205 int retval =
vect[0];
206 for (
int i=1; i<dim; ++i) {
216 int retval =
vect[0];
217 for (
int i=1; i<dim; ++i) {
218 retval = retval >
vect[i] ? retval :
vect[i];
227 int retval =
vect[0];
228 for (
int i=1; i<dim; ++i) {
229 retval = retval <
vect[i] ? retval :
vect[i];
236 int maxDir(
bool a_doAbsValue)
const noexcept;
247 template<std::
size_t i>
249 int&
get () noexcept {static_assert(0<=i && i<dim);
return vect[i];}
252 template<std::
size_t i>
254 const int&
get () const noexcept {static_assert(0<=i && i<dim);
return vect[i];}
270 const int*
end () const noexcept {
return &
vect[dim]; }
294 bool retval =
vect[0] == val;
295 for (
int i=1; i<dim; ++i) {
296 retval = retval &&
vect[i] == val;
305 bool retval =
vect[0] != val;
306 for (
int i=1; i<dim; ++i) {
307 retval = retval ||
vect[i] != val;
316 bool retval =
vect[0] == rhs[0];
317 for (
int i=1; i<dim; ++i) {
318 retval = retval &&
vect[i] == rhs[i];
326 bool retval =
vect[0] != rhs[0];
327 for (
int i=1; i<dim; ++i) {
328 retval = retval ||
vect[i] != rhs[i];
336 for (
int i=dim-1; i>=0; --i) {
337 if (
vect[i] < rhs[i]) {
339 }
else if (
vect[i] > rhs[i]) {
349 return !(rhs < *
this);
361 return !(*
this < rhs);
370 bool retval =
vect[0] < rhs[0];
371 for (
int i=1; i<dim; ++i) {
372 retval = retval &&
vect[i] < rhs[i];
382 bool retval =
vect[0] < rhs;
383 for (
int i=1; i<dim; ++i) {
384 retval = retval &&
vect[i] < rhs;
395 bool retval =
vect[0] <= rhs[0];
396 for (
int i=1; i<dim; ++i) {
397 retval = retval &&
vect[i] <= rhs[i];
407 bool retval =
vect[0] <= rhs;
408 for (
int i=1; i<dim; ++i) {
409 retval = retval &&
vect[i] <= rhs;
420 bool retval =
vect[0] > rhs[0];
421 for (
int i=1; i<dim; ++i) {
422 retval = retval &&
vect[i] > rhs[i];
432 bool retval =
vect[0] > rhs;
433 for (
int i=1; i<dim; ++i) {
434 retval = retval &&
vect[i] > rhs;
445 bool retval =
vect[0] >= rhs[0];
446 for (
int i=1; i<dim; ++i) {
447 retval = retval &&
vect[i] >= rhs[i];
457 bool retval =
vect[0] >= rhs;
458 for (
int i=1; i<dim; ++i) {
459 retval = retval &&
vect[i] >= rhs;
470 for (
int i=0; i<dim; ++i) {
471 retval[i] = -
vect[i];
479 for (
int i=0; i<dim; ++i) {
488 for (
int i=0; i<dim; ++i) {
497 for (
int i=0; i<dim; ++i) {
506 for (
int i=0; i<dim; ++i) {
515 for (
int i=0; i<dim; ++i) {
524 for (
int i=0; i<dim; ++i) {
533 for (
int i=0; i<dim; ++i) {
542 for (
int i=0; i<dim; ++i) {
607 for (
int i=0; i<dim; ++i) {
616 for (
int i=0; i<dim; ++i) {
624 for (
int i=0; i<dim; ++i) {
644 BL_ASSERT(coord >= 0 && coord < dim);
vect[coord] += s;
return *
this;
653 for (
int i=0; i<dim; ++i) {
725 static constexpr std::size_t
size () noexcept {
726 return static_cast<std::size_t
>(dim);
730 static constexpr
int isize () noexcept {
740 template<
int new_dim>
743 static_assert(new_dim <= dim);
751 template<
int new_dim>
754 static_assert(new_dim >= dim);
756 for (
int i=0; i<dim; ++i) {
766 template<
int new_dim>
769 if constexpr (new_dim > dim) {
770 return expand<new_dim>(fill_extra);
772 return shrink<new_dim>();
798 template<std::
size_t dim>
803 template <
class...Args,
823 for (
int i=0; i<dim; ++i) {
824 vect[i] = (vect[i]<0) ? -
std::abs(vect[i]+1)/2-1 : vect[i]/2;
828 for (
int i=0; i<dim; ++i) {
829 vect[i] = (vect[i]<0) ? -
std::abs(vect[i]+1)/4-1 : vect[i]/4;
833 for (
int i=0; i<dim; ++i) {
834 vect[i] = (vect[i]<0) ? -
std::abs(vect[i]+1)/s-1 : vect[i]/s;
847 for (
int i=0; i<dim; ++i) {
875 int maxval = (*this)[0];
878 int curval = (*this)[
idir];
896 for (
int i=0; i<dim; ++i) {
897 retval[i] = s + retval[i];
910 for (
int i=0; i<dim; ++i) {
911 retval[i] = s - retval[i];
923 for (
int i=0; i<dim; ++i) {
924 retval[i] = s * retval[i];
986 template<
int dim = AMREX_SPACEDIM>
1069 template<
int dim, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
1070 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
1071 Dim3 refine (Dim3 const& coarse, IntVectND<dim> const& ratio) noexcept
1073 if constexpr (dim == 1) {
1074 return Dim3{coarse.x*ratio[0], coarse.y, coarse.z};
1075 } else if constexpr (dim == 2) {
1076 return Dim3{coarse.x*ratio[0], coarse.y*ratio[1], coarse.z};
1078 return Dim3{coarse.x*ratio[0], coarse.y*ratio[1], coarse.z*ratio[2]};
1082 template<
int dim, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
1083 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
1084 Dim3 coarsen (Dim3 const& fine, IntVectND<dim> const& ratio) noexcept
1086 if constexpr (dim == 1) {
1087 return Dim3{amrex::coarsen(fine.x, ratio[0]),
1090 } else if constexpr (dim == 2) {
1091 return Dim3{amrex::coarsen(fine.x, ratio[0]),
1092 amrex::coarsen(fine.y, ratio[1]),
1095 return Dim3{amrex::coarsen(fine.x, ratio[0]),
1096 amrex::coarsen(fine.y, ratio[1]),
1097 amrex::coarsen(fine.z, ratio[2])};
1102 std::ostream&
int_vector_write (std::ostream& os, const
int* iv,
int dim);
1103 std::istream&
int_vector_read (std::istream& is,
int* iv,
int dim);
1108 for (
int i=0; i<dim; ++i) {
1117 for (
int i=0; i<dim; ++i) {
1123 template<
class T, std::size_t...Ns>
1130 template<
int...dims>
1133 return (0 + ... + dims);
1155 template<
int d,
int...dims>
1161 int* dst = retval.begin();
1171 template<
int d,
int...dims>
1174 constexpr GpuTuple<IntVectND<d>, IntVectND<dims>...>
1178 std::make_index_sequence<1 +
sizeof...(dims)>(),
1186 template<
int new_dim,
int old_dim>
1189 constexpr IntVectND<new_dim>
1191 return iv.template shrink<new_dim>();
1198 template<
int new_dim,
int old_dim>
1201 constexpr IntVectND<new_dim>
1203 return iv.template expand<new_dim>(fill_extra);
1210 template<
int new_dim,
int old_dim>
1213 constexpr IntVectND<new_dim>
1215 return iv.template resize<new_dim>(fill_extra);
1223 static constexpr std::size_t value = dim;
1227 template<std::
size_t s,
int dim>
#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 static constexpr AMREX_FORCE_INLINE std::size_t size() noexcept
Definition: AMReX_IntVect.H:725
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const int * begin() const noexcept
Returns a pointer to the first element of the IntVectND.
Definition: AMReX_IntVect.H:262
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE int * end() noexcept
Returns a pointer to the (last+1) element of the IntVectND.
Definition: AMReX_IntVect.H:266
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:742
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:443
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:334
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:393
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:405
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:380
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE int & get() noexcept
Returns a reference to the i'th coordinate of the IntVectND. Used by structured bindings.
Definition: AMReX_IntVect.H:249
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND< dim > TheMaxVector() noexcept
Definition: AMReX_IntVect.H:716
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int sum() const noexcept
Definition: AMReX_IntVect.H:203
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:816
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 constexpr AMREX_FORCE_INLINE int & operator[](int i) noexcept
Returns a reference to the i'th coordinate of the IntVectND.
Definition: AMReX_IntVect.H:240
int value_type
Definition: AMReX_IntVect.H:734
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:768
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int maxDir(bool a_doAbsValue) const noexcept
Definition: AMReX_IntVect.H:857
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:418
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:303
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator-() const noexcept
Unary Minus – negates all components.
Definition: AMReX_IntVect.H:468
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:455
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE 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:682
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:577
constexpr AMREX_GPU_HOST_DEVICE 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 IntVectND< dim > & shift(int coord, int s) noexcept
Modify IntVectND by adding s to given coordinate.
Definition: AMReX_IntVect.H:642
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:292
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 > & 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:634
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:284
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:651
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE 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:702
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:531
static const IntVectND< dim > Unit
Definition: AMReX_IntVect.H:784
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:430
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const int * end() const noexcept
Returns a pointer to the (last+1) element of the IntVectND.
Definition: AMReX_IntVect.H:270
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:495
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:648
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 const int & get() const noexcept
Returns a reference to the i'th coordinate of the IntVectND. Used by structured bindings.
Definition: AMReX_IntVect.H:254
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:347
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:513
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int min() const noexcept
minimum (no absolute values) value
Definition: AMReX_IntVect.H:225
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:353
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
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator+() const noexcept
Unary plus – for completeness.
Definition: AMReX_IntVect.H:465
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int max() const noexcept
maximum (no absolute values) value
Definition: AMReX_IntVect.H:214
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 > & min(const IntVectND< dim > &p) noexcept
Modifies IntVectND by taking component-wise min with argument.
Definition: AMReX_IntVect.H:605
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:614
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:477
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND< dim > TheMinVector() noexcept
Definition: AMReX_IntVect.H:720
static const IntVectND< dim > Zero
Definition: AMReX_IntVect.H:779
constexpr AMREX_GPU_HOST_DEVICE 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 static constexpr AMREX_FORCE_INLINE 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:672
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:753
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int isize() noexcept
Definition: AMReX_IntVect.H:730
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:623
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:359
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE 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:711
AMREX_GPU_HOST_DEVICE int * getVect() &&=delete
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:591
int vect[dim]
Definition: AMReX_IntVect.H:788
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:368
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE 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:691
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int * getVect() &noexcept
Definition: AMReX_IntVect.H:286
std::istream & int_vector_read(std::istream &is, int *iv, int dim)
Definition: AMReX_IntVect.cpp:29
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE void IntVectSplit_imp2(IntVectND< dim > &dst, const int *&src) noexcept
Definition: AMReX_IntVect.H:1116
std::ostream & int_vector_write(std::ostream &os, const int *iv, int dim)
Definition: AMReX_IntVect.cpp:13
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE int get_sum()
Definition: AMReX_IntVect.H:1132
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T IntVectSplit_imp(T &retval, std::index_sequence< Ns... >, const int *src) noexcept
Definition: AMReX_IntVect.H:1125
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE void IntVectCat_imp(int *&dst, const IntVectND< dim > &src) noexcept
Definition: AMReX_IntVect.H:1107
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:990
AMREX_GPU_HOST_DEVICE IntVectND(int, int, Args...) -> IntVectND< sizeof...(Args)+2 >
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & max(const T &a, const T &b) noexcept
Definition: AMReX_Algorithm.H:35
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & min(const T &a, const T &b) noexcept
Definition: AMReX_Algorithm.H:21
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T abs(const GpuComplex< T > &a_z) noexcept
Return the absolute value of a complex number.
Definition: AMReX_GpuComplex.H:356
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > max(const IntVectND< dim > &p1, const IntVectND< dim > &p2) noexcept
Returns the IntVectND that is the component-wise maximum of two argument IntVectNDs.
Definition: AMReX_IntVect.H:963
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 bool IsConvertible_v
Definition: AMReX_TypeTraits.H:262
std::ostream & operator<<(std::ostream &os, const IntVectND< dim > &iv)
Definition: AMReX_IntVect.H:1139
std::istream & operator>>(std::istream &is, IntVectND< dim > &iv)
Definition: AMReX_IntVect.H:1146
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T elemwiseMax(T const &a, T const &b) noexcept
Definition: AMReX_Algorithm.H:62
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:1033
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ignore_unused(const Ts &...)
This shuts up the compiler about unused variables.
Definition: AMReX.H:111
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:1020
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE 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:1190
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:1006
AMREX_GPU_HOST_DEVICE IntVectND(const Array< int, dim > &) -> IntVectND< dim >
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 constexpr AMREX_FORCE_INLINE 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:1202
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
const int[]
Definition: AMReX_BLProfiler.cpp:1664
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 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
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE 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:1214
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T elemwiseMin(T const &a, T const &b) noexcept
Definition: AMReX_Algorithm.H:49
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
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:1229