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 "ComputeFVInitialConditionThread.h" 11 : #include "FEProblem.h" 12 : #include "FVInitialConditionTempl.h" 13 : 14 4758 : ComputeFVInitialConditionThread::ComputeFVInitialConditionThread(FEProblemBase & fe_problem) 15 4758 : : _fe_problem(fe_problem) 16 : { 17 4758 : } 18 : 19 218 : ComputeFVInitialConditionThread::ComputeFVInitialConditionThread( 20 218 : ComputeFVInitialConditionThread & x, Threads::split /*split*/) 21 218 : : _fe_problem(x._fe_problem) 22 : { 23 218 : } 24 : 25 : void 26 4976 : ComputeFVInitialConditionThread::operator()(const ElemInfoRange & range) 27 : { 28 4976 : ParallelUniqueId puid; 29 4976 : _tid = puid.id; 30 : 31 4976 : const FVInitialConditionWarehouse & warehouse = _fe_problem.getFVInitialConditionWarehouse(); 32 4976 : printGeneralExecutionInformation(); 33 : 34 : // Iterate over all the elements in the range 35 1061990 : for (const auto & elem_info : range) 36 1057014 : if (warehouse.hasActiveBlockObjects(elem_info->subdomain_id(), _tid)) 37 848208 : for (auto ic : warehouse.getActiveBlockObjects(elem_info->subdomain_id(), _tid)) 38 424864 : ic->computeElement(*elem_info); 39 4976 : } 40 : 41 : void 42 218 : ComputeFVInitialConditionThread::join(const ComputeFVInitialConditionThread & /*y*/) 43 : { 44 218 : } 45 : 46 : void 47 4976 : ComputeFVInitialConditionThread::printGeneralExecutionInformation() const 48 : { 49 4976 : const auto & ic_wh = _fe_problem.getFVInitialConditionWarehouse(); 50 4976 : if (_fe_problem.shouldPrintExecution(_tid) && ic_wh.hasActiveObjects()) 51 : { 52 0 : const auto & console = _fe_problem.console(); 53 0 : const auto & execute_on = _fe_problem.getCurrentExecuteOnFlag(); 54 0 : console << "[DBG] Executing initial conditions on elements on " << execute_on << std::endl; 55 0 : console << "[DBG] Unordered list:" << std::endl; 56 0 : console << ic_wh.activeObjectsToFormattedString() << std::endl; 57 0 : console << "[DBG] The order of execution is defined by dependency resolution on every element" 58 0 : << std::endl; 59 : } 60 4976 : }