4#include <AMReX_Config.H>
15#define AMREX_ARRAY4_INDEX_ASSERT(i,j,k,n) \
16 if ((i)<begin.vect[0] || (i)>=end.vect[0] || \
17 (j)<begin.vect[1] || (j)>=end.vect[1] || \
18 (k)<begin.vect[2] || (k)>=end.vect[2] || \
19 (n)<0 || (n)>=end.vect[3]) \
21 index_assert_print_error_message(i,j,k,n); \
60 : p(a_p), stride(a_stride), ncomp(a_ncomp)
72 requires (std::is_const_v<U>)
75 : p(rhs.p), stride(rhs.stride), ncomp(rhs.ncomp)
84 explicit operator bool() const noexcept {
return p !=
nullptr; }
90 int nComp() const noexcept {
return ncomp; }
104 requires (!std::is_void_v<T>)
107#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
108 if (n < 0 || n >= ncomp) {
113 std::stringstream ss;
114 ss <<
" " << n <<
" is out of bound: (0:" << ncomp-1 <<
")";
126 template <
int N>
struct Stride { Long a[N] = {}; };
127 template <>
struct Stride<0> {};
134 template <
typename T>
135 struct IsValidIndexType {
136 static constexpr bool value = std::is_integral_v<T> && IsNonNarrowingConversion_v<T, int>;
145 template <
int N,
bool last_dim_component,
typename... idx>
146 struct ArrayNDIndexCheck_impl {
148 static constexpr int num_indices =
sizeof...(idx);
150 template <
typename... Ts>
151 struct AllExceptLastEnum;
153 template <
typename first,
typename... Ts>
154 struct AllExceptLastEnum<first, Ts...> {
155 static constexpr bool value =
156 IsValidIndexType<std::decay_t<first>>::value
157 && AllExceptLastEnum<Ts...>::value;
162 template <
typename last>
163 struct AllExceptLastEnum<last> {
164 static constexpr bool value = IsValidIndexType<std::decay_t<last>>::value
165 || (std::is_enum_v<std::decay_t<last>>);
168 static constexpr bool index_with_maybe_enum = AllExceptLastEnum<idx...>::value;
170 static constexpr bool index_all_values = Conjunction<
171 IsValidIndexType<std::decay_t<idx>>...>::value;
174 static constexpr bool value = ((num_indices == N) && index_all_values)
175 || ((num_indices == N - 1) && index_all_values && last_dim_component)
176 || ((num_indices == N) && index_with_maybe_enum && last_dim_component);
179 template <
int N,
bool last_dim_component,
class... idx>
180 inline constexpr bool ArrayNDIndexCheck_impl_v = ArrayNDIndexCheck_impl<N, last_dim_component, idx...>::value;
182 template<std::size_t... idx>
183 constexpr auto make_oob_message_impl (std::index_sequence<idx...>) {
184 constexpr std::size_t N =
sizeof...(idx);
185 constexpr char prefix[] =
" (";
186 constexpr char middle[] =
") is out of bound (";
187 constexpr char suffix[] =
")\n";
189 constexpr std::size_t size =
196 std::array<char, size> buf{};
201 for (
char c : prefix) {
207 ((buf[pos++] =
'%', buf[pos++] =
'd', idx + 1 < N ? buf[pos++] =
',' : 0), ...);
210 for (
char c : middle) {
217 ((buf[pos++] =
'%', buf[pos++] =
'd', buf[pos++] =
':', buf[pos++] =
'%', buf[pos++] =
'd',
218 idx + 1 < N ? buf[pos++] =
',' : 0), ...);
221 for (
char c : suffix) {
227 template <std::size_t... idx, std::size_t... idx2x>
229 void device_print_impl2 (std::index_sequence<idx...>,
230 std::index_sequence<idx2x...>,
231 IntVectND<
sizeof...(idx)>
const& iv,
232 IntVectND<
sizeof...(idx)>
const&
begin,
233 IntVectND<
sizeof...(idx)>
const&
end)
235 constexpr auto msg = make_oob_message_impl(std::index_sequence<idx...>{});
239 ((idx2x % 2 == 0) ?
begin.vect[idx2x / 2] :
end.vect[idx2x / 2])...
246 void device_printf_impl (
const IntVectND<N>& iv,
247 const IntVectND<N>&
begin,
248 const IntVectND<N>&
end)
251 std::make_index_sequence<N>{},
252 std::make_index_sequence<N*2>{},
283 template<
typename T,
int N,
bool last_dim_component = false>
286 static_assert(N >= 1,
"ArrayND must have at least one dimension");
287 static_assert(N > 1 || !last_dim_component,
"ArrayND with N=1 cannot have last_dim_component=true");
292 static constexpr bool IsArray4_v = (N==4 && last_dim_component);
318 requires (std::is_const_v<U>)
320 constexpr ArrayND (
ArrayND<std::remove_const_t<T>, N, last_dim_component>
const& rhs) noexcept
321 :
p(rhs.p), stride(rhs.stride),
begin(rhs.begin),
end(rhs.end) {}
331 requires (!last_dim_component)
332 :
ArrayND(a_p, box.smallEnd(), box.bigEnd() + 1)
342 requires (((M+1==N) || (N == 4 && M == AMREX_SPACEDIM))
343 && last_dim_component)
347 :
ArrayND(a_p, box.smallEnd(), box.bigEnd() + 1, ncomp)
361 requires (!last_dim_component)
378 constexpr ArrayND (T* a_p,
Dim3 const& a_begin,
Dim3 const& a_end,
int a_ncomp)
noexcept
380 :
p(a_p),
begin(a_begin.
x, a_begin.
y, a_begin.
z, 0),
end(a_end.
x, a_end.
y, a_end.
z, a_ncomp)
396 requires (((M+1 == N) || (N == 4 && M == AMREX_SPACEDIM)) && last_dim_component)
401 constexpr_for<0, M>([&](
int d) {
405 constexpr_for<M, N>([&](
int d) {
423 requires (std::is_same_v<std::remove_const_t<T>, std::remove_const_t<U>>
424 && (N >= 2) && last_dim_component)
427 :
p((T*)(rhs.p + start_comp*rhs.stride.a[N-2])),
433 end.
vect[N-1] = rhs.end.vect[N-1] - start_comp;
446 requires (std::is_same_v<std::remove_const_t<T>, std::remove_const_t<U>>
447 && (N >= 2) && last_dim_component)
450 :
p((T*)(rhs.p + start_comp*rhs.stride.a[N-2])),
464 constexpr explicit operator bool() const noexcept {
return p !=
nullptr; }
490 template <
typename... idx>
492 && detail::ArrayNDIndexCheck_impl_v<N, last_dim_component, idx...>)
494 T&
operator() (idx... i)
const noexcept {
495 constexpr auto nidx =
sizeof...(i);
496#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
515 requires (!std::is_void_v<T> &&
516 ((M == N) || (!
IsArray4_v && last_dim_component && (M + 1 == N))))
519#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
537 requires (!std::is_void_v<T> && last_dim_component && !
IsArray4_v
541#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
553 template <
typename... idx>
555 && detail::ArrayNDIndexCheck_impl_v<N, last_dim_component, idx...>)
557 T*
ptr (idx... i)
const noexcept {
558 constexpr auto nidx =
sizeof...(i);
559#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
578 requires ((M == N) || (!
IsArray4_v && last_dim_component && (M + 1 == N)))
581#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
599 requires (last_dim_component && !
IsArray4_v && (M + 1 == N))
602#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
622 constexpr int nComp () const noexcept {
623 if constexpr (last_dim_component) {
639 constexpr std::size_t
size () const noexcept {
642 constexpr_for<0, N>([&](
int d) {
662 requires ((d < N) && (d >= 0))
665 if constexpr (N > 1 && d > 0) {
666 return stride.a[d-1];
683 template <
typename... idx>
685 detail::ArrayNDIndexCheck_impl_v<N, last_dim_component, idx...>)
687 constexpr bool contains (idx... i)
const noexcept {
688 constexpr auto nidx =
sizeof...(i);
709 requires ((M == N) || (!
IsArray4_v && last_dim_component && (M + 1 == N)))
713 constexpr_for<0, M>([&](
int d) {
714 inside = inside && (iv.vect[d] >=
begin.
vect[d]) && (iv.vect[d] <
end.
vect[d]);
736 requires (last_dim_component && !
IsArray4_v && (M + 1 == N))
740 constexpr_for<0, M>([&](
int d) {
741 inside = inside && (iv.vect[d] >=
begin.
vect[d]) && (iv.vect[d] <
end.
vect[d]);
743 inside = inside && (n >= 0) && (n <
end.
vect[N-1]);
780 requires ((M == N) || (last_dim_component && (M + 1 == N || M == AMREX_SPACEDIM)))
787 constexpr int idx = (last_dim_component && M == N) ? N - 1 : M;
788 if constexpr (N > 1) {
789 constexpr_for<1, idx>([&](
int d) {
796 if constexpr (last_dim_component && M == N) {
797 offset += iv.vect[N-1] * stride.a[N-2];
812 requires (last_dim_component
813 && ((M + 1 == N) || (N == 4 && M == AMREX_SPACEDIM)))
818 constexpr_for<1, M>([&](
int d) {
821 offset += n * stride.a[N-2];
825#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
826#if defined(AMREX_USE_HIP)
833 bool out_of_bounds =
false;
834 for (
int d = 0; d < N; ++d) {
836 out_of_bounds =
true;
841 detail::device_printf_impl(iv,
begin,
end);
845 std::stringstream ss;
847 for (
int d = 0; d < N; ++d) {
849 if (d + 1 < N) ss <<
",";
851 ss <<
") is out of bound (";
852 for (
int d = 0; d < N; ++d) {
854 if (d + 1 < N) ss <<
",";
865 requires (((M+1 == N) || (M == AMREX_SPACEDIM)) && last_dim_component)
866#if defined(AMREX_USE_HIP)
871 void index_assert (IntVectND<M>
const& iv)
const
873 IntVectND<N> iv_full = iv.template expand<N>(0);
874 for (
int d = M; d < N; ++d) {
877 index_assert(iv_full);
883 requires (((M+1 == N) || (M == AMREX_SPACEDIM)) && last_dim_component)
884#if defined(AMREX_USE_HIP)
889 void index_assert (IntVectND<M>
const& iv,
int n)
const
891 IntVectND<N> iv_full = iv.template expand<N>(0);
892 for (
int d = M; d < N-1; ++d) {
895 iv_full.vect[N-1] = n;
896 index_assert(iv_full);
926#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
927 AMREX_ARRAY4_INDEX_ASSERT(i,j,k,0);
929#if defined(AMREX_USE_GPU) || defined(AMREX_DEBUG)
934 Long idx1 = i + j*stride.a[0] + k*stride.a[1];
962#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
963 AMREX_ARRAY4_INDEX_ASSERT(i,j,k,n);
965#if defined(AMREX_USE_GPU) || defined(AMREX_DEBUG)
971 Long idx1 = i + j*stride.a[0] + k*stride.a[1] + n*stride.a[2];
989 requires (!std::is_void_v<T> &&
IsArray4_v && (M == 3 || M == AMREX_SPACEDIM))
992#if (AMREX_SPACEDIM == 1)
993 if constexpr (M == 1) {
996#elif (AMREX_SPACEDIM == 2)
997 if constexpr (M == 2) {
998 return this->
operator()(iv.vect[0],iv.vect[1],0);
1002 return this->
operator()(iv.vect[0],iv.vect[1],iv.vect[2]);
1017 requires (!std::is_void_v<T> &&
IsArray4_v && (M == 3 || M == AMREX_SPACEDIM))
1020#if (AMREX_SPACEDIM == 1)
1021 if constexpr (M == 1) {
1024#elif (AMREX_SPACEDIM == 2)
1025 if constexpr (M == 2) {
1026 return this->
operator()(iv.vect[0],iv.vect[1],0,n);
1030 return this->
operator()(iv.vect[0],iv.vect[1],iv.vect[2],n);
1046 return this->
operator()(cell.x,cell.y,cell.z);
1061 return this->
operator()(cell.x,cell.y,cell.z,n);
1073 T*
ptr (
int i,
int j,
int k)
const noexcept
1077#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
1078 AMREX_ARRAY4_INDEX_ASSERT(i,j,k,0);
1080#if defined(AMREX_USE_GPU) || defined(AMREX_DEBUG)
1085 Long idx1 = i + j*stride.a[0] + k*stride.a[1];
1089 return p + (idx1-idx0);
1103 T*
ptr (
int i,
int j,
int k,
int n)
const noexcept
1107#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
1108 AMREX_ARRAY4_INDEX_ASSERT(i,j,k,n);
1110#if defined(AMREX_USE_GPU) || defined(AMREX_DEBUG)
1116 Long idx1 = i + j*stride.a[0] + k*stride.a[1] + n*stride.a[2];
1120 return p + (idx1-idx0);
1131 requires (!std::is_void_v<T> &&
IsArray4_v && (M == 3 || M == AMREX_SPACEDIM))
1134#if (AMREX_SPACEDIM == 1)
1135 if constexpr (M == 1) {
1136 return this->
ptr(iv.vect[0],0,0);
1138#elif (AMREX_SPACEDIM == 2)
1139 if constexpr (M == 2) {
1140 return this->
ptr(iv.vect[0],iv.vect[1],0);
1144 return this->
ptr(iv.vect[0],iv.vect[1],iv.vect[2]);
1156 requires (!std::is_void_v<T> &&
IsArray4_v && (M == 3 || M == AMREX_SPACEDIM))
1159#if (AMREX_SPACEDIM == 1)
1160 if constexpr (M == 1) {
1161 return this->
ptr(iv.vect[0],0,0,n);
1163#elif (AMREX_SPACEDIM == 2)
1164 if constexpr (M == 2) {
1165 return this->
ptr(iv.vect[0],iv.vect[1],0,n);
1169 return this->
ptr(iv.vect[0],iv.vect[1],iv.vect[2],n);
1184 return this->
ptr(cell.x,cell.y,cell.z);
1199 return this->
ptr(cell.x,cell.y,cell.z,n);
1227 requires (
IsArray4_v && (M == 3 || M == AMREX_SPACEDIM))
1230#if (AMREX_SPACEDIM < 3)
1231 if constexpr (M == AMREX_SPACEDIM) {
1260#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
1261#if defined(AMREX_USE_HIP)
1266 void index_assert_print_error_message (
int i,
int j,
int k,
int n)
const
1280 std::stringstream ss;
1281 ss << " (" << i << "," << j << "," << k << "," << n
1282 << ") is out of bound ("
1283 <<
begin.vect[0] << ":" <<
end.vect[0]-1 << ","
1284 <<
begin.vect[1] << ":" <<
end.vect[1]-1 << ","
1285 <<
begin.vect[2] << ":" <<
end.vect[2]-1 << ","
1286 << "0:" <<
end.vect[3]-1 << ")";
1294 constexpr void set_stride () noexcept {
1295 if constexpr (N > 1) {
1296 Long current_stride = 1;
1299 current_stride *= len;
1300 stride.a[d] = current_stride;
1308 template <
typename T,
int N>
1313 template <
typename T,
int N>
1317 template <
typename T,
int N>
1321 template <
typename T,
int N>
1325 template <
typename T>
1333 template<
typename T>
1347 return Dim3{.
x = a.begin.vect[0], .y = a.begin.vect[1], .z = a.begin.vect[2]};
1361 return Dim3{.
x = a.end.vect[0]-1, .y = a.end.vect[1]-1, .z = a.end.vect[2]-1};
1375 return Dim3{.
x = a.end.vect[0]-a.begin.vect[0],
1376 .y = a.end.vect[1]-a.begin.vect[1],
1377 .z = a.end.vect[2]-a.begin.vect[2]};
1391 template <
typename T,
int N,
bool C>
1393 os <<
"(" << a.
begin <<
',' << a.
end-1 <<
")";
1403 requires (B().size() >= 1)
1411 template <
typename T>
1420 T& operator() (
int i,
int j,
int k)
const noexcept {
1425 typename T::reference_type
1426 operator() (
int i,
int j,
int k,
int n)
const noexcept
1434 T& operator() (
int i,
int j,
int k,
int n)
const noexcept
1442 template <
typename T>
1443 [[nodiscard]] PolymorphicArray4<T>
#define AMREX_NO_UNIQUE_ADDRESS
Definition AMReX_Extension.H:264
#define AMREX_NO_INLINE
Definition AMReX_Extension.H:136
#define AMREX_FORCE_INLINE
Definition AMReX_Extension.H:119
#define AMREX_RESTRICT
Definition AMReX_Extension.H:32
#define AMREX_DEVICE_PRINTF(...)
Definition AMReX_GpuPrint.H:21
#define AMREX_IF_ON_DEVICE(CODE)
Definition AMReX_GpuQualifiers.H:56
#define AMREX_IF_ON_HOST(CODE)
Definition AMReX_GpuQualifiers.H:58
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
Array4< int const > offset
Definition AMReX_HypreMLABecLap.cpp:1139
#define AMREX_D_TERM(a, b, c)
Definition AMReX_SPACE.H:172
A Rectangular Domain on an Integer Lattice.
Definition AMReX_Box.H:49
An Integer Vector in dim-Dimensional Space.
Definition AMReX_IntVect.H:149
__host__ __device__ constexpr 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:517
int vect[dim]
Definition AMReX_IntVect.H:885
amrex_long Long
Definition AMReX_INT.H:30
__host__ __device__ Dim3 ubound(Array4< T > const &a) noexcept
Return the inclusive upper bounds of an Array4 in Dim3 form.
Definition AMReX_Array4.H:1359
__host__ __device__ Dim3 length(Array4< T > const &a) noexcept
Return the spatial extents of an Array4 in Dim3 form.
Definition AMReX_Array4.H:1373
__host__ __device__ Dim3 lbound(Array4< T > const &a) noexcept
Return the inclusive lower bounds of an Array4 in Dim3 form.
Definition AMReX_Array4.H:1345
Definition AMReX_Amr.cpp:50
std::ostream & operator<<(std::ostream &os, AmrMesh const &amr_mesh)
Stream helper; forwards to the friend declared inside AmrMesh.
Definition AMReX_AmrMesh.cpp:1306
__host__ __device__ Dim3 begin(BoxND< dim > const &box) noexcept
Definition AMReX_Box.H:2018
__host__ __device__ constexpr void constexpr_for(F const &f)
Definition AMReX_ConstexprFor.H:28
PolymorphicArray4< T > makePolymorphic(Array4< T > const &a)
Definition AMReX_Array4.H:1444
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition AMReX.cpp:241
__host__ __device__ Dim3 end(BoxND< dim > const &box) noexcept
Definition AMReX_Box.H:2028
A multidimensional array accessor.
Definition AMReX_Array4.H:285
__host__ __device__ T * ptr(int i, int j, int k) const noexcept
Return the pointer to an element.
Definition AMReX_Array4.H:1073
__host__ __device__ constexpr bool contains(IntVectND< M > const &iv, int n) const noexcept
Test whether a spatial index and component lie inside the bounds.
Definition AMReX_Array4.H:738
static constexpr bool IsArray4_v
True if this is an Array4 (N==4 and last dim is component).
Definition AMReX_Array4.H:292
__host__ __device__ ArrayND(T *a_p, BoxND< M > const &box, int ncomp) noexcept
Constructor using a BoxND and the number of components.
Definition AMReX_Array4.H:346
__host__ __device__ constexpr bool ok() const noexcept
Check if the ArrayND pointer is valid and bounds are valid.
Definition AMReX_Array4.H:472
__host__ __device__ T & operator()(idx... i) const noexcept
Multi-index operator() for accessing elements.
Definition AMReX_Array4.H:494
__host__ __device__ ArrayND(T *a_p, BoxND< N > const &box) noexcept
Constructor using a BoxND.
Definition AMReX_Array4.H:330
__host__ __device__ constexpr std::size_t size() const noexcept
Total number of elements in the ArrayND's index region.
Definition AMReX_Array4.H:639
__host__ __device__ constexpr bool contains(IntVectND< M > const &iv) const noexcept
Test whether an IntVectND lies inside the ArrayND bounds.
Definition AMReX_Array4.H:711
__host__ __device__ bool contains(IntVectND< M > const &iv) const noexcept
Test whether the spatial indices are inside the Array4 bounds.
Definition AMReX_Array4.H:1229
__host__ __device__ T * ptr(IntVectND< M > const &iv) const noexcept
Access pointer by IntVectND.
Definition AMReX_Array4.H:580
T *__restrict__ p
Definition AMReX_Array4.H:294
__host__ __device__ constexpr ArrayND(T *a_p, IntVectND< N > const &a_begin, IntVectND< N > const &a_end) noexcept
IntVectND<N> constructor.
Definition AMReX_Array4.H:360
__host__ __device__ constexpr bool contains(idx... i) const noexcept
Test whether an index tuple lies inside the ArrayND bounds.
Definition AMReX_Array4.H:687
__host__ __device__ T * ptr(Dim3 const &cell, int n) const noexcept
Return the pointer to an element.
Definition AMReX_Array4.H:1195
static constexpr bool IsLastDimComponent_v
True if the last dimension is treated as components.
Definition AMReX_Array4.H:290
__host__ __device__ constexpr int nComp() const noexcept
Get number of components.
Definition AMReX_Array4.H:622
__host__ __device__ constexpr T * dataPtr() const noexcept
Get raw data pointer.
Definition AMReX_Array4.H:613
__host__ __device__ T * ptr(idx... i) const noexcept
Multi-index ptr() for accessing pointer to element.
Definition AMReX_Array4.H:557
__host__ __device__ T * ptr(int i, int j, int k, int n) const noexcept
Return the pointer to an element.
Definition AMReX_Array4.H:1103
IntVectND< N > end
Exclusive upper bounds.
Definition AMReX_Array4.H:299
__host__ __device__ constexpr Long get_offset(IntVectND< M > const &iv, int n) const noexcept
Compute the linear offset (in elements) for an IntVectND and component index.
Definition AMReX_Array4.H:815
IntVectND< N > begin
Inclusive lower bounds.
Definition AMReX_Array4.H:298
__host__ __device__ CellData< T > cellData(int i, int j, int k) const noexcept
Create a single-cell component accessor.
Definition AMReX_Array4.H:764
__host__ __device__ T * ptr(IntVectND< M > const &iv, int n) const noexcept
Access pointer by spatial IntVectND and component index.
Definition AMReX_Array4.H:601
__host__ __device__ T * ptr(IntVectND< M > const &iv) const noexcept
Return the pointer to an element.
Definition AMReX_Array4.H:1133
__host__ __device__ constexpr ArrayND(ArrayND< U, N, last_dim_component > const &rhs, int start_comp, int num_comp) noexcept
Slicing constructor (Component subset with count).
Definition AMReX_Array4.H:449
__host__ __device__ constexpr Long get_offset(IntVectND< M > const &iv) const noexcept
Compute the linear offset (in elements) for an IntVectND.
Definition AMReX_Array4.H:782
__host__ __device__ T * ptr(Dim3 const &cell) const noexcept
Return the pointer to an element.
Definition AMReX_Array4.H:1180
__host__ __device__ constexpr Long get_stride() const noexcept
Return the stride (in elements) for dimension d.
Definition AMReX_Array4.H:664
__host__ __device__ constexpr ArrayND() noexcept
Default-construct an empty accessor.
Definition AMReX_Array4.H:307
__host__ __device__ constexpr ArrayND(ArrayND< U, N, last_dim_component > const &rhs, int start_comp) noexcept
Slicing constructor (Component subset).
Definition AMReX_Array4.H:426
__host__ __device__ constexpr ArrayND(T *a_p, Dim3 const &a_begin, Dim3 const &a_end, int a_ncomp) noexcept
Constructor for N=4 using Dim3.
Definition AMReX_Array4.H:378
__host__ __device__ T * ptr(IntVectND< M > const &iv, int n) const noexcept
Return the pointer to an element.
Definition AMReX_Array4.H:1158
__host__ __device__ bool contains(Dim3 const &cell) const noexcept
Test whether the spatial indices are inside the Array4 bounds.
Definition AMReX_Array4.H:1251
__host__ __device__ bool contains(int i, int j, int k) const noexcept
Test whether the spatial indices are inside the Array4 bounds.
Definition AMReX_Array4.H:1211
__host__ __device__ constexpr ArrayND(T *a_p, IntVectND< M > const &a_begin, IntVectND< M > const &a_end, int ncomp) noexcept
Reduced dimension constructor with component count.
Definition AMReX_Array4.H:398
Lightweight accessor for data associated with a single cell.
Definition AMReX_Array4.H:42
__host__ __device__ constexpr CellData(T *a_p, Long a_stride, int a_ncomp)
Construct a CellData.
Definition AMReX_Array4.H:59
__host__ __device__ T & operator[](int n) const
Access the n-th component of the cell.
Definition AMReX_Array4.H:103
__host__ __device__ int nComp() const noexcept
Return the number of components.
Definition AMReX_Array4.H:90
Definition AMReX_Dim3.H:13
int x
Definition AMReX_Dim3.H:13
Definition AMReX_Array4.H:1400
Definition AMReX_Array4.H:1414
__host__ __device__ PolymorphicArray4(Array4< T > const &a)
Definition AMReX_Array4.H:1416