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 92432 : GatherRCDataElementThread::GatherRCDataElementThread(FEProblemBase & fe_problem, 17 : const unsigned int nl_sys_number, 18 92432 : const std::vector<unsigned int> & vars) 19 92432 : : ThreadedElementLoop<ConstElemRange>(fe_problem), _nl_system_num(nl_sys_number), _vars(vars) 20 : { 21 92432 : } 22 : 23 : // Splitting Constructor 24 16260 : GatherRCDataElementThread::GatherRCDataElementThread(GatherRCDataElementThread & x, 25 16260 : Threads::split split) 26 16260 : : ThreadedElementLoop<ConstElemRange>(x, split), _nl_system_num(x._nl_system_num), _vars(x._vars) 27 : { 28 16260 : } 29 : 30 : void 31 204712 : GatherRCDataElementThread::subdomainChanged() 32 : { 33 : ThreadedElementLoop<ConstElemRange>::subdomainChanged(); 34 : 35 204712 : _insfv_elemental_kernels.clear(); 36 : 37 204712 : auto queries = _fe_problem.theWarehouse() 38 204712 : .query() 39 204712 : .template condition<AttribSystem>("FVElementalKernel") 40 204712 : .template condition<AttribSysNum>(this->_nl_system_num) 41 204712 : .template condition<AttribThread>(_tid) 42 204712 : .template condition<AttribSubdomains>(_subdomain); 43 : 44 608892 : 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 404180 : auto copied_queries = queries; 50 : std::vector<FVElementalKernel *> var_eks; 51 808360 : copied_queries.template condition<AttribVar>(static_cast<int>(var_num)).queryInto(var_eks); 52 1233100 : for (auto var_ek : var_eks) 53 828920 : if (auto insfv_ek = dynamic_cast<INSFVMomentumResidualObject *>(var_ek)) 54 828920 : _insfv_elemental_kernels.push_back(insfv_ek); 55 404180 : } 56 204712 : } 57 : 58 : void 59 23189480 : GatherRCDataElementThread::onElement(const Elem * const elem) 60 : { 61 : mooseAssert(elem && elem->subdomain_id() == _subdomain, "sub ids don't match"); 62 : 63 111071141 : for (auto * const insfv_ek : _insfv_elemental_kernels) 64 87881661 : insfv_ek->gatherRCData(*elem); 65 23189480 : }