LCOV - code coverage report
Current view: top level - src/kokkos/bcs - KokkosNodalBC.K (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31706 (f8ed4a) with base bb0a08 Lines: 25 25 100.0 %
Date: 2025-11-03 17:23:24 Functions: 4 4 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             : #include "KokkosNodalBC.h"
      11             : 
      12             : namespace Moose
      13             : {
      14             : namespace Kokkos
      15             : {
      16             : 
      17             : InputParameters
      18       30154 : NodalBC::validParams()
      19             : {
      20       30154 :   InputParameters params = NodalBCBase::validParams();
      21       30154 :   return params;
      22             : }
      23             : 
      24        1225 : NodalBC::NodalBC(const InputParameters & parameters)
      25             :   : NodalBCBase(parameters, Moose::VarFieldType::VAR_FIELD_STANDARD),
      26         933 :     _u(_var, Moose::SOLUTION_TAG, true)
      27             : {
      28        1225 :   addMooseVariableDependency(&_var);
      29        1225 : }
      30             : 
      31             : void
      32       46779 : NodalBC::computeResidual()
      33             : {
      34       46779 :   Policy policy(0, numKokkosBoundaryNodes());
      35             : 
      36       46779 :   if (!_residual_dispatcher)
      37        1071 :     _residual_dispatcher = DispatcherRegistry::build<ResidualLoop>(this, type());
      38             : 
      39       46779 :   _residual_dispatcher->parallelFor(policy);
      40       46779 : }
      41             : 
      42             : void
      43        8010 : NodalBC::computeJacobian()
      44             : {
      45        8010 :   Policy policy(0, numKokkosBoundaryNodes());
      46             : 
      47        8010 :   if (!_jacobian_dispatcher)
      48        1051 :     _jacobian_dispatcher = DispatcherRegistry::build<JacobianLoop>(this, type());
      49             : 
      50        8010 :   _jacobian_dispatcher->parallelFor(policy);
      51             : 
      52        8010 :   if (DispatcherRegistry::hasUserMethod<OffDiagJacobianLoop>(type()))
      53             :   {
      54          70 :     auto & sys = kokkosSystem(_kokkos_var.sys());
      55             : 
      56         140 :     _thread.resize({sys.getCoupling(_kokkos_var.var()).size(), numKokkosBoundaryNodes()});
      57             : 
      58          70 :     if (!_offdiag_jacobian_dispatcher)
      59          20 :       _offdiag_jacobian_dispatcher = DispatcherRegistry::build<OffDiagJacobianLoop>(this, type());
      60             : 
      61          70 :     _offdiag_jacobian_dispatcher->parallelFor(policy);
      62             :   }
      63        8010 : }
      64             : 
      65             : } // namespace Kokkos
      66             : } // namespace Moose

Generated by: LCOV version 1.14