LCOV - code coverage report
Current view: top level - src/kokkos/bcs - KokkosNodalBC.K (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 863ef6 Lines: 25 25 100.0 %
Date: 2025-10-15 18:16:15 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       29746 : NodalBC::validParams()
      19             : {
      20       29746 :   InputParameters params = NodalBCBase::validParams();
      21       29746 :   return params;
      22             : }
      23             : 
      24        1201 : NodalBC::NodalBC(const InputParameters & parameters)
      25             :   : NodalBCBase(parameters, Moose::VarFieldType::VAR_FIELD_STANDARD),
      26         915 :     _u(_var, Moose::SOLUTION_TAG, true)
      27             : {
      28        1201 :   addMooseVariableDependency(&_var);
      29        1201 : }
      30             : 
      31             : void
      32       47629 : NodalBC::computeResidual()
      33             : {
      34       47629 :   Policy policy(0, numKokkosBoundaryNodes());
      35             : 
      36       47629 :   if (!_residual_dispatcher)
      37        1071 :     _residual_dispatcher = DispatcherRegistry::build<ResidualLoop>(this, type());
      38             : 
      39       47629 :   _residual_dispatcher->parallelFor(policy);
      40       47629 : }
      41             : 
      42             : void
      43        8014 : NodalBC::computeJacobian()
      44             : {
      45        8014 :   Policy policy(0, numKokkosBoundaryNodes());
      46             : 
      47        8014 :   if (!_jacobian_dispatcher)
      48        1051 :     _jacobian_dispatcher = DispatcherRegistry::build<JacobianLoop>(this, type());
      49             : 
      50        8014 :   _jacobian_dispatcher->parallelFor(policy);
      51             : 
      52        8014 :   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        8014 : }
      64             : 
      65             : } // namespace Kokkos
      66             : } // namespace Moose

Generated by: LCOV version 1.14