Line data Source code
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 : 12 : #include "KokkosAuxKernel.h" 13 : 14 : class KokkosMaterialRealAux : public Moose::Kokkos::AuxKernel 15 : { 16 : public: 17 : static InputParameters validParams(); 18 : 19 : /** 20 : * Class constructor 21 : * @param parameters The input parameters for this object 22 : */ 23 : KokkosMaterialRealAux(const InputParameters & parameters); 24 : 25 : KOKKOS_FUNCTION Real computeValue(const unsigned int qp, AssemblyDatum & datum) const; 26 : 27 : private: 28 : /// Material property for this AuxKernel 29 : const Moose::Kokkos::MaterialProperty<Real> _prop; 30 : 31 : /// Multiplier for the material property 32 : const Real _factor; 33 : 34 : /// Value to be added to the material property 35 : const Real _offset; 36 : }; 37 : 38 : KOKKOS_FUNCTION inline Real 39 1813608 : KokkosMaterialRealAux::computeValue(const unsigned int qp, AssemblyDatum & datum) const 40 : { 41 1813608 : return _prop(datum, qp) * _factor + _offset; 42 : }