Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::PolymorphicArray4< T > Struct Template Reference

#include <AMReX_Array4.H>

Inheritance diagram for amrex::PolymorphicArray4< T >:
amrex::ArrayND< T, N, last_dim_component >

Public Member Functions

__host__ __device__ PolymorphicArray4 (Array4< T > const &a)
 
__host__ __device__ T & operator() (int i, int j, int k) const noexcept
 
__host__ __device__ T::reference_type operator() (int i, int j, int k, int n) const noexcept
 
__host__ __device__ T & operator() (int i, int j, int k, int n) const noexcept
 
- Public Member Functions inherited from amrex::ArrayND< T, N, last_dim_component >
__host__ __device__ constexpr ArrayND () noexcept
 Default-construct an empty accessor.
 
template<class U = T>
requires (std::is_const_v<U>)
__host__ __device__ constexpr ArrayND (ArrayND< std::remove_const_t< T >, N, last_dim_component > const &rhs) noexcept
 Construct a const accessor from a non-const accessor.
 
__host__ __device__ ArrayND (T *a_p, BoxND< N > const &box) noexcept
 Constructor using a BoxND.
 
template<int M>
requires (((M+1==N) || (N == 4 && M == 3)) && last_dim_component)
__host__ __device__ ArrayND (T *a_p, BoxND< M > const &box, int ncomp) noexcept
 Constructor using a BoxND and the number of components.
 
__host__ __device__ constexpr ArrayND (T *a_p, IntVectND< N > const &a_begin, IntVectND< N > const &a_end) noexcept
 IntVectND<N> constructor.
 
__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.
 
template<int M>
requires (((M+1 == N) || (N == 4 && M == 3)) && last_dim_component)
__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.
 
template<class U >
requires (std::is_same_v<std::remove_const_t<T>, std::remove_const_t<U>> && (N >= 2) && last_dim_component)
__host__ __device__ constexpr ArrayND (ArrayND< U, N, last_dim_component > const &rhs, int start_comp) noexcept
 Slicing constructor (Component subset).
 
template<class U >
requires (std::is_same_v<std::remove_const_t<T>, std::remove_const_t<U>> && (N >= 2) && last_dim_component)
__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).
 
__host__ __device__ constexpr operator bool () const noexcept
 Check if the ArrayND pointer is valid.
 
__host__ __device__ constexpr bool ok () const noexcept
 Check if the ArrayND pointer is valid and bounds are valid.
 
template<typename... idx>
requires (!std::is_void_v<T> && !IsArray4_v && detail::ArrayNDIndexCheck_impl_v<N, last_dim_component, idx...>)
__host__ __device__ T & operator() (idx... i) const noexcept
 Multi-index operator() for accessing elements.
 
template<int M>
requires (!std::is_void_v<T> && ((M == N) || (!IsArray4_v && last_dim_component && (M + 1 == N))))
__host__ __device__ T & operator() (IntVectND< M > const &iv) const noexcept
 Access element by IntVectND.
 
template<int M>
requires (!std::is_void_v<T> && last_dim_component && !IsArray4_v && (M + 1 == N))
__host__ __device__ T & operator() (IntVectND< M > const &iv, int n) const noexcept
 Access element by spatial IntVectND and component index.
 
template<typename... idx>
requires (!std::is_void_v<T> && !IsArray4_v && detail::ArrayNDIndexCheck_impl_v<N, last_dim_component, idx...>)
__host__ __device__ T * ptr (idx... i) const noexcept
 Multi-index ptr() for accessing pointer to element.
 
template<int M>
requires ((M == N) || (!IsArray4_v && last_dim_component && (M + 1 == N)))
__host__ __device__ T * ptr (IntVectND< M > const &iv) const noexcept
 Access pointer by IntVectND.
 
template<int M>
requires (last_dim_component && !IsArray4_v && (M + 1 == N))
__host__ __device__ T * ptr (IntVectND< M > const &iv, int n) const noexcept
 Access pointer by spatial IntVectND and component index.
 
__host__ __device__ constexpr T * dataPtr () const noexcept
 Get raw data pointer.
 
__host__ __device__ constexpr int nComp () const noexcept
 Get number of components.
 
__host__ __device__ constexpr std::size_t size () const noexcept
 Total number of elements in the ArrayND's index region.
 
template<int d>
requires ((d < N) && (d >= 0))
__host__ __device__ constexpr Long get_stride () const noexcept
 Return the stride (in elements) for dimension d.
 
template<typename... idx>
requires (!IsArray4_v && detail::ArrayNDIndexCheck_impl_v<N, last_dim_component, idx...>)
__host__ __device__ constexpr bool contains (idx... i) const noexcept
 Test whether an index tuple lies inside the ArrayND bounds.
 
template<int M>
requires ((M == N) || (!IsArray4_v && last_dim_component && (M + 1 == N)))
__host__ __device__ constexpr bool contains (IntVectND< M > const &iv) const noexcept
 Test whether an IntVectND lies inside the ArrayND bounds.
 
template<int M>
requires (last_dim_component && !IsArray4_v && (M + 1 == N))
__host__ __device__ constexpr bool contains (IntVectND< M > const &iv, int n) const noexcept
 Test whether a spatial index and component lie inside the bounds.
 
__host__ __device__ CellData< T > cellData (int i, int j, int k) const noexcept
 Create a single-cell component accessor.
 
template<int M>
requires ((M == N) || (last_dim_component && (M + 1 == N || M == 3)))
__host__ __device__ constexpr Long get_offset (IntVectND< M > const &iv) const noexcept
 Compute the linear offset (in elements) for an IntVectND.
 
template<int M>
requires (last_dim_component && ((M + 1 == N) || (N == 4 && M == 3)))
__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.
 
__host__ __device__ T & operator() (int i, int j, int k) const noexcept
 Access Array4 element using three integer spatial indices.
 
__host__ __device__ T & operator() (int i, int j, int k, int n) const noexcept
 Access Array4 element using three integer spatial indices and component index.
 
template<int M>
requires (!std::is_void_v<T> && IsArray4_v && (M == 3 || M == 3))
__host__ __device__ T & operator() (IntVectND< M > const &iv) const noexcept
 Access Array4 element by spatial indices in IntVectND.
 
template<int M>
requires (!std::is_void_v<T> && IsArray4_v && (M == 3 || M == 3))
__host__ __device__ T & operator() (IntVectND< M > const &iv, int n) const noexcept
 Access Array4 element by spatial indices in IntVectND and component index.
 
__host__ __device__ T & operator() (Dim3 const &cell) const noexcept
 Access Array4 element by spatial indices in Dim3.
 
__host__ __device__ T & operator() (Dim3 const &cell, int n) const noexcept
 Access Array4 element by spatial indices in Dim3 and component index.
 
__host__ __device__ T * ptr (int i, int j, int k) const noexcept
 Return the pointer to an element.
 
__host__ __device__ T * ptr (int i, int j, int k, int n) const noexcept
 Return the pointer to an element.
 
template<int M>
requires (!std::is_void_v<T> && IsArray4_v && (M == 3 || M == 3))
__host__ __device__ T * ptr (IntVectND< M > const &iv) const noexcept
 Return the pointer to an element.
 
template<int M>
requires (!std::is_void_v<T> && IsArray4_v && (M == 3 || M == 3))
__host__ __device__ T * ptr (IntVectND< M > const &iv, int n) const noexcept
 Return the pointer to an element.
 
__host__ __device__ T * ptr (Dim3 const &cell) const noexcept
 Return the pointer to an element.
 
__host__ __device__ T * ptr (Dim3 const &cell, int n) const noexcept
 Return the pointer to an element.
 
__host__ __device__ bool contains (int i, int j, int k) const noexcept
 Test whether the spatial indices are inside the Array4 bounds.
 
template<int M>
requires (IsArray4_v && (M == 3 || M == 3))
__host__ __device__ bool contains (IntVectND< M > const &iv) const noexcept
 Test whether the spatial indices are inside the Array4 bounds.
 
__host__ __device__ bool contains (Dim3 const &cell) const noexcept
 Test whether the spatial indices are inside the Array4 bounds.
 

Additional Inherited Members

- Public Attributes inherited from amrex::ArrayND< T, N, last_dim_component >
T *__restrict__ p = nullptr
 
IntVectND< N > begin {1}
 Inclusive lower bounds.
 
IntVectND< N > end {0}
 Exclusive upper bounds.
 
- Static Public Attributes inherited from amrex::ArrayND< T, N, last_dim_component >
static constexpr bool IsLastDimComponent_v = last_dim_component
 True if the last dimension is treated as components.
 
static constexpr bool IsArray4_v = (N==4 && last_dim_component)
 True if this is an Array4 (N==4 and last dim is component).
 

Constructor & Destructor Documentation

◆ PolymorphicArray4()

template<typename T >
__host__ __device__ amrex::PolymorphicArray4< T >::PolymorphicArray4 ( Array4< T > const &  a)
inline

Member Function Documentation

◆ operator()() [1/3]

template<typename T >
__host__ __device__ T & amrex::PolymorphicArray4< T >::operator() ( int  i,
int  j,
int  k 
) const
inlinenoexcept

◆ operator()() [2/3]

template<typename T >
__host__ __device__ T::reference_type amrex::PolymorphicArray4< T >::operator() ( int  i,
int  j,
int  k,
int  n 
) const
inlinenoexcept

◆ operator()() [3/3]

template<typename T >
__host__ __device__ T & amrex::PolymorphicArray4< T >::operator() ( int  i,
int  j,
int  k,
int  n 
) const
inlinenoexcept

The documentation for this struct was generated from the following file: