LCOV - code coverage report
Current view: top level - src/loops - ComputeMortarNodalAuxBndThread.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 25 25 100.0 %
Date: 2025-07-17 01:28:37 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://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 "libmesh/threads.h"
      11             : 
      12             : // MOOSE includes
      13             : #include "ComputeMortarNodalAuxBndThread.h"
      14             : #include "AuxiliarySystem.h"
      15             : #include "FEProblem.h"
      16             : #include "MortarNodalAuxKernel.h"
      17             : 
      18             : template <typename AuxKernelType>
      19         169 : ComputeMortarNodalAuxBndThread<AuxKernelType>::ComputeMortarNodalAuxBndThread(
      20             :     FEProblemBase & fe_problem,
      21             :     const MooseObjectWarehouse<AuxKernelType> & storage,
      22             :     const BoundaryID bnd_id,
      23             :     const std::size_t object_container_index)
      24             :   : ThreadedNodeLoop<ConstBndNodeRange, ConstBndNodeRange::const_iterator>(fe_problem),
      25         338 :     _aux_sys(fe_problem.getAuxiliarySystem()),
      26         169 :     _storage(storage),
      27         169 :     _bnd_id(bnd_id),
      28         169 :     _object_container_index(object_container_index)
      29             : {
      30         169 : }
      31             : 
      32             : // Splitting Constructor
      33             : template <typename AuxKernelType>
      34          17 : ComputeMortarNodalAuxBndThread<AuxKernelType>::ComputeMortarNodalAuxBndThread(
      35             :     ComputeMortarNodalAuxBndThread & x, Threads::split split)
      36             :   : ThreadedNodeLoop<ConstBndNodeRange, ConstBndNodeRange::const_iterator>(x, split),
      37          17 :     _aux_sys(x._aux_sys),
      38          17 :     _storage(x._storage),
      39          17 :     _bnd_id(x._bnd_id),
      40          17 :     _object_container_index(x._object_container_index)
      41             : {
      42          17 : }
      43             : 
      44             : template <typename AuxKernelType>
      45             : void
      46        4782 : ComputeMortarNodalAuxBndThread<AuxKernelType>::onNode(ConstBndNodeRange::const_iterator & node_it)
      47             : {
      48        4782 :   const BndNode * bnode = *node_it;
      49             : 
      50        4782 :   if (bnode->_bnd_id != _bnd_id)
      51        3878 :     return;
      52             : 
      53         904 :   Node * node = bnode->_node;
      54             : 
      55         904 :   if (node->processor_id() == _fe_problem.processor_id())
      56             :   {
      57         682 :     const auto & kernel = _storage.getActiveBoundaryObjects(_bnd_id, _tid)[_object_container_index];
      58             :     mooseAssert(dynamic_cast<MortarNodalAuxKernel *>(kernel.get()),
      59             :                 "This should be a mortar nodal aux kernel");
      60         682 :     _fe_problem.reinitNodeFace(node, _bnd_id, _tid);
      61         682 :     kernel->compute();
      62             :     // This is the same conditional check that the aux kernel performs internally before calling
      63             :     // computeValue and _var.setNodalValue. We don't want to attempt to insert into the solution if
      64             :     // we don't actually have any dofs on this node
      65         682 :     if (kernel->variable().isNodalDefined())
      66         595 :       kernel->variable().insert(_aux_sys.solution());
      67             :   }
      68             : }
      69             : 
      70             : template <typename AuxKernelType>
      71             : void
      72          17 : ComputeMortarNodalAuxBndThread<AuxKernelType>::join(const ComputeMortarNodalAuxBndThread & /*y*/)
      73             : {
      74          17 : }
      75             : 
      76             : template class ComputeMortarNodalAuxBndThread<AuxKernel>;

Generated by: LCOV version 1.14