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 {
14 public:
16 
18 
19  KOKKOS_FUNCTION void computeQpProperties(const unsigned int qp, Datum & datum) const
20  {
21  for (unsigned int i = 0; i < _num_props; ++i)
22  {
23  auto prop = _props[i](datum, qp);
24  prop = _prop_values[i];
25  }
26  }
27 
28 protected:
29  // Material property names
30  const std::vector<std::string> & _prop_names;
31  // GPU-accessible array of property values
33  // GPU-accessible array of Kokkos material properties
35  // Number of properties
36  const unsigned int _num_props;
37 };
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()