https://mooseframework.inl.gov
Loading...
Searching...
No Matches
KokkosIntegralMaterialProperty.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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#pragma once
11
13
14template <typename Base>
16{
17public:
19
21
22 KOKKOS_FUNCTION Real computeQpIntegral(const unsigned int qp, Datum & datum) const;
23
24protected:
26};
27
28template <typename Base>
31{
32 InputParameters params = Base::validParams();
33 params.addRequiredParam<MaterialPropertyName>("mat_prop", "The name of the material property");
34 params.addClassDescription("Compute the integral of the material property over the domain");
35 return params;
36}
37
38template <typename Base>
40 const InputParameters & parameters)
41 : Base(parameters), _scalar(Base::template getKokkosMaterialProperty<Real>("mat_prop"))
42{
43}
44
45template <typename Base>
46KOKKOS_FUNCTION Real
48{
49 return _scalar(datum, qp);
50}
51
KokkosIntegralMaterialProperty< KokkosElementIntegralPostprocessor > KokkosElementIntegralMaterialProperty
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
const Moose::Kokkos::MaterialProperty< Real > _scalar
KokkosIntegralMaterialProperty(const InputParameters &parameters)
KOKKOS_FUNCTION Real computeQpIntegral(const unsigned int qp, Datum &datum) const
The Kokkos object that holds thread-private data in the parallel operations of any Kokkos object.
The Kokkos material property class.