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 "KokkosKernelValue.h" 13 : 14 : class KokkosBodyForce : public Moose::Kokkos::KernelValue 15 : { 16 : public: 17 : static InputParameters validParams(); 18 : 19 : KokkosBodyForce(const InputParameters & parameters); 20 : 21 : template <typename Derived> 22 : KOKKOS_FUNCTION Real computeQpResidual(const unsigned int, AssemblyDatum &) const; 23 : 24 : protected: 25 : /// Scale factor 26 : const Moose::Kokkos::Scalar<const Real> _scale; 27 : 28 : /// Optional Postprocessor value 29 : const Moose::Kokkos::PostprocessorValue _postprocessor; 30 : }; 31 : 32 : template <typename Derived> 33 : KOKKOS_FUNCTION Real 34 1123616 : KokkosBodyForce::computeQpResidual(const unsigned int, AssemblyDatum &) const 35 : { 36 1123616 : return -_scale * _postprocessor; 37 : }