https://mooseframework.inl.gov
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  : public Moose::Kokkos::Material<KokkosGenericConstantMaterial>
14 {
15 public:
17 
19 
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 
29 protected:
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 Kokkos object that holds thread-private data in the parallel operations of any Kokkos object...
Definition: KokkosDatum.h:25
const std::vector< std::string > & _prop_names
Moose::Kokkos::Array< Moose::Kokkos::MaterialProperty< Real > > _props
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
KOKKOS_FUNCTION void computeQpProperties(const unsigned int qp, Datum &datum) const
The base class for a user to derive their own Kokkos materials.
const Moose::Kokkos::Array< Real > _prop_values
KokkosGenericConstantMaterial(const InputParameters &parameters)
static InputParameters validParams()