27template <
typename T,
unsigned int dimension>
30template <
typename T,
unsigned int dimension>
71 std::unordered_map<SubdomainID, std::vector<unsigned int>>
dims;
108 unsigned int id()
const {
return _id; }
113 const std::string &
name()
const;
118 const std::string &
type()
const;
123 unsigned int dim()
const;
153 const std::set<SubdomainID> & subdomains,
186inline const std::string &
190 mooseError(
"Cannot get the name of an uninitialized or default material property.");
195inline const std::string &
199 mooseError(
"Cannot get the type of an uninitialized or default material property.");
208 mooseError(
"Cannot get the dimension of an uninitialized or default material property.");
216 const unsigned int D =
dim();
221 "-th dimension for the ",
223 "D material property '",
227 return libmesh_map_find(
_record->
dims, subdomain)[i];
230template <
typename T,
unsigned int dimension>
232template <
typename T,
unsigned int dimension>
238template <
typename T,
unsigned int dimension = 0>
266 template <
unsigned int D>
275#ifdef MOOSE_KOKKOS_SCOPE
280 KOKKOS_FUNCTION
operator bool()
const {
return _data.isAlloc() ||
_default; }
289 const unsigned int qp)
const;
299#ifdef MOOSE_KOKKOS_SCOPE
302 const std::set<SubdomainID> & subdomains,
331 friend void propertyStore<T, dimension>(std::ostream &,
void *);
332 friend void propertyLoad<T, dimension>(std::istream &,
void *);
337template <
typename T,
unsigned int dimension>
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
MaterialBases compute MaterialProperties.
Stores the stateful material properties computed by materials.
The Kokkos assembly class.
The Kokkos object that holds thread-private data in the parallel operations of any Kokkos object.
The base class for Kokkos material properties.
const std::string & name() const
Get the property name.
virtual std::type_index propertyType()=0
Get the property type index for load/store functions.
virtual void allocate(const Mesh &mesh, const Assembly &assembly, const std::set< SubdomainID > &subdomains, const bool bnd, StorageKey)=0
Allocate the data storage.
unsigned int dim() const
Get the dimension.
Array< PropertyConstantOption > _constant_option
Whether this property is constant over element or subdomain in each subdomain.
virtual ~MaterialPropertyBase()
Desturctor.
const std::string & type() const
Get the data type.
bool _default
Flag whether this property has a default value.
virtual void swap(MaterialPropertyBase &prop, StorageKey)=0
Swap with another property.
unsigned int dimSize(SubdomainID subdomain, unsigned int i) const
Get the size of a dimension.
const PropRecord * _record
Pointer to the record of this property.
MaterialPropertyBase()=default
Default constructor.
unsigned int _id
Property ID.
virtual void copy(const MaterialPropertyBase &prop, StorageKey)=0
Deep copy another property.
unsigned int id() const
Get the property ID.
virtual void init(const PropRecord &record, const StorageKey &)
Initialize this property.
The Kokkos wrapper class for accessing the material property values of a single quadrature point.
The Kokkos material property class.
virtual void swap(MaterialPropertyBase &prop, StorageKey) override
Swap with another property.
auto & operator=(const MaterialProperty< T, dimension > &property)
Shallow copy another property.
virtual std::type_index propertyType() override
Get the property type index for load/store functions.
MaterialProperty()=default
Default constructor.
void shallowCopy(const MaterialProperty< T, dimension > &property)
Shallow copy another property.
virtual void allocate(const Mesh &mesh, const Assembly &assembly, const std::set< SubdomainID > &subdomains, const bool bnd, StorageKey) override
Allocate the data storage.
virtual void copy(const MaterialPropertyBase &prop, StorageKey) override
Deep copy another property.
const MaterialProperty< T, dimension > * _reference
Pointer to the reference property.
Array< Array< T, dimension+1 > > _data
Data storage.
MaterialProperty(const MaterialProperty< T, D > &other)=delete
Prevent initializing with properties of different rank.
KOKKOS_FUNCTION MaterialPropertyValue< T, dimension > operator()(const Datum &datum, const unsigned int qp) const
Get the property values of a quadrature point.
virtual void init(const PropRecord &record, const StorageKey &key) override
Initialize this property.
std::function< void(std::istream &, void *)> PropertyLoad
void propertyLoad(std::istream &stream, void *prop)
std::function< void(std::ostream &, void *)> PropertyStore
PropertyConstantOption
Property constant options.
void propertyStore(std::ostream &stream, void *prop)
const unsigned int invalid_uint
The type trait that determines the default behavior of copy constructor and deepCopy() If this type t...
static constexpr bool value
A structure storing the metadata of Kokkos material properties.
std::set< const ::MaterialBase * > declarers
List of declaring materials.
bool bnd
Flag whether this property is a face property.
std::unordered_map< SubdomainID, std::vector< unsigned int > > dims
Size of each dimension of each subdomain.
std::unordered_map< SubdomainID, PropertyConstantOption > constant_option
Whether this property is constant over element or subdomain in each subdomain.
std::string name
Property name.
bool on_demand
Flag whether this property is an on-demand property.
std::string type
Demangled data type name.