18 #include "libmesh/threads.h" 20 template <
typename AuxKernelType>
23 template <
typename AuxKernelType>
27 _aux_sys(fe_problem.getAuxiliarySystem()),
33 template <
typename AuxKernelType>
42 template <
typename AuxKernelType>
46 std::set<TagID> needed_vector_tags;
47 std::set<TagID> needed_matrix_tags;
49 const auto & block_kernels = _storage.getActiveBlockObjects(_tid);
51 for (
const auto & block : _block_ids)
53 const auto iter = block_kernels.find(block);
55 if (iter != block_kernels.end())
56 for (
const auto & aux : iter->second)
58 auto & matrix_tags = aux->getFEVariableCoupleableMatrixTags();
59 needed_matrix_tags.insert(matrix_tags.begin(), matrix_tags.end());
60 auto & vector_tags = aux->getFEVariableCoupleableVectorTags();
61 needed_vector_tags.insert(vector_tags.begin(), vector_tags.end());
65 _fe_problem.setActiveFEVariableCoupleableMatrixTags(needed_matrix_tags, _tid);
66 _fe_problem.setActiveFEVariableCoupleableVectorTags(needed_vector_tags, _tid);
69 template <
typename AuxKernelType>
73 const Node * node = *node_it;
75 const auto & block_ids = _aux_sys.mesh().getNodeBlockIds(*node);
77 if (_block_ids != block_ids)
80 _block_ids.insert(block_ids.begin(), block_ids.end());
84 _fe_problem.reinitNode(node, _tid);
87 const auto & block_kernels = _storage.getActiveBlockObjects(_tid);
91 for (
const auto & block : block_ids)
93 const auto iter = block_kernels.find(block);
95 if (iter != block_kernels.end())
96 for (
const auto & aux : iter->second)
102 if (aux->variable().isNodalDefined())
103 aux->variable().insert(_aux_sys.solution());
106 if (aux->hasWritableCoupledVariables())
108 for (
auto * var : aux->getWritableCoupledVariables())
109 if (var->isNodalDefined())
111 var->insert(_aux_sys.solution());
114 _fe_problem.reinitNode(node, _tid);
120 template <
typename AuxKernelType>
124 _fe_problem.clearActiveFEVariableCoupleableVectorTags(_tid);
125 _fe_problem.clearActiveFEVariableCoupleableMatrixTags(_tid);
128 template <
typename AuxKernelType>
134 template <
typename AuxKernelType>
138 if (!_fe_problem.shouldPrintExecution(_tid) || !_storage.hasActiveObjects())
141 const auto & console = _fe_problem.console();
142 const auto & execute_on = _fe_problem.getCurrentExecuteOnFlag();
143 console <<
"[DBG] Beginning nodal loop of nodal auxiliary kernels on " << execute_on << std::endl;
144 console <<
"[DBG] Ordering of the kernels on each block they are defined on:" << std::endl;
146 console << _storage.activeObjectsToFormattedString() << std::endl;
void post() override
Called after the node range loop.
void join(const ComputeNodalAuxVarsThread &)
void onNode(ConstNodeRange::const_iterator &nd) override
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
ComputeNodalAuxVarsThread(FEProblemBase &fe_problem, const MooseObjectWarehouse< AuxKernelType > &storage)
vec_type::const_iterator const_iterator
void printGeneralExecutionInformation() const override
Print information about the loop, mostly order of execution of objects.