Lightweight accessor for data associated with a single cell.
More...
#include <AMReX_Array4.H>
|
| __host__ __device__ constexpr | CellData (T *a_p, Long a_stride, int a_ncomp) |
| | Construct a CellData.
|
| |
| template<class U = T, std::enable_if_t< std::is_const_v< U >, int > = 0> |
| __host__ __device__ constexpr | CellData (CellData< std::remove_const_t< T > > const &rhs) noexcept |
| | Construct a const CellData from a non-const CellData.
|
| |
| __host__ __device__ | operator bool () const noexcept |
| | Check whether the accessor refers to valid data.
|
| |
| __host__ __device__ int | nComp () const noexcept |
| | Return the number of components.
|
| |
| template<class U = T, std::enable_if_t<!std::is_void_v< U >, int > = 0> |
| __host__ __device__ U & | operator[] (int n) const noexcept |
| | Access the n-th component of the cell.
|
| |
template<typename T>
class amrex::CellData< T >
Lightweight accessor for data associated with a single cell.
- Template Parameters
-
| T | Data type. May be const-qualified. |
CellData provides a non-owning view of data associated with a single cell in an Array4. It's typically created by the Array4::cellData member function.
◆ CellData() [1/2]
Construct a CellData.
- Parameters
-
| a_p | data Pointer pointing to component 0 of the cell data |
| a_stride | Component stride, i.e., the distance (in number of elements, not bytes) between successive components (i,j,k,n) and (i,j,k,n+1) of Array4. |
| a_ncomp | number of components. |
◆ CellData() [2/2]
template<typename T >
template<class U = T, std::enable_if_t< std::is_const_v< U >,
int > = 0>
Construct a const CellData from a non-const CellData.
This enables implicit conversion from CellData<T> to CellData<const T>.
- Parameters
-
◆ nComp()
Return the number of components.
◆ operator bool()
Check whether the accessor refers to valid data.
- Returns
true if the internal pointer is non-null, otherwise false.
◆ operator[]()
template<typename T >
template<class U = T, std::enable_if_t<!std::is_void_v< U >,
int > = 0>
Access the n-th component of the cell.
- Parameters
-
- Returns
- Reference to component
n.
- Warning
- No bounds checking is performed, unless
either AMREX_DEBUG or AMREX_BOUND_CHECK is defined. The caller is responsible for ensuring that n is in the range [0, ncomp).
The documentation for this class was generated from the following file: