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
 
template<class U = T, std::enable_if_t< amrex::HasMultiComp< U >::value, int > = 0>
__host__ __device__ U::reference_type operator() (int i, int j, int k, int n) const noexcept
 
template<class U = T, std::enable_if_t<!amrex::HasMultiComp< U >::value, int > = 0>
__host__ __device__ U & 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
 
template<class U = T, std::enable_if_t< std::is_const_v< U >, int > = 0>
__host__ __device__ constexpr ArrayND (ArrayND< std::remove_const_t< T >, N, last_dim_component > const &rhs) noexcept
 
template<bool C = last_dim_component, std::enable_if_t<!C, int > = 0>
__host__ __device__ ArrayND (T *a_p, BoxND< N > const &box) noexcept
 Constructor using a BoxND.
 
template<int M, std::enable_if_t<((M+1==N)||(N==4 &&M==3)) &&last_dim_component, int > = 0>
__host__ __device__ ArrayND (T *a_p, BoxND< M > const &box, int ncomp) noexcept
 Constructor using a BoxND.
 
template<bool C = last_dim_component, std::enable_if_t<!C, int > = 0>
__host__ __device__ constexpr ArrayND (T *a_p, IntVectND< N > const &a_begin, IntVectND< N > const &a_end) noexcept
 IntVectND<N> constructor.
 
template<bool B = IsArray4_v, std::enable_if_t< B, int > = 0>
__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, std::enable_if_t<((M+1==N)||(N==4 &&M==3)) &&last_dim_component, int > = 0>
__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 , std::enable_if_t< std::is_same_v< std::remove_const_t< T >, std::remove_const_t< U > > &&(N >=2) &&last_dim_component, int > = 0>
__host__ __device__ constexpr ArrayND (ArrayND< U, N, last_dim_component > const &rhs, int start_comp) noexcept
 Slicing constructor (Component subset).
 
template<class U , std::enable_if_t< std::is_same_v< std::remove_const_t< T >, std::remove_const_t< U > > &&(N >=2) &&last_dim_component, int > = 0>
__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, class U = T, std::enable_if_t<!std::is_void_v< U > &&!IsArray4_v &&detail::ArrayNDIndexCheck_impl_v< N, last_dim_component, idx... >, int > = 0>
__host__ __device__ U & operator() (idx... i) const noexcept
 Multi-index operator() for accessing elements.
 
template<int M, class U = T, std::enable_if_t< !std::is_void_v< U > &&((M==N)||(!IsArray4_v &&last_dim_component &&(M+1==N))), int > = 0>
__host__ __device__ U & operator() (IntVectND< M > const &iv) const noexcept
 Access element by IntVectND.
 
template<int M, class U = T, std::enable_if_t< !std::is_void_v< U > &&last_dim_component &&!IsArray4_v &&(M+1==N), int > = 0>
__host__ __device__ U & operator() (IntVectND< M > const &iv, int n) const noexcept
 Access element by spatial IntVectND and component index.
 
template<typename... idx, class U = T, std::enable_if_t<!std::is_void_v< U > &&!IsArray4_v &&detail::ArrayNDIndexCheck_impl_v< N, last_dim_component, idx... >, int > = 0>
__host__ __device__ T * ptr (idx... i) const noexcept
 Multi-index ptr() for accessing pointer to element.
 
template<int M, std::enable_if_t<(M==N)||(!IsArray4_v &&last_dim_component &&(M+1==N)), int > = 0>
__host__ __device__ T * ptr (IntVectND< M > const &iv) const noexcept
 Access pointer by IntVectND.
 
template<int M, std::enable_if_t< last_dim_component &&!IsArray4_v &&(M+1==N), int > = 0>
__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
 
template<int d, std::enable_if_t<(d< N) &&(d >=0), int > = 0>
__host__ __device__ constexpr Long get_stride () const noexcept
 
template<typename... idx, std::enable_if_t<!IsArray4_v &&detail::ArrayNDIndexCheck_impl_v< N, last_dim_component, idx... >, int > = 0>
__host__ __device__ constexpr bool contains (idx... i) const noexcept
 
template<int M, std::enable_if_t<(M==N)||(!IsArray4_v &&last_dim_component &&(M+1==N)), int > = 0>
__host__ __device__ constexpr bool contains (IntVectND< M > const &iv) const noexcept
 
template<int M, std::enable_if_t< last_dim_component &&!IsArray4_v &&(M+1==N), int > = 0>
__host__ __device__ constexpr bool contains (IntVectND< M > const &iv, int n) const noexcept
 
template<int M = N, bool B = IsArray4_v, std::enable_if_t< B, int > = 0>
__host__ __device__ CellData< T > cellData (int i, int j, int k) const noexcept
 
template<int M, std::enable_if_t<(M==N)||(last_dim_component &&(M+1==N||M==3)), int > = 0>
__host__ __device__ constexpr Long get_offset (IntVectND< M > const &iv) const noexcept
 
template<int M, std::enable_if_t< last_dim_component &&((M+1==N)||(N==4 &&M==3)), int > = 0>
__host__ __device__ constexpr Long get_offset (IntVectND< M > const &iv, int n) const noexcept
 
template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0>
__host__ __device__ U & operator() (int i, int j, int k) const noexcept
 
template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0>
__host__ __device__ U & operator() (int i, int j, int k, int n) const noexcept
 
template<int M, class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v &&(M==3||M==3), int > = 0>
__host__ __device__ U & operator() (IntVectND< M > const &iv) const noexcept
 
template<int M, class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v &&(M==3||M==3), int > = 0>
__host__ __device__ U & operator() (IntVectND< M > const &iv, int n) const noexcept
 
template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0>
__host__ __device__ U & operator() (Dim3 const &cell) const noexcept
 
template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0>
__host__ __device__ U & operator() (Dim3 const &cell, int n) const noexcept
 
template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0>
__host__ __device__ U * ptr (int i, int j, int k) const noexcept
 
template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0>
__host__ __device__ U * ptr (int i, int j, int k, int n) const noexcept
 
template<int M, class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v &&(M==3||M==3), int > = 0>
__host__ __device__ U * ptr (IntVectND< M > const &iv) const noexcept
 
template<int M, class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v &&(M==3||M==3), int > = 0>
__host__ __device__ U * ptr (IntVectND< M > const &iv, int n) const noexcept
 
template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0>
__host__ __device__ U * ptr (Dim3 const &cell) const noexcept
 
template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0>
__host__ __device__ U * ptr (Dim3 const &cell, int n) const noexcept
 
template<bool B = IsArray4_v, std::enable_if_t< B, int > = 0>
__host__ __device__ bool contains (int i, int j, int k) const noexcept
 
template<int M, std::enable_if_t< IsArray4_v &&(M==3||M==3), int > = 0>
__host__ __device__ bool contains (IntVectND< M > const &iv) const noexcept
 
template<bool B = IsArray4_v, std::enable_if_t< B, int > = 0>
__host__ __device__ bool contains (Dim3 const &cell) const noexcept
 

Additional Inherited Members

- Public Attributes inherited from amrex::ArrayND< T, N, last_dim_component >
T *__restrict__ p = nullptr
 
detail::Stride< N-1 > stride {}
 
IntVectND< N > begin {1}
 
IntVectND< N > end {0}
 
- Static Public Attributes inherited from amrex::ArrayND< T, N, last_dim_component >
static constexpr bool IsLastDimComponent_v = last_dim_component
 
static constexpr bool IsArray4_v = (N==4 && last_dim_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 >
template<class U = T, std::enable_if_t< amrex::HasMultiComp< U >::value, int > = 0>
__host__ __device__ U::reference_type amrex::PolymorphicArray4< T >::operator() ( int  i,
int  j,
int  k,
int  n 
) const
inlinenoexcept

◆ operator()() [3/3]

template<typename T >
template<class U = T, std::enable_if_t<!amrex::HasMultiComp< U >::value, int > = 0>
__host__ __device__ U & 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: