Line data Source code
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 : #pragma once 11 : 12 : #include "KokkosDirichletBCBase.h" 13 : 14 : template <typename DirichletBC> 15 : class KokkosDirichletBC : public Moose::Kokkos::DirichletBCBase<DirichletBC> 16 : { 17 : usingKokkosDirichletBCBaseMembers(DirichletBC); 18 : 19 : public: 20 : static InputParameters validParams(); 21 : 22 : KokkosDirichletBC(const InputParameters & parameters); 23 : 24 353410 : KOKKOS_FUNCTION Real computeValue(const unsigned int /* qp */, AssemblyDatum & /* datum */) const 25 : { 26 353410 : return _value; 27 : } 28 : 29 : protected: 30 : const Moose::Kokkos::Scalar<const Real> _value; 31 : }; 32 : 33 : template <typename DirichletBC> 34 : InputParameters 35 21274 : KokkosDirichletBC<DirichletBC>::validParams() 36 : { 37 21274 : InputParameters params = Moose::Kokkos::DirichletBCBase<DirichletBC>::validParams(); 38 63822 : params.addRequiredParam<Real>("value", "Value of the BC"); 39 63822 : params.declareControllable("value"); 40 21274 : return params; 41 0 : } 42 : 43 : template <typename DirichletBC> 44 1573 : KokkosDirichletBC<DirichletBC>::KokkosDirichletBC(const InputParameters & parameters) 45 : : Moose::Kokkos::DirichletBCBase<DirichletBC>(parameters), 46 1978 : _value(this->template getParam<Real>("value")) 47 : { 48 1281 : } 49 : 50 : class KokkosDirichletBCWrapper final : public KokkosDirichletBC<KokkosDirichletBCWrapper> 51 : { 52 : public: 53 : static InputParameters validParams(); 54 : 55 : KokkosDirichletBCWrapper(const InputParameters & parameters); 56 : };