https://mooseframework.inl.gov
Loading...
Searching...
No Matches
KokkosGenericConstantMaterial.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://www.mooseframework.org
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#include "KokkosMaterial.h"
11
13{
14public:
16
18
19 template <typename Derived>
20 KOKKOS_FUNCTION void computeQpProperties(const unsigned int qp, Datum & datum) const
21 {
22 for (unsigned int i = 0; i < _num_props; ++i)
23 {
24 auto prop = _props[i](datum, qp);
25 prop = _prop_values[i];
26 }
27 }
28
29protected:
30 // Material property names
31 const std::vector<std::string> & _prop_names;
32 // GPU-accessible array of property values
34 // GPU-accessible array of Kokkos material properties
36 // Number of properties
37 const unsigned int _num_props;
38};
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const Moose::Kokkos::Array< Real > _prop_values
const std::vector< std::string > & _prop_names
Moose::Kokkos::Array< Moose::Kokkos::MaterialProperty< Real > > _props
static InputParameters validParams()
KokkosGenericConstantMaterial(const InputParameters &parameters)
KOKKOS_FUNCTION void computeQpProperties(const unsigned int qp, Datum &datum) const
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
The Kokkos array class.
The Kokkos object that holds thread-private data in the parallel operations of any Kokkos object.
The base class for a user to derive their own Kokkos materials.