The Kokkos material property class. More...
#include <KokkosMaterialPropertyDecl.h>
Public Member Functions | |
MaterialProperty ()=default | |
Default constructor. More... | |
MaterialProperty (const T &value) | |
Constructor for default property. More... | |
MaterialProperty (const MaterialProperty< T, dimension > &property) | |
Copy constructor The reference material properties are held by the material property storage, and the user deals with the clones of them. More... | |
auto & | operator= (const MaterialProperty< T, dimension > &property) |
Shallow copy another property. More... | |
KOKKOS_FUNCTION MaterialPropertyValue< T, dimension > | operator() (const Datum &datum, const unsigned int qp) const |
Get the property values of a quadrature point. More... | |
virtual std::type_index | propertyType () override |
Get the property type index for load/store functions. More... | |
virtual void | init (const PropRecord &record, const StorageKey &key) override |
Initialize this property. More... | |
virtual void | allocate (const MooseMesh &mesh, const Assembly &assembly, const std::set< SubdomainID > &subdomains, const bool bnd, StorageKey) override |
Allocate the data storage. More... | |
virtual void | copy (const MaterialPropertyBase &prop, StorageKey) override |
Deep copy another property. More... | |
virtual void | swap (MaterialPropertyBase &prop, StorageKey) override |
Swap with another property. More... | |
unsigned int | id () const |
Get the property ID. More... | |
std::string | name () const |
Get the property name. More... | |
std::string | type () const |
Get the data type. More... | |
unsigned int | dim () const |
Get the dimension. More... | |
unsigned int | dim (unsigned int i) const |
Get the size of a dimension. More... | |
KOKKOS_FUNCTION | operator bool () const |
Get whether this property is valid. More... | |
Protected Attributes | |
const PropRecord * | _record = nullptr |
Pointer to the record of this property. More... | |
unsigned int | _id = libMesh::invalid_uint |
Property ID. More... | |
bool | _default = false |
Flag whether this property has a default value. More... | |
Private Member Functions | |
void | shallowCopy (const MaterialProperty< T, dimension > &property) |
Shallow copy another property. More... | |
Private Attributes | |
const MaterialProperty< T, dimension > * | _reference = nullptr |
Pointer to the reference property. More... | |
Array< Array< T, dimension+1 > > | _data |
Data storage. More... | |
T | _value |
Default value. More... | |
Friends | |
class | MaterialPropertyValueBase< T, dimension > |
void | propertyStore (std::ostream &, void *) |
void | propertyLoad (std::istream &, void *) |
The Kokkos material property class.
Definition at line 194 of file KokkosMaterialPropertyDecl.h.
|
default |
Default constructor.
MaterialProperty< T, dimension >::MaterialProperty | ( | const T & | value | ) |
Constructor for default property.
value | The default value |
Definition at line 35 of file KokkosMaterialProperty.h.
MaterialProperty< T, dimension >::MaterialProperty | ( | const MaterialProperty< T, dimension > & | property | ) |
Copy constructor The reference material properties are held by the material property storage, and the user deals with the clones of them.
The reference material properties also hold the arrays for storing the property values (_data), and the user accesses the arrays through their shallow copies in the clones. As a result, if the reference material properties reallocate their arrays, the shallow copies of arrays in the clones will lose synchronization. Thus, the clones also hold the pointers to their reference material properties and shallow copy them in the copy constructor, so that the arrays are always synchronized with those in the reference material properties during parallel dispatch.
Definition at line 42 of file KokkosMaterialProperty.h.
|
overridevirtual |
Allocate the data storage.
mesh | The MOOSE mesh |
assembly | The Kokkos assembly |
subdomains | The MOOSE subdomain IDs |
bnd | Whether this property is a face property |
Implements Moose::Kokkos::MaterialPropertyBase.
Definition at line 113 of file KokkosMaterialProperty.h.
|
overridevirtual |
Deep copy another property.
prop | The property to copy |
Implements Moose::Kokkos::MaterialPropertyBase.
Definition at line 74 of file KokkosMaterialProperty.h.
|
inlineinherited |
Get the dimension.
Definition at line 107 of file KokkosMaterialPropertyDecl.h.
Referenced by Moose::Kokkos::MaterialPropertyBase::dim().
Get the size of a dimension.
i | The dimension index |
Definition at line 113 of file KokkosMaterialPropertyDecl.h.
|
inlineinherited |
Get the property ID.
Definition at line 92 of file KokkosMaterialPropertyDecl.h.
|
overridevirtual |
Initialize this property.
record | The record of this property |
Reimplemented from Moose::Kokkos::MaterialPropertyBase.
Definition at line 64 of file KokkosMaterialProperty.h.
|
inlineinherited |
Get the property name.
Definition at line 97 of file KokkosMaterialPropertyDecl.h.
Referenced by Moose::Kokkos::MaterialPropertyBase::dim().
|
inlineinherited |
Get whether this property is valid.
Definition at line 167 of file KokkosMaterialPropertyDecl.h.
KOKKOS_FUNCTION MaterialPropertyValue< T, dimension > MaterialProperty< T, dimension >::operator() | ( | const Datum & | datum, |
const unsigned int | qp | ||
) | const |
Get the property values of a quadrature point.
datum | The Datum object of the current thread |
qp | The local quadrature point index |
Definition at line 142 of file KokkosMaterialProperty.h.
auto & MaterialProperty< T, dimension >::operator= | ( | const MaterialProperty< T, dimension > & | property | ) |
Shallow copy another property.
property | The property to be shallow copied |
Definition at line 55 of file KokkosMaterialProperty.h.
|
inlineoverridevirtual |
Get the property type index for load/store functions.
Implements Moose::Kokkos::MaterialPropertyBase.
Definition at line 236 of file KokkosMaterialPropertyDecl.h.
|
private |
Shallow copy another property.
property | The property to be shallow copied |
Definition at line 100 of file KokkosMaterialProperty.h.
|
overridevirtual |
Swap with another property.
prop | The property to swap |
Implements Moose::Kokkos::MaterialPropertyBase.
Definition at line 89 of file KokkosMaterialProperty.h.
|
inlineinherited |
Get the data type.
Definition at line 102 of file KokkosMaterialPropertyDecl.h.
Referenced by Moose::Kokkos::MaterialProperty< T, dimension >::propertyType().
|
friend |
Definition at line 275 of file KokkosMaterialPropertyDecl.h.
|
friend |
Definition at line 158 of file KokkosMaterialProperty.h.
|
friend |
Definition at line 150 of file KokkosMaterialProperty.h.
|
private |
Data storage.
Definition at line 269 of file KokkosMaterialPropertyDecl.h.
|
protectedinherited |
Flag whether this property has a default value.
Definition at line 182 of file KokkosMaterialPropertyDecl.h.
Referenced by Moose::Kokkos::MaterialPropertyBase::operator bool().
|
protectedinherited |
Property ID.
Definition at line 178 of file KokkosMaterialPropertyDecl.h.
Referenced by Moose::Kokkos::MaterialPropertyBase::id(), Moose::Kokkos::MaterialPropertyBase::init(), and Moose::Kokkos::MaterialPropertyBase::operator bool().
|
protectedinherited |
Pointer to the record of this property.
Definition at line 174 of file KokkosMaterialPropertyDecl.h.
Referenced by Moose::Kokkos::MaterialPropertyBase::dim(), Moose::Kokkos::MaterialPropertyBase::init(), Moose::Kokkos::MaterialPropertyBase::name(), and Moose::Kokkos::MaterialPropertyBase::type().
|
private |
Pointer to the reference property.
Definition at line 265 of file KokkosMaterialPropertyDecl.h.
|
private |
Default value.
Definition at line 273 of file KokkosMaterialPropertyDecl.h.