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

#include <KokkosMaterialPropertyValueDecl.h>

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

Public Member Functions

KOKKOS_FUNCTION MaterialPropertyValue (const MaterialProperty< T, 0 > &property, const Datum &datum, const unsigned int qp)
 Constructor. More...
 
KOKKOS_FUNCTION operator const T & () const
 Get the const reference of a property value. More...
 
KOKKOS_FUNCTION auto & operator= (const T &value)
 Assign a value to the underlying property. More...
 
KOKKOS_FUNCTION auto & operator= (const MaterialPropertyValue< T, 0 > &value)
 Copy a value from another property. 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, 0)
 

Detailed Description

template<typename T>
class Moose::Kokkos::MaterialPropertyValue< T, 0 >

Definition at line 114 of file KokkosMaterialPropertyValueDecl.h.

Constructor & Destructor Documentation

◆ MaterialPropertyValue()

template<typename T >
KOKKOS_FUNCTION Moose::Kokkos::MaterialPropertyValue< T, 0 >::MaterialPropertyValue ( const MaterialProperty< T, 0 > &  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 40 of file KokkosMaterialPropertyValue.h.

43  : MaterialPropertyValueBase<T, 0>(property, datum, qp)
44 {
45 }

Member Function Documentation

◆ n()

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 const T &()

template<typename T >
KOKKOS_FUNCTION Moose::Kokkos::MaterialPropertyValue< T, 0 >::operator const T & ( ) const
inline

Get the const reference of a property value.

Returns
The const reference of the property value

Definition at line 134 of file KokkosMaterialPropertyValueDecl.h.

134 { return _data ? (*_data)(_idx) : _value; }
Array< T, dimension+1 > const * _data
Pointer to the property data storage.
const dof_id_type _idx
Index into the property data storage.

◆ operator=() [1/2]

template<typename T >
KOKKOS_FUNCTION auto & Moose::Kokkos::MaterialPropertyValue< T, 0 >::operator= ( const T &  value)

Assign a value to the underlying property.

Parameters
valueThe value to assign

Definition at line 49 of file KokkosMaterialPropertyValue.h.

50 {
51  (*_data)(_idx) = value;
52 
53  return *this;
54 }
const dof_id_type _idx
Index into the property data storage.

◆ operator=() [2/2]

template<typename T >
KOKKOS_FUNCTION auto & Moose::Kokkos::MaterialPropertyValue< T, 0 >::operator= ( const MaterialPropertyValue< T, 0 > &  value)

Copy a value from another property.

Parameters
valueThe property to copy

Definition at line 58 of file KokkosMaterialPropertyValue.h.

59 {
60  (*_data)(_idx) = static_cast<T>(value);
61 
62  return *this;
63 }
const dof_id_type _idx
Index into the property data storage.

◆ usingKokkosMaterialPropertyValueBaseMembers()

template<typename T >
Moose::Kokkos::MaterialPropertyValue< T, 0 >::usingKokkosMaterialPropertyValueBaseMembers ( ,
 
)
private

Member Data Documentation

◆ _data

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

Pointer to the property data storage.

Definition at line 62 of file KokkosMaterialPropertyValueDecl.h.

◆ _idx

const dof_id_type Moose::Kokkos::MaterialPropertyValueBase< T, dimension >::_idx
protectedinherited

Index into the property data storage.

Definition at line 58 of file KokkosMaterialPropertyValueDecl.h.

◆ _value

const T& Moose::Kokkos::MaterialPropertyValueBase< T, dimension >::_value
protectedinherited

Default value.

Definition at line 66 of file KokkosMaterialPropertyValueDecl.h.


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