77 template <
typename T,
unsigned int dimension = 0>
79 const std::vector<unsigned int> & dims = {});
88 template <
typename T,
unsigned int dimension = 0>
91 const std::vector<unsigned int> & dims = {});
100 template <
typename T,
unsigned int dimension = 0>
103 const std::vector<unsigned int> & dims = {})
105 return declareKokkosPropertyInternal<T, dimension>(prop_name, dims,
false);
116 template <
typename T,
unsigned int dimension = 0>
119 const std::vector<unsigned int> & dims = {})
121 return declareKokkosPropertyInternal<T, dimension>(prop_name, dims,
true);
207 template <
typename T,
unsigned int dimension>
209 const std::string & prop_name,
const std::vector<unsigned int> & dims,
const bool on_demand);
222 template <
typename T,
unsigned int dimension>
225 const std::vector<unsigned int> & dims)
227 std::string prop_name =
name;
231 return declareKokkosPropertyByName<T, dimension>(prop_name, dims);
234 template <
typename T,
unsigned int dimension>
237 const std::vector<unsigned int> & dims)
239 std::string prop_name =
name;
243 return declareKokkosOnDemandPropertyByName<T, dimension>(prop_name, dims);
246 template <
typename T,
unsigned int dimension>
249 const std::vector<unsigned int> & dims,
250 const bool on_demand)
252 if (dims.size() != dimension)
253 mooseError(
"The declared Kokkos material property '",
255 "'\nhas a different dimension (",
257 ") with the provided dimension (",
261 const auto prop_name_modified =
264 : MooseUtils::join(std::vector<std::string>({prop_name,
_declare_suffix}),
"_");
const MaterialPropertyName _declare_suffix
Suffix to append to the name of the material property/ies when declaring it/them. ...
Scalar< int > _t_step
The number of the time step.
const InputParameters & _pars
The object's parameters.
dof_id_type ContiguousElementID
const InputParameters & parameters() const
Get the parameters of the object.
virtual void computeQpProperties() override final
Users must override this method.
MaterialProperty< T, dimension > declareKokkosPropertyByName(const std::string &prop_name, const std::vector< unsigned int > &dims={})
Declare a material property by property name.
KOKKOS_FUNCTION dof_id_type numKokkosElementSides() const
Get the number of sides this material is operating on for face material property evaluation.
const PropertyConstantOption _constant_option
Whether the properties declared by this material are constant over element or subdomain.
KOKKOS_FUNCTION ContiguousElementID kokkosElementID(ThreadID tid) const
Get the contiguous element ID for a thread.
The Kokkos interface that holds the host reference of the Kokkos systems and copies it to device duri...
The Kokkos interface that holds the host reference of the Kokkos mesh and copies it to device during ...
std::unique_ptr< DispatcherBase > _init_dispatcher
Kokkos functor dispatchers.
MaterialBase(const InputParameters ¶meters)
Constructor.
Moose::Kokkos::MaterialProperty< T, dimension > declareKokkosProperty(const std::string &prop_name, const std::vector< unsigned int > &dims, const MaterialBase *declarer, const bool bnd, const bool on_demand, const Moose::Kokkos::PropertyConstantOption constant_option)
Declare a Kokkos material property.
MOOSE_KOKKOS_INDEX_TYPE ThreadID
const std::string & name() const
Get the name of the class.
PropertyConstantOption
Property constant options.
static InputParameters validParams()
void initializeMaterialRestrictable()
Setup block and boundary restrictions for material.
KOKKOS_FUNCTION auto kokkosElementSideID(ThreadID tid) const
Get the contiguous element ID - side index pair for a thread.
The Kokkos interface that holds the host reference of the Kokkos assembly and copies it to device dur...
Array< ContiguousElementID > _element_ids
Contiguous element IDs this material operates on for element material property evaluation.
KOKKOS_FUNCTION index_type size() const
Get the total array size.
Scalar< Real > _t
TODO: Move to TransientInterface.
Scalar< Real > _dt_old
Size of the old time step.
virtual void subdomainSetup() override final
Subdomain setup evaluating material properties when required.
Scalar< Real > _dt
Time step size.
KOKKOS_FUNCTION dof_id_type numKokkosElements() const
Get the number of elements this material operates on for element material property evaluation...
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
MaterialProperty< T, dimension > declareKokkosProperty(const std::string &name, const std::vector< unsigned int > &dims={})
Declare a material property.
Array< Pair< ContiguousElementID, unsigned int > > _element_side_ids
Contiguous element ID - side index pairs this material operates on for face material property evaluat...
Scalar< const Real > _t_old
Old time.
void registerPropName(const std::string &prop_name, bool is_get, const unsigned int state)
Small helper function to call store{Subdomain,Boundary}MatPropName.
MaterialProperty< T, dimension > declareKokkosOnDemandPropertyByName(const std::string &prop_name, const std::vector< unsigned int > &dims={})
Declare an on-demand material property by property name The on-demand property is only allocated when...
The Kokkos material property class.
The base class for Kokkos materials.
virtual const MaterialData & materialData() const =0
virtual bool isBoundaryMaterial() const =0
Returns true of the MaterialData type is not associated with volume data.
std::unique_ptr< DispatcherBase > _compute_dispatcher
MaterialProperty< T, dimension > declareKokkosOnDemandProperty(const std::string &name, const std::vector< unsigned int > &dims={})
Declare an on-demand material property.
MaterialProperty< T, dimension > declareKokkosPropertyInternal(const std::string &prop_name, const std::vector< unsigned int > &dims, const bool on_demand)
Internal method for declaring a material property.
virtual void initQpStatefulProperties() override final
Initialize stateful properties at quadrature points.