https://mooseframework.inl.gov
Public Member Functions | Protected Attributes | List of all members
Moose::Kokkos::JaggedArrayInnerDataBase< T, inner > Class Template Reference

The base class of the inner array wrapper. More...

#include <KokkosJaggedArray.h>

Public Member Functions

KOKKOS_FUNCTION JaggedArrayInnerDataBase (T *data, JaggedArrayInnerDim< inner > dim)
 Constructor. More...
 
KOKKOS_FUNCTION dof_id_type size () const
 Get the total inner array size. More...
 
KOKKOS_FUNCTION dof_id_type n (unsigned int dim) const
 Get the size of a dimension of the inner array. More...
 
KOKKOS_FUNCTION T & operator[] (dof_id_type i) const
 Get an array entry. More...
 

Protected Attributes

T * _data
 Pointer to the inner array data. More...
 
JaggedArrayInnerDim< inner > _dim
 Inner array dimension information. More...
 

Detailed Description

template<typename T, unsigned int inner>
class Moose::Kokkos::JaggedArrayInnerDataBase< T, inner >

The base class of the inner array wrapper.

This object provides access to an inner array with local multi-dimensional indexing and is created as a temporary object by the jagged array class.

Template Parameters
TThe data type
innerThe inner array dimension size

Definition at line 53 of file KokkosJaggedArray.h.

Constructor & Destructor Documentation

◆ JaggedArrayInnerDataBase()

template<typename T, unsigned int inner>
KOKKOS_FUNCTION Moose::Kokkos::JaggedArrayInnerDataBase< T, inner >::JaggedArrayInnerDataBase ( T *  data,
JaggedArrayInnerDim< inner >  dim 
)
inline

Constructor.

Parameters
dataThe pointer to the inner array data
dimThe inner array dimension information

Definition at line 61 of file KokkosJaggedArray.h.

62  : _data(data), _dim(dim)
63  {
64  }
JaggedArrayInnerDim< inner > _dim
Inner array dimension information.
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:162
T * _data
Pointer to the inner array data.

Member Function Documentation

◆ n()

template<typename T, unsigned int inner>
KOKKOS_FUNCTION dof_id_type Moose::Kokkos::JaggedArrayInnerDataBase< T, inner >::n ( unsigned int  dim) const
inline

Get the size of a dimension of the inner array.

Parameters
dimThe dimension index
Returns
The size of the dimension of the inner array

Definition at line 76 of file KokkosJaggedArray.h.

76 { return _dim[dim]; }
JaggedArrayInnerDim< inner > _dim
Inner array dimension information.
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:162

◆ operator[]()

template<typename T, unsigned int inner>
KOKKOS_FUNCTION T& Moose::Kokkos::JaggedArrayInnerDataBase< T, inner >::operator[] ( dof_id_type  i) const
inline

Get an array entry.

Parameters
iThe dimensionless inner array index

Definition at line 81 of file KokkosJaggedArray.h.

82  {
83  KOKKOS_ASSERT(i < _dim.stride[inner - 1]);
84 
85  return _data[i];
86  }
JaggedArrayInnerDim< inner > _dim
Inner array dimension information.
T * _data
Pointer to the inner array data.

◆ size()

template<typename T, unsigned int inner>
KOKKOS_FUNCTION dof_id_type Moose::Kokkos::JaggedArrayInnerDataBase< T, inner >::size ( ) const
inline

Get the total inner array size.

Returns
The total inner array size

Definition at line 70 of file KokkosJaggedArray.h.

70 { return _dim.stride[inner - 1]; }
JaggedArrayInnerDim< inner > _dim
Inner array dimension information.

Member Data Documentation

◆ _data

template<typename T, unsigned int inner>
T* Moose::Kokkos::JaggedArrayInnerDataBase< T, inner >::_data
protected

Pointer to the inner array data.

Definition at line 92 of file KokkosJaggedArray.h.

Referenced by Moose::Kokkos::JaggedArrayInnerDataBase< T, 1 >::operator[]().

◆ _dim

template<typename T, unsigned int inner>
JaggedArrayInnerDim<inner> Moose::Kokkos::JaggedArrayInnerDataBase< T, inner >::_dim
protected

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