LCOV - code coverage report
Current view: top level - src/loops - GatherRCDataElementThread.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: #31613 (c7d555) with base 7323e9 Lines: 28 28 100.0 %
Date: 2025-11-06 14:16:13 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 "GatherRCDataElementThread.h"
      11             : #include "INSFVAttributes.h"
      12             : #include "INSFVMomentumResidualObject.h"
      13             : #include "FVElementalKernel.h"
      14             : #include "FVTimeKernel.h"
      15             : 
      16       94341 : GatherRCDataElementThread::GatherRCDataElementThread(FEProblemBase & fe_problem,
      17             :                                                      const unsigned int nl_sys_number,
      18       94341 :                                                      const std::vector<unsigned int> & vars)
      19       94341 :   : ThreadedElementLoop<ConstElemRange>(fe_problem), _nl_system_num(nl_sys_number), _vars(vars)
      20             : {
      21       94341 : }
      22             : 
      23             : // Splitting Constructor
      24       16692 : GatherRCDataElementThread::GatherRCDataElementThread(GatherRCDataElementThread & x,
      25       16692 :                                                      Threads::split split)
      26       16692 :   : ThreadedElementLoop<ConstElemRange>(x, split), _nl_system_num(x._nl_system_num), _vars(x._vars)
      27             : {
      28       16692 : }
      29             : 
      30             : void
      31      207057 : GatherRCDataElementThread::subdomainChanged()
      32             : {
      33             :   ThreadedElementLoop<ConstElemRange>::subdomainChanged();
      34             : 
      35      207057 :   _insfv_elemental_kernels.clear();
      36             : 
      37      207057 :   auto queries = _fe_problem.theWarehouse()
      38      207057 :                      .query()
      39      207057 :                      .template condition<AttribSystem>("FVElementalKernel")
      40      207057 :                      .template condition<AttribSysNum>(this->_nl_system_num)
      41      207057 :                      .template condition<AttribThread>(_tid)
      42      207057 :                      .template condition<AttribSubdomains>(_subdomain);
      43             : 
      44      615774 :   for (const auto var_num : _vars)
      45             :   {
      46             :     // We don't want to do cascading var num attributes or else the second time around we won't get
      47             :     // any results out of the query (e.g. an object cannot have a variable that simultaneously has
      48             :     // both var number 0 and 1)
      49      408717 :     auto copied_queries = queries;
      50             :     std::vector<FVElementalKernel *> var_eks;
      51      817434 :     copied_queries.template condition<AttribVar>(static_cast<int>(var_num)).queryInto(var_eks);
      52     1247310 :     for (auto var_ek : var_eks)
      53      838593 :       if (auto insfv_ek = dynamic_cast<INSFVMomentumResidualObject *>(var_ek))
      54      838593 :         _insfv_elemental_kernels.push_back(insfv_ek);
      55      408717 :   }
      56      207057 : }
      57             : 
      58             : void
      59    23470718 : GatherRCDataElementThread::onElement(const Elem * const elem)
      60             : {
      61             :   mooseAssert(elem && elem->subdomain_id() == _subdomain, "sub ids don't match");
      62             : 
      63   112275679 :   for (auto * const insfv_ek : _insfv_elemental_kernels)
      64    88804961 :     insfv_ek->gatherRCData(*elem);
      65    23470718 : }

Generated by: LCOV version 1.14