LCOV - code coverage report
Current view: top level - src/loops - GatherRCDataElementThread.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: #33358 (34476d) with base 4fcf7b Lines: 28 28 100.0 %
Date: 2026-07-17 19:53:28 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       60892 : GatherRCDataElementThread::GatherRCDataElementThread(FEProblemBase & fe_problem,
      17             :                                                      const unsigned int nl_sys_number,
      18       60892 :                                                      const std::vector<unsigned int> & vars)
      19       60892 :   : ThreadedElementLoop<ConstElemRange>(fe_problem), _nl_system_num(nl_sys_number), _vars(vars)
      20             : {
      21       60892 : }
      22             : 
      23             : // Splitting Constructor
      24         394 : GatherRCDataElementThread::GatherRCDataElementThread(GatherRCDataElementThread & x,
      25         394 :                                                      Threads::split split)
      26         394 :   : ThreadedElementLoop<ConstElemRange>(x, split), _nl_system_num(x._nl_system_num), _vars(x._vars)
      27             : {
      28         394 : }
      29             : 
      30             : void
      31      131429 : GatherRCDataElementThread::subdomainChanged()
      32             : {
      33             :   ThreadedElementLoop<ConstElemRange>::subdomainChanged();
      34             : 
      35      131429 :   _insfv_elemental_kernels.clear();
      36             : 
      37      131429 :   auto queries = _fe_problem.theWarehouse()
      38      131429 :                      .query()
      39      131429 :                      .template condition<AttribSystem>("FVElementalKernel")
      40      131429 :                      .template condition<AttribSysNum>(this->_nl_system_num)
      41      131429 :                      .template condition<AttribThread>(_tid)
      42      131429 :                      .template condition<AttribSubdomains>(_subdomain);
      43             : 
      44      391371 :   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      259942 :     auto copied_queries = queries;
      50             :     std::vector<FVElementalKernel *> var_eks;
      51      519884 :     copied_queries.template condition<AttribVar>(static_cast<int>(var_num)).queryInto(var_eks);
      52      787102 :     for (auto var_ek : var_eks)
      53      527160 :       if (auto insfv_ek = dynamic_cast<INSFVMomentumResidualObject *>(var_ek))
      54      527160 :         _insfv_elemental_kernels.push_back(insfv_ek);
      55      259942 :   }
      56      131429 : }
      57             : 
      58             : void
      59    16062607 : GatherRCDataElementThread::onElement(const Elem * const elem)
      60             : {
      61             :   mooseAssert(elem && elem->subdomain_id() == _subdomain, "sub ids don't match");
      62             : 
      63    75844682 :   for (auto * const insfv_ek : _insfv_elemental_kernels)
      64    59782075 :     insfv_ek->gatherRCData(*elem);
      65    16062607 : }

Generated by: LCOV version 1.14