LCOV - code coverage report
Current view: top level - src/kokkos/interfaces - KokkosBoundaryRestrictable.K (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #33416 (b10b36) with base 9fbd27 Lines: 36 36 100.0 %
Date: 2026-07-23 16:15:30 Functions: 2 2 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 "KokkosMaterialBase.h"
      11             : 
      12             : #include "BoundaryRestrictable.h"
      13             : 
      14             : #include "MooseMesh.h"
      15             : 
      16      353277 : BoundaryRestrictable::BoundaryRestrictable(const BoundaryRestrictable & object,
      17      198779 :                                            const Moose::Kokkos::FunctorCopy &)
      18      198779 :   : _bnd_feproblem(object._bnd_feproblem),
      19      198779 :     _bnd_mesh(object._bnd_mesh),
      20      198779 :     _bnd_dual_restrictable(object._bnd_dual_restrictable),
      21      198779 :     _block_ids(object._block_ids),
      22      198779 :     _bnd_tid(object._bnd_tid),
      23      198779 :     _bnd_material_data(object._bnd_material_data),
      24      198779 :     _bnd_nodal(object._bnd_nodal),
      25      198779 :     _moose_object(object._moose_object)
      26             : {
      27      353277 :   _kokkos_node_ids = object._kokkos_node_ids;
      28      353277 :   _kokkos_element_side_ids = object._kokkos_element_side_ids;
      29      353277 : }
      30             : 
      31             : void
      32        8606 : BoundaryRestrictable::initializeKokkosBoundaryRestrictable()
      33             : {
      34       25818 :   if (_moose_object.isParamValid("_kokkos_material"))
      35        2744 :     return;
      36             : 
      37        5862 :   auto & boundaries = boundaryRestricted() ? boundaryIDs() : meshBoundaryIDs();
      38             : 
      39        5862 :   const auto * const kokkos_mesh = _bnd_mesh->getKokkosMesh();
      40             : 
      41        5862 :   if (_bnd_nodal)
      42             :   {
      43        4441 :     std::vector<ContiguousNodeID> node_ids;
      44             : 
      45       11305 :     for (const auto boundary : boundaries)
      46        6864 :       node_ids.insert(node_ids.end(),
      47        3644 :                       kokkos_mesh->getBoundaryContiguousNodeIDs(boundary).begin(),
      48        3644 :                       kokkos_mesh->getBoundaryContiguousNodeIDs(boundary).end());
      49             : 
      50        4441 :     _kokkos_node_ids = node_ids;
      51        4441 :   }
      52             :   else
      53             :   {
      54        1421 :     std::set<Moose::Kokkos::Pair<ContiguousElementID, unsigned int>> element_side_ids;
      55             : 
      56        3836 :     for (auto boundary : boundaries)
      57       22972 :       for (auto elem_id : _bnd_mesh->getBoundaryActiveSemiLocalElemIds(boundary))
      58             :       {
      59       20557 :         const auto elem = _bnd_mesh->elemPtr(elem_id);
      60             : 
      61       20557 :         if (elem->processor_id() == _moose_object.processor_id())
      62       27664 :           element_side_ids.insert({kokkos_mesh->getContiguousElementID(elem),
      63        9913 :                                    _bnd_mesh->sideWithBoundaryID(elem, boundary)});
      64        2415 :       }
      65             : 
      66        1421 :     _kokkos_element_side_ids = element_side_ids;
      67        1421 :   }
      68             : }

Generated by: LCOV version 1.14