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

Generated by: LCOV version 1.14