LCOV - code coverage report
Current view: top level - include/kokkos/bcs - KokkosDirichletBC.h (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31706 (f8ed4a) with base bb0a08 Lines: 10 11 90.9 %
Date: 2025-11-03 17:23:24 Functions: 6 6 100.0 %
Legend: Lines: hit not hit

          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      288026 :   KOKKOS_FUNCTION Real computeValue(const unsigned int /* qp */, AssemblyDatum & /* datum */) const
      25             :   {
      26      288026 :     return _value;
      27             :   }
      28             : 
      29             : protected:
      30             :   const Moose::Kokkos::Scalar<const Real> _value;
      31             : };
      32             : 
      33             : template <typename DirichletBC>
      34             : InputParameters
      35       20898 : KokkosDirichletBC<DirichletBC>::validParams()
      36             : {
      37       20898 :   InputParameters params = Moose::Kokkos::DirichletBCBase<DirichletBC>::validParams();
      38       62694 :   params.addRequiredParam<Real>("value", "Value of the BC");
      39       62694 :   params.declareControllable("value");
      40       20898 :   return params;
      41           0 : }
      42             : 
      43             : template <typename DirichletBC>
      44        1502 : KokkosDirichletBC<DirichletBC>::KokkosDirichletBC(const InputParameters & parameters)
      45             :   : Moose::Kokkos::DirichletBCBase<DirichletBC>(parameters),
      46        1848 :     _value(this->template getParam<Real>("value"))
      47             : {
      48        1213 : }
      49             : 
      50             : class KokkosDirichletBCWrapper final : public KokkosDirichletBC<KokkosDirichletBCWrapper>
      51             : {
      52             : public:
      53             :   static InputParameters validParams();
      54             : 
      55             :   KokkosDirichletBCWrapper(const InputParameters & parameters);
      56             : };

Generated by: LCOV version 1.14