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