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

#include <KokkosMaterialPropertyDecl.h>

Inheritance diagram for Moose::Kokkos::MaterialPropertyValue< T, dimension >:
[legend]

Public Member Functions

KOKKOS_FUNCTION MaterialPropertyValue (const MaterialProperty< T, dimension > &property, const Datum &datum, const unsigned int qp)
 Constructor. More...
 
template<typename... index_type>
KOKKOS_FUNCTION T & operator() (index_type... i)
 Get the writeable reference of a property value. More...
 
template<typename... index_type>
KOKKOS_FUNCTION const T & operator() (index_type... i) const
 Get the const reference of a property value. More...
 
KOKKOS_FUNCTION dof_id_type n (unsigned int dim) const
 Get the size of a dimension. More...
 

Protected Attributes

const dof_id_type _idx
 Index into the property data storage. More...
 
Array< T, dimension+1 > const * _data
 Pointer to the property data storage. More...
 
const T & _value
 Default value. More...
 

Private Member Functions

 usingKokkosMaterialPropertyValueBaseMembers (T, dimension)
 

Detailed Description

template<typename T, unsigned int dimension>
class Moose::Kokkos::MaterialPropertyValue< T, dimension >

Definition at line 31 of file KokkosMaterialPropertyDecl.h.

Constructor & Destructor Documentation

◆ MaterialPropertyValue()

template<typename T , unsigned int dimension>
KOKKOS_FUNCTION Moose::Kokkos::MaterialPropertyValue< T, dimension >::MaterialPropertyValue ( const MaterialProperty< T, dimension > &  property,
const Datum datum,
const unsigned int  qp 
)

Constructor.

Parameters
propertyThe material property constructing this object
datumThe Datum object of the current thread
qpThe local quadrature point index

Definition at line 32 of file KokkosMaterialPropertyValue.h.

34  : MaterialPropertyValueBase<T, dimension>(property, datum, qp)
35 {
36 }

Member Function Documentation

◆ n()

template<typename T, unsigned int dimension>
KOKKOS_FUNCTION dof_id_type Moose::Kokkos::MaterialPropertyValueBase< T, dimension >::n ( unsigned int  dim) const
inlineinherited

Get the size of a dimension.

Parameters
dimThe dimension index
Returns
The size of the dimension

Definition at line 52 of file KokkosMaterialPropertyValueDecl.h.

52 { return _data->n(dim); }
KOKKOS_FUNCTION index_type n(unsigned int dim) const
Get the size of a dimension.
Definition: KokkosArray.h:211
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:163
Array< T, dimension+1 > const * _data
Pointer to the property data storage.

◆ operator()() [1/2]

template<typename T, unsigned int dimension>
template<typename... index_type>
KOKKOS_FUNCTION T& Moose::Kokkos::MaterialPropertyValue< T, dimension >::operator() ( index_type...  i)
inline

Get the writeable reference of a property value.

Parameters
iThe index of each dimension
Returns
The writeable reference of the property value

Definition at line 91 of file KokkosMaterialPropertyValueDecl.h.

92  {
93  static_assert(sizeof...(i) == dimension,
94  "Number of arguments should match material property dimension");
95 
96  return (*_data)(i..., _idx);
97  }
Array< T, dimension+1 > const * _data
Pointer to the property data storage.
const dof_id_type _idx
Index into the property data storage.

◆ operator()() [2/2]

template<typename T, unsigned int dimension>
template<typename... index_type>
KOKKOS_FUNCTION const T& Moose::Kokkos::MaterialPropertyValue< T, dimension >::operator() ( index_type...  i) const
inline

Get the const reference of a property value.

Parameters
iThe index of each dimension
Returns
The const reference of the property value

Definition at line 104 of file KokkosMaterialPropertyValueDecl.h.

105  {
106  static_assert(sizeof...(i) == dimension,
107  "Number of arguments should match material property dimension");
108 
109  return _data ? (*_data)(i..., _idx) : _value;
110  }
Array< T, dimension+1 > const * _data
Pointer to the property data storage.
const dof_id_type _idx
Index into the property data storage.

◆ usingKokkosMaterialPropertyValueBaseMembers()

template<typename T, unsigned int dimension>
Moose::Kokkos::MaterialPropertyValue< T, dimension >::usingKokkosMaterialPropertyValueBaseMembers ( ,
dimension   
)
private

Member Data Documentation

◆ _data

template<typename T, unsigned int dimension>
Array<T, dimension + 1> const* Moose::Kokkos::MaterialPropertyValueBase< T, dimension >::_data
protectedinherited

◆ _idx

template<typename T, unsigned int dimension>
const dof_id_type Moose::Kokkos::MaterialPropertyValueBase< T, dimension >::_idx
protectedinherited

◆ _value

template<typename T, unsigned int dimension>
const T& Moose::Kokkos::MaterialPropertyValueBase< T, dimension >::_value
protectedinherited

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