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;
41 return (i<0) ? -std::abs(i+1)/ratio-1 : i/ratio;
59 static_assert(dim >= 1,
"The number of dimensions of IntVectND must be positive");
65 static constexpr unsigned shift1 =
sizeof(size_t)>=8 ? 20 : 10;
66 static constexpr unsigned shift2 =
sizeof(size_t)>=8 ? 40 : 20;
67 if constexpr (dim == 1) {
70 return static_cast<std::size_t
>(vec[0]);
71 }
else if constexpr (dim == 2) {
73 return static_cast<std::size_t
>(vec[0]) ^
74 (
static_cast<std::size_t
>(vec[1]) << shift1);
75 }
else if constexpr (dim == 3) {
76 return static_cast<std::size_t
>(vec[0]) ^
77 (
static_cast<std::size_t
>(vec[1]) << shift1) ^
78 (
static_cast<std::size_t
>(vec[2]) << shift2);
80 std::size_t seed = dim;
83 for (
int i=0; i<dim; ++i) {
84 auto x =
static_cast<unsigned int>(vec[i]);
85 x = ((
x >> 16) ^
x) * 0x45d9f3b;
86 x = ((
x >> 16) ^
x) * 0x45d9f3b;
88 seed ^=
x + 0x9e3779b9 + (seed << 6) + (seed >> 2);
108 template <
class...Args,
110 (
sizeof...(Args)+2 == dim) &&
114 constexpr IntVectND (
int i,
int j, Args...ks) noexcept :
vect{i, j,
static_cast<int>(ks)...} {}
121 for (
int i=0; i<dim; ++i) {
132 for (
int i=0; i<dim; ++i) {
144 for (
int i=0; i<dim; ++i) {
153 for (
int i=0; i<dim; ++i) {
158 template <
int N=dim, std::enable_if_t<( 1<=N && N<=3 ),
int> = 0>
159 explicit constexpr IntVectND (Dim3 const& a) noexcept {
161 if constexpr (dim >= 2) {
164 if constexpr (dim == 3) {
171 template <
int N=dim, std::enable_if_t<( 1<=N && N<=3 ),
int> = 0>
172 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
173 Dim3 dim3 () const noexcept {
174 if constexpr (dim == 1) {
175 return Dim3{vect[0],0,0};
176 } else if constexpr (dim == 2) {
177 return Dim3{vect[0],vect[1],0};
179 return Dim3{vect[0],vect[1],vect[2]};
183 template <
int N=dim, std::enable_if_t<( 1<=N && N<=3 ),
int> = 0>
184 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
185 Dim3 dim3 ([[maybe_unused]]
int fill_extra) const noexcept {
186 if constexpr (dim == 1) {
187 return Dim3{vect[0],fill_extra,fill_extra};
188 } else if constexpr (dim == 2) {
189 return Dim3{vect[0],vect[1],fill_extra};
191 return Dim3{vect[0],vect[1],vect[2]};
195 template<
typename T =
int >
200 for (
int i=0; i<dim; ++i) {
213 int retval =
vect[0];
214 for (
int i=1; i<dim; ++i) {
224 int retval =
vect[0];
225 for (
int i=1; i<dim; ++i) {
226 retval = retval >
vect[i] ? retval :
vect[i];
235 int retval =
vect[0];
236 for (
int i=1; i<dim; ++i) {
237 retval = retval <
vect[i] ? retval :
vect[i];
244 int maxDir(
bool a_doAbsValue)
const noexcept;
255 template<std::
size_t i>
257 int&
get () noexcept {
static_assert(0<=i && i<dim);
return vect[i];}
260 template<std::
size_t i>
262 const int&
get () const noexcept {
static_assert(0<=i && i<dim);
return vect[i];}
278 const int*
end () const noexcept {
return &
vect[dim]; }
302 bool retval =
vect[0] == val;
303 for (
int i=1; i<dim; ++i) {
304 retval = retval &&
vect[i] == val;
313 bool retval =
vect[0] != val;
314 for (
int i=1; i<dim; ++i) {
315 retval = retval ||
vect[i] != val;
324 bool retval =
vect[0] == rhs[0];
325 for (
int i=1; i<dim; ++i) {
326 retval = retval &&
vect[i] == rhs[i];
334 bool retval =
vect[0] != rhs[0];
335 for (
int i=1; i<dim; ++i) {
336 retval = retval ||
vect[i] != rhs[i];
344 for (
int i=dim-1; i>=0; --i) {
345 if (
vect[i] < rhs[i]) {
347 }
else if (
vect[i] > rhs[i]) {
357 return !(rhs < *
this);
369 return !(*
this < rhs);
378 bool retval =
vect[0] < rhs[0];
379 for (
int i=1; i<dim; ++i) {
380 retval = retval &&
vect[i] < rhs[i];
390 bool retval =
vect[0] < rhs;
391 for (
int i=1; i<dim; ++i) {
392 retval = retval &&
vect[i] < rhs;
403 bool retval =
vect[0] <= rhs[0];
404 for (
int i=1; i<dim; ++i) {
405 retval = retval &&
vect[i] <= rhs[i];
415 bool retval =
vect[0] <= rhs;
416 for (
int i=1; i<dim; ++i) {
417 retval = retval &&
vect[i] <= rhs;
428 bool retval =
vect[0] > rhs[0];
429 for (
int i=1; i<dim; ++i) {
430 retval = retval &&
vect[i] > rhs[i];
440 bool retval =
vect[0] > rhs;
441 for (
int i=1; i<dim; ++i) {
442 retval = retval &&
vect[i] > rhs;
453 bool retval =
vect[0] >= rhs[0];
454 for (
int i=1; i<dim; ++i) {
455 retval = retval &&
vect[i] >= rhs[i];
465 bool retval =
vect[0] >= rhs;
466 for (
int i=1; i<dim; ++i) {
467 retval = retval &&
vect[i] >= rhs;
478 for (
int i=0; i<dim; ++i) {
479 retval[i] = -
vect[i];
487 for (
int i=0; i<dim; ++i) {
496 for (
int i=0; i<dim; ++i) {
505 for (
int i=0; i<dim; ++i) {
514 for (
int i=0; i<dim; ++i) {
523 for (
int i=0; i<dim; ++i) {
532 for (
int i=0; i<dim; ++i) {
541 for (
int i=0; i<dim; ++i) {
550 for (
int i=0; i<dim; ++i) {
615 for (
int i=0; i<dim; ++i) {
624 for (
int i=0; i<dim; ++i) {
632 for (
int i=0; i<dim; ++i) {
652 BL_ASSERT(coord >= 0 && coord < dim);
vect[coord] += s;
return *
this;
661 for (
int i=0; i<dim; ++i) {
733 static constexpr std::size_t
size () noexcept {
734 return static_cast<std::size_t
>(dim);
738 static constexpr int isize () noexcept {
748 template<
int new_dim>
751 static_assert(new_dim <= dim);
759 template<
int new_dim>
762 static_assert(new_dim >= dim);
764 for (
int i=0; i<dim; ++i) {
774 template<
int new_dim>
777 if constexpr (new_dim > dim) {
778 return expand<new_dim>(fill_extra);
780 return shrink<new_dim>();
806template<std::
size_t dim>
811template <
class...Args,
833 for (
int i=0; i<dim; ++i) {
834 vect[i] = (vect[i]<0) ? -std::abs(vect[i]+1)/2-1 : vect[i]/2;
838 for (
int i=0; i<dim; ++i) {
839 vect[i] = (vect[i]<0) ? -std::abs(vect[i]+1)/4-1 : vect[i]/4;
843 for (
int i=0; i<dim; ++i) {
844 vect[i] = (vect[i]<0) ? -std::abs(vect[i]+1)/s-1 : vect[i]/s;
857 for (
int i=0; i<dim; ++i) {
872 int maxval = std::abs((*
this)[0]);
875 int curval = std::abs((*
this)[
idir]);
885 int maxval = (*this)[0];
888 int curval = (*this)[
idir];
906 for (
int i=0; i<dim; ++i) {
907 retval[i] = s + retval[i];
920 for (
int i=0; i<dim; ++i) {
921 retval[i] = s - retval[i];
933 for (
int i=0; i<dim; ++i) {
934 retval[i] = s * retval[i];
996template<
int dim = AMREX_SPACEDIM>
1079template<
int dim, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
1080AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
1081Dim3 refine (Dim3 const& coarse, IntVectND<dim> const& ratio) noexcept
1083 if constexpr (dim == 1) {
1084 return Dim3{coarse.x*ratio[0], coarse.y, coarse.z};
1085 } else if constexpr (dim == 2) {
1086 return Dim3{coarse.x*ratio[0], coarse.y*ratio[1], coarse.z};
1088 return Dim3{coarse.x*ratio[0], coarse.y*ratio[1], coarse.z*ratio[2]};
1092template<
int dim, std::enable_if_t<( 1<=dim && dim<=3 ),
int> = 0>
1093AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
1094Dim3 coarsen (Dim3 const& fine, IntVectND<dim> const& ratio) noexcept
1096 if constexpr (dim == 1) {
1097 return Dim3{amrex::coarsen(fine.x, ratio[0]),
1100 } else if constexpr (dim == 2) {
1101 return Dim3{amrex::coarsen(fine.x, ratio[0]),
1102 amrex::coarsen(fine.y, ratio[1]),
1105 return Dim3{amrex::coarsen(fine.x, ratio[0]),
1106 amrex::coarsen(fine.y, ratio[1]),
1107 amrex::coarsen(fine.z, ratio[2])};
1113 std::ostream&
int_vector_write (std::ostream& os, const
int* iv,
int dim);
1114 std::istream&
int_vector_read (std::istream& is,
int* iv,
int dim);
1118 void IntVectCat_imp (
int*& dst,
const IntVectND<dim>& src)
noexcept {
1119 for (
int i=0; i<dim; ++i) {
1127 void IntVectSplit_imp2 (IntVectND<dim>& dst,
const int*& src)
noexcept {
1128 for (
int i=0; i<dim; ++i) {
1134 template<
class T, std::size_t...Ns>
1136 T IntVectSplit_imp (T& retval, std::index_sequence<Ns...>,
const int * src)
noexcept {
1137 (IntVectSplit_imp2(amrex::get<Ns>(retval), src), ...);
1141 template<
int...dims>
1144 return (0 + ... + dims);
1153 return detail::int_vector_write(os, iv.
begin(), dim);
1160 return detail::int_vector_read(is, iv.
begin(), dim);
1167template<
int d,
int...dims>
1170constexpr IntVectND<detail::get_sum<d, dims...>()>
1172 IntVectND<detail::get_sum<d, dims...>()> retval (0);
1173 int* dst = retval.
begin();
1174 detail::IntVectCat_imp(dst, v);
1175 (detail::IntVectCat_imp(dst, vects), ...);
1183template<
int d,
int...dims>
1186constexpr GpuTuple<IntVectND<d>, IntVectND<dims>...>
1189 return detail::IntVectSplit_imp(retval,
1190 std::make_index_sequence<1 +
sizeof...(dims)>(),
1198template<
int new_dim,
int old_dim>
1201constexpr IntVectND<new_dim>
1203 return iv.template shrink<new_dim>();
1210template<
int new_dim,
int old_dim>
1213constexpr IntVectND<new_dim>
1215 return iv.template expand<new_dim>(fill_extra);
1222template<
int new_dim,
int old_dim>
1225constexpr IntVectND<new_dim>
1227 return iv.template resize<new_dim>(fill_extra);
1234struct std::tuple_size<
amrex::IntVectND<dim>> {
1235 static constexpr std::size_t value = dim;
1239template<std::
size_t s,
int dim>
1240struct std::tuple_element<s,
amrex::IntVectND<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
GPU-compatible tuple.
Definition AMReX_Tuple.H:98
An Integer Vector in dim-Dimensional Space.
Definition AMReX_IntVect.H:57
__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:131
__host__ __device__ bool operator<=(const IntVectND< dim > &rhs) const noexcept
Return true if this is lexicographically less than or equal to rhs.
Definition AMReX_IntVect.H:355
IntVectND(const Array< int, dim > &a) noexcept
Construct an IntVectND from an Array<int,dim>.
Definition AMReX_IntVect.H:152
__host__ __device__ 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:642
__host__ __device__ int * getVect() &noexcept
Definition AMReX_IntVect.H:294
__host__ __device__ bool allLT(int rhs) const noexcept
Returns true if this is less than argument for all components.
Definition AMReX_IntVect.H:388
__host__ __device__ constexpr int & operator[](int i) noexcept
Returns a reference to the i'th coordinate of the IntVectND.
Definition AMReX_IntVect.H:248
__host__ __device__ int sum() const noexcept
Definition AMReX_IntVect.H:211
__host__ __device__ IntVectND< dim > & shift(const IntVectND< dim > &iv) noexcept
Equivalent to shift(0,iv[0]).shift(1,iv[1]) ...
Definition AMReX_IntVect.H:656
__host__ __device__ IntVectND< dim > & min(const IntVectND< dim > &p) noexcept
Modifies IntVectND by taking component-wise min with argument.
Definition AMReX_IntVect.H:613
__host__ __device__ bool operator!=(int val) const noexcept
Returns true if any component is not equal to the argument val.
Definition AMReX_IntVect.H:311
__host__ __device__ bool operator>=(const IntVectND< dim > &rhs) const noexcept
Return true if this is lexicographically greater than or equal to rhs.
Definition AMReX_IntVect.H:367
__host__ __device__ bool allGT(int rhs) const noexcept
Returns true if this is greater than argument for all components.
Definition AMReX_IntVect.H:438
int value_type
Definition AMReX_IntVect.H:742
__host__ __device__ IntVectND< dim > & operator-=(int s) noexcept
Modifies IntVectND by subtraction of a scalar to each component.
Definition AMReX_IntVect.H:539
__host__ __device__ constexpr int & get() noexcept
Returns a reference to the i'th coordinate of the IntVectND. Used by structured bindings.
Definition AMReX_IntVect.H:257
__host__ __device__ IntVectND< dim > & operator/=(int s) noexcept
Modifies IntVectND by division by a scalar to each component.
Definition AMReX_IntVect.H:521
__host__ __device__ IntVectND< dim > operator+() const noexcept
Unary plus – for completeness.
Definition AMReX_IntVect.H:473
__host__ __device__ IntVectND< dim > & diagShift(int s) noexcept
Modify IntVectND by adding s to each coordinate.
Definition AMReX_IntVect.H:659
__host__ __device__ 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:451
__host__ __device__ int * getVect() &&=delete
__host__ static __device__ constexpr IntVectND< dim > TheMaxVector() noexcept
Definition AMReX_IntVect.H:724
__host__ static __device__ constexpr std::size_t size() noexcept
Definition AMReX_IntVect.H:733
__host__ __device__ IntVectND & setVal(int i, int val) noexcept
Set i'th coordinate of IntVectND to val.
Definition AMReX_IntVect.H:282
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:142
__host__ __device__ IntVectND< dim > & operator+=(int s) noexcept
Modifies IntVectND by addition of a scalar to each component.
Definition AMReX_IntVect.H:485
__host__ __device__ bool operator==(int val) const noexcept
Returns true if all components are equal to the argument val.
Definition AMReX_IntVect.H:300
__host__ __device__ constexpr int * begin() noexcept
Returns a pointer to the first element of the IntVectND.
Definition AMReX_IntVect.H:266
__host__ __device__ IntVectND< dim > & coarsen(const IntVectND< dim > &p) noexcept
Modify IntVectND<dim> by component-wise integer projection.
Definition AMReX_IntVect.H:854
__host__ static __device__ 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:690
__host__ __device__ 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:761
__host__ __device__ 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:426
__host__ __device__ 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:376
__host__ __device__ IntVectND< dim > & shift(int coord, int s) noexcept
Modify IntVectND by adding s to given coordinate.
Definition AMReX_IntVect.H:650
__host__ __device__ int maxDir(bool a_doAbsValue) const noexcept
Definition AMReX_IntVect.H:867
__host__ __device__ 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:292
__host__ __device__ int min() const noexcept
minimum (no absolute values) value
Definition AMReX_IntVect.H:233
static const IntVectND< dim > Unit
Definition AMReX_IntVect.H:792
__host__ __device__ int max() const noexcept
maximum (no absolute values) value
Definition AMReX_IntVect.H:222
__host__ __device__ constexpr const int * begin() const noexcept
Returns a pointer to the first element of the IntVectND.
Definition AMReX_IntVect.H:270
__host__ __device__ bool allLE(int rhs) const noexcept
Returns true if this is less than or equal to argument for all components.
Definition AMReX_IntVect.H:413
__host__ __device__ IntVectND< dim > operator*(const IntVectND< dim > &p) const noexcept
Returns component-wise product of IntVectND and argument.
Definition AMReX_IntVect.H:585
__host__ static __device__ 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:719
__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:114
__host__ __device__ bool operator<(const IntVectND< dim > &rhs) const noexcept
Return true if this is lexicographically less than rhs.
Definition AMReX_IntVect.H:342
__host__ __device__ bool allGE(int rhs) const noexcept
Returns true if this is greater than or equal to argument for all components.
Definition AMReX_IntVect.H:463
__host__ __device__ IntVectND< dim > & operator*=(int s) noexcept
Modifies IntVectND by multiplication of a scalar to each component.
Definition AMReX_IntVect.H:503
__host__ __device__ IntVectND< dim > operator/(const IntVectND< dim > &p) const noexcept
Returns component-wise division of IntVectND by argument.
Definition AMReX_IntVect.H:599
__host__ static __device__ 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:680
__host__ __device__ IntVectND< dim > & scale(int s) noexcept
Modify IntVectND by multiplying each coordinate by s.
Definition AMReX_IntVect.H:631
__host__ __device__ IntVectND< dim > & coarsen(int p) noexcept
Modify IntVectND<dim> by component-wise integer projection.
Definition AMReX_IntVect.H:826
__host__ static __device__ 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:710
static const IntVectND< dim > Zero
Definition AMReX_IntVect.H:787
__host__ __device__ Array< T, dim > toArray() const noexcept
Definition AMReX_IntVect.H:198
__host__ __device__ 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:750
__host__ __device__ constexpr int * end() noexcept
Returns a pointer to the (last+1) element of the IntVectND.
Definition AMReX_IntVect.H:274
__host__ static __device__ constexpr int isize() noexcept
Definition AMReX_IntVect.H:738
__host__ __device__ IntVectND< dim > & max(const IntVectND< dim > &p) noexcept
Modifies IntVectND by taking component-wise max with argument.
Definition AMReX_IntVect.H:622
__host__ __device__ constexpr IntVectND(int s) noexcept
Construct an IntVectND whose components are all the same.
Definition AMReX_IntVect.H:120
__host__ __device__ constexpr const int * end() const noexcept
Returns a pointer to the (last+1) element of the IntVectND.
Definition AMReX_IntVect.H:278
__host__ __device__ bool operator>(const IntVectND< dim > &rhs) const noexcept
Return true if this is lexicographically greater than rhs.
Definition AMReX_IntVect.H:361
__host__ __device__ 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:776
__host__ __device__ 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:262
constexpr IntVectND() noexcept
Construct an IntVectND whose components are all zero.
Definition AMReX_IntVect.H:101
__host__ __device__ 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:401
int vect[dim]
Definition AMReX_IntVect.H:796
__host__ static __device__ constexpr IntVectND< dim > TheMinVector() noexcept
Definition AMReX_IntVect.H:728
__host__ __device__ IntVectND< dim > operator-() const noexcept
Unary Minus – negates all components.
Definition AMReX_IntVect.H:476
__host__ static __device__ 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:699
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition AMReX_Vector.H:28
__host__ __device__ BoxND< dim > coarsen(const BoxND< dim > &b, int ref_ratio) noexcept
Coarsen BoxND by given (positive) coarsening ratio.
Definition AMReX_Box.H:1409
std::array< T, N > Array
Definition AMReX_Array.H:25
Definition AMReX_Amr.cpp:49
__host__ __device__ void ignore_unused(const Ts &...)
This shuts up the compiler about unused variables.
Definition AMReX.H:138
__host__ __device__ 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:1226
__host__ __device__ 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:1187
__host__ __device__ 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:1000
__host__ __device__ constexpr T elemwiseMax(T const &a, T const &b) noexcept
Definition AMReX_Algorithm.H:62
__host__ __device__ GpuComplex< T > operator*(const GpuComplex< T > &a_x, const GpuComplex< U > &a_y) noexcept
Multiply two complex numbers.
Definition AMReX_GpuComplex.H:257
__host__ __device__ 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:1030
__host__ __device__ constexpr const T & min(const T &a, const T &b) noexcept
Definition AMReX_Algorithm.H:21
constexpr bool IsConvertible_v
Definition AMReX_TypeTraits.H:276
__host__ __device__ 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:1202
__host__ __device__ constexpr const T & max(const T &a, const T &b) noexcept
Definition AMReX_Algorithm.H:35
__host__ __device__ 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:1043
__host__ __device__ 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:1214
__host__ __device__ XDim3 operator-(XDim3 const &a, XDim3 const &b)
Definition AMReX_Dim3.H:34
__host__ __device__ XDim3 operator+(XDim3 const &a, XDim3 const &b)
Definition AMReX_Dim3.H:28
__host__ __device__ constexpr T elemwiseMin(T const &a, T const &b) noexcept
Definition AMReX_Algorithm.H:49
__host__ __device__ 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:1016
Hash function for IntVectND.
Definition AMReX_IntVect.H:62
std::size_t operator()(const IntVectND< dim > &vec) const noexcept
Definition AMReX_IntVect.H:63
int type
Definition AMReX_IntVect.H:1241