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... | |
| template<unsigned int D> | |
| MaterialProperty (const MaterialProperty< T, D > &other)=delete | |
| Prevent initializing with properties of different rank. More... | |
| auto & | operator= (const MaterialProperty< T, dimension > &property) |
| Shallow copy another property. More... | |
| KOKKOS_FUNCTION | operator bool () const |
| Get whether this property is valid. 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 Mesh &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... | |
| const std::string & | name () const |
| Get the property name. More... | |
| const std::string & | type () const |
| Get the data type. More... | |
| unsigned int | dim () const |
| Get the dimension. More... | |
| unsigned int | dimSize (SubdomainID subdomain, unsigned int i) const |
| Get the size of a dimension. 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... | |
| Array< PropertyConstantOption > | _constant_option |
| Whether this property is constant over element or subdomain in each subdomain. 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 239 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 32 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 39 of file KokkosMaterialProperty.h.
|
delete |
Prevent initializing with properties of different rank.
|
overridevirtual |
Allocate the data storage.
| mesh | The Kokkos 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 111 of file KokkosMaterialProperty.h.
|
overridevirtual |
Deep copy another property.
| prop | The property to copy |
Implements Moose::Kokkos::MaterialPropertyBase.
Definition at line 71 of file KokkosMaterialProperty.h.
|
inlineinherited |
Get the dimension.
Definition at line 205 of file KokkosMaterialPropertyDecl.h.
Referenced by Moose::Kokkos::MaterialPropertyBase::dimSize().
|
inlineinherited |
Get the size of a dimension.
| subdomain | The MOOSE subdomain ID |
| i | The dimension index |
Definition at line 214 of file KokkosMaterialPropertyDecl.h.
|
inlineinherited |
Get the property ID.
Definition at line 108 of file KokkosMaterialPropertyDecl.h.
|
overridevirtual |
Initialize this property.
| record | The record of this property |
Reimplemented from Moose::Kokkos::MaterialPropertyBase.
Definition at line 61 of file KokkosMaterialProperty.h.
|
inlineinherited |
Get the property name.
Definition at line 187 of file KokkosMaterialPropertyDecl.h.
Referenced by Moose::Kokkos::MaterialPropertyBase::dimSize().
|
inline |
Get whether this property is valid.
Definition at line 280 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 158 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 52 of file KokkosMaterialProperty.h.
|
inlineoverridevirtual |
Get the property type index for load/store functions.
Implements Moose::Kokkos::MaterialPropertyBase.
Definition at line 292 of file KokkosMaterialPropertyDecl.h.
|
private |
Shallow copy another property.
| property | The property to be shallow copied |
Definition at line 97 of file KokkosMaterialProperty.h.
|
overridevirtual |
Swap with another property.
| prop | The property to swap |
Implements Moose::Kokkos::MaterialPropertyBase.
Definition at line 86 of file KokkosMaterialProperty.h.
|
inlineinherited |
Get the data type.
Definition at line 196 of file KokkosMaterialPropertyDecl.h.
Referenced by Moose::Kokkos::MaterialProperty< Real >::propertyType().
|
friend |
Definition at line 331 of file KokkosMaterialPropertyDecl.h.
|
friend |
Definition at line 174 of file KokkosMaterialProperty.h.
|
friend |
Definition at line 166 of file KokkosMaterialProperty.h.
|
protectedinherited |
Whether this property is constant over element or subdomain in each subdomain.
Definition at line 183 of file KokkosMaterialPropertyDecl.h.
|
private |
Data storage.
Definition at line 325 of file KokkosMaterialPropertyDecl.h.
Referenced by Moose::Kokkos::MaterialProperty< Real >::operator bool().
|
protectedinherited |
Flag whether this property has a default value.
Definition at line 179 of file KokkosMaterialPropertyDecl.h.
Referenced by Moose::Kokkos::MaterialProperty< Real >::operator bool().
|
protectedinherited |
Property ID.
Definition at line 175 of file KokkosMaterialPropertyDecl.h.
Referenced by Moose::Kokkos::MaterialPropertyBase::id(), and Moose::Kokkos::MaterialPropertyBase::init().
|
protectedinherited |
Pointer to the record of this property.
Definition at line 171 of file KokkosMaterialPropertyDecl.h.
Referenced by Moose::Kokkos::MaterialPropertyBase::dim(), Moose::Kokkos::MaterialPropertyBase::dimSize(), Moose::Kokkos::MaterialPropertyBase::init(), Moose::Kokkos::MaterialPropertyBase::name(), and Moose::Kokkos::MaterialPropertyBase::type().
|
private |
Pointer to the reference property.
Definition at line 321 of file KokkosMaterialPropertyDecl.h.
|
private |
Default value.
Definition at line 329 of file KokkosMaterialPropertyDecl.h.
1.8.14