LCOV - code coverage report
Current view: top level - src/kokkos/nodalkernels - KokkosBoundNodalKernel.K (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 16 18 88.9 %
Date: 2026-05-29 20:35:17 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          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             : #include "KokkosBoundNodalKernel.h"
      11             : 
      12             : InputParameters
      13        4436 : KokkosBoundNodalKernel::validParams()
      14             : {
      15        4436 :   InputParameters params = NodalKernel::validParams();
      16       17744 :   params.addRequiredCoupledVar(
      17             :       "v", "The coupled variable we require to be greater than the lower bound");
      18       13308 :   params.addParam<std::vector<BoundaryName>>(
      19             :       "exclude_boundaries",
      20             :       {},
      21             :       "Boundaries on which not to execute the nodal kernel. This can be useful for avoiding "
      22             :       "singuarility in the matrix in case a constraint is active in the same place that a "
      23             :       "Dirichlet BC is set");
      24        4436 :   return params;
      25           0 : }
      26             : 
      27         344 : KokkosBoundNodalKernel::KokkosBoundNodalKernel(const InputParameters & parameters)
      28         320 :   : NodalKernel(parameters), _v_var(coupled("v")), _v(kokkosCoupledNodalValue("v"))
      29             : {
      30         120 :   if (_var.number() == _v_var)
      31           0 :     paramError("v", "Coupled variable needs to be different from 'variable'");
      32         120 : }
      33             : 
      34             : void
      35         120 : KokkosBoundNodalKernel::initialSetup()
      36             : {
      37         120 :   std::set<ContiguousBoundaryID> bnd_ids;
      38             : 
      39         240 :   const auto & bnd_names = getParam<std::vector<BoundaryName>>("exclude_boundaries");
      40         360 :   for (const auto & bnd_id : _mesh.getBoundaryIDs(bnd_names))
      41         360 :     bnd_ids.insert(kokkosMesh().getContiguousBoundaryID(bnd_id));
      42             : 
      43         120 :   _bnd_ids = bnd_ids;
      44         120 : }

Generated by: LCOV version 1.14