78 template <
typename T,
unsigned int dimension = 0>
80 const std::vector<unsigned int> & dims = {});
89 template <
typename T,
unsigned int dimension = 0>
92 const std::vector<unsigned int> & dims = {});
101 template <
typename T,
unsigned int dimension = 0>
104 const std::vector<unsigned int> & dims = {})
106 return declareKokkosPropertyInternal<T, dimension>(prop_name, dims,
false);
117 template <
typename T,
unsigned int dimension = 0>
120 const std::vector<unsigned int> & dims = {})
122 return declareKokkosPropertyInternal<T, dimension>(prop_name, dims,
true);
208 template <
typename T,
unsigned int dimension>
210 const std::string & prop_name,
const std::vector<unsigned int> & dims,
const bool on_demand);
223template <
typename T,
unsigned int dimension>
226 const std::vector<unsigned int> & dims)
228 std::string prop_name =
name;
232 return declareKokkosPropertyByName<T, dimension>(prop_name, dims);
235template <
typename T,
unsigned int dimension>
238 const std::vector<unsigned int> & dims)
240 std::string prop_name =
name;
244 return declareKokkosOnDemandPropertyByName<T, dimension>(prop_name, dims);
247template <
typename T,
unsigned int dimension>
250 const std::vector<unsigned int> & dims,
251 const bool on_demand)
253 if (dims.size() != dimension)
254 mooseError(
"The declared Kokkos material property '",
256 "'\nhas a different dimension (",
258 ") with the provided dimension (",
262 const auto prop_name_modified =
265 : MooseUtils::join(std::vector<std::string>({prop_name,
_declare_suffix}),
"_");
dof_id_type ContiguousElementID
MaterialBases compute MaterialProperties.
const MaterialPropertyName _declare_suffix
Suffix to append to the name of the material property/ies when declaring it/them.
virtual const MaterialData & materialData() const =0
void registerPropName(const std::string &prop_name, bool is_get, const unsigned int state)
Small helper function to call store{Subdomain,Boundary}MatPropName.
virtual bool isBoundaryMaterial() const =0
Returns true of the MaterialData type is not associated with volume data.
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.
const InputParameters & parameters() const
Get the parameters of the object.
const std::string & name() const
Get the name of the class.
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...
const InputParameters & _pars
The object's parameters.
KOKKOS_FUNCTION index_type size() const
Get the total array size.
The Kokkos interface that holds the host reference of the Kokkos assembly and copies it to device dur...
The base class for Kokkos materials.
Array< ContiguousElementID > _element_ids
Contiguous element IDs this material operates on for element material property evaluation.
std::unique_ptr< DispatcherBase > _init_dispatcher
Kokkos functor dispatchers.
static InputParameters validParams()
KOKKOS_FUNCTION dof_id_type numKokkosElementSides() const
Get the number of sides this material is operating on for face material property evaluation.
KOKKOS_FUNCTION auto kokkosElementSideID(ThreadID tid) const
Get the contiguous element ID - side index pair for a thread.
Scalar< Real > _dt_old
Size of the old time step.
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.
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...
Scalar< Real > _t
TODO: Move to TransientInterface.
virtual void subdomainSetup() override final
Subdomain setup evaluating material properties when required.
MaterialBase(const InputParameters ¶meters)
Constructor.
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.
std::unique_ptr< DispatcherBase > _compute_dispatcher
KOKKOS_FUNCTION ContiguousElementID kokkosElementID(ThreadID tid) const
Get the contiguous element ID for a thread.
MaterialBase(const MaterialBase &object)
Copy constructor for parallel dispatch.
Scalar< int > _t_step
The number of the time step.
Array< Pair< ContiguousElementID, unsigned int > > _element_side_ids
Contiguous element ID - side index pairs this material operates on for face material property evaluat...
Scalar< Real > _dt
Time step size.
MaterialProperty< T, dimension > declareKokkosProperty(const std::string &name, const std::vector< unsigned int > &dims={})
Declare a material property.
KOKKOS_FUNCTION dof_id_type numKokkosElements() const
Get the number of elements this material operates on for element material property evaluation.
MaterialProperty< T, dimension > declareKokkosOnDemandProperty(const std::string &name, const std::vector< unsigned int > &dims={})
Declare an on-demand material property.
Scalar< const Real > _t_old
Old time.
void initializeMaterialRestrictable()
Setup block and boundary restrictions for material.
const PropertyConstantOption _constant_option
Whether the properties declared by this material are constant over element or subdomain.
virtual void initQpStatefulProperties() override final
Initialize stateful properties at quadrature points.
The Kokkos material property class.
The Kokkos interface that holds the host reference of the Kokkos mesh and copies it to device during ...
The Kokkos wrapper class that can hold the reference of an arithmetic scalar variable.
PropertyConstantOption
Property constant options.
MOOSE_KOKKOS_INDEX_TYPE ThreadID