18 #include "libmesh/threads.h" 26 _aux_sys(fe_problem.getAuxiliarySystem())
44 std::vector<NodalUserObject *> objs;
50 std::set<TagID> needed_vector_tags;
51 for (
const auto obj : objs)
53 auto & vector_tags = obj->getFEVariableCoupleableVectorTags();
54 needed_vector_tags.insert(vector_tags.begin(), vector_tags.end());
62 const Node * node = *node_it;
68 _block_ids.insert(block_ids.begin(), block_ids.end());
74 std::vector<NodalUserObject *> objs;
77 std::vector<BoundaryID> nodeset_ids;
79 for (
const auto & bnd : nodeset_ids)
86 for (
const auto & uo : objs)
91 if (uo->hasWritableCoupledVariables())
94 for (
auto * var : uo->getWritableCoupledVariables())
107 std::set<NodalUserObject *> computed;
108 for (
const auto & block : block_ids)
116 for (
const auto & uo : objs)
117 if (!uo->isUniqueNodeExecute() || computed.count(uo) == 0)
122 if (uo->hasWritableCoupledVariables())
125 for (
auto * var : uo->getWritableCoupledVariables())
146 std::vector<MooseObject *> nodal_uos;
150 .queryInto(nodal_uos);
152 if (nodal_uos.size())
156 console <<
"[DBG] Computing nodal user objects on " << execute_on << std::endl;
158 console <<
"[DBG] Ordering on nodes:" << std::endl;
159 console <<
"[DBG] - boundary restricted user objects" << std::endl;
160 console <<
"[DBG] - block restricted user objects" << std::endl;
161 console <<
"[DBG] Nodal UOs executed on each node will differ based on these restrictions" 165 message =
"Order of execution:\n" + message;
virtual ~ComputeNodalUserObjectsThread()
std::string mooseObjectVectorToString(const std::vector< MooseObject *> &objs, const std::string &sep=" ")
Routine to output the name of MooseObjects in a string.
std::set< SubdomainID > _block_ids
QueryCache is a convenient way to construct and pass around (possible partially constructed) warehous...
virtual void reinitNode(const Node *node, const THREAD_ID tid) override
NumericVector< Number > & solution()
const ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
AuxiliarySystem & _aux_sys
static Threads::spin_mutex writable_variable_mutex
const std::set< SubdomainID > & getNodeBlockIds(const Node &node) const
Return list of blocks to which the given node belongs.
ComputeNodalUserObjectsThread(FEProblemBase &fe_problem, const TheWarehouse::Query &query)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
FEProblemBase & _fe_problem
bool shouldPrintExecution(const THREAD_ID tid) const
Check whether the problem should output execution orders at this time.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
std::string formatString(std::string message, const std::string &prefix)
Add new lines and prefixes to a string for pretty display in output NOTE: This makes a copy of the st...
AttribBoundaries tracks all boundary IDs associated with an object.
StoredRange< MeshBase::const_node_iterator, const Node *> ConstNodeRange
QueryCache clone() const
clone creates and returns an independent copy of the query in its current state.
const ConsoleStream & console() const
Return console handle.
virtual MooseMesh & mesh()
virtual MooseMesh & mesh() override
void join(const ComputeNodalUserObjectsThread &)
void printGeneralExecutionInformation() const override
Print information about the loop, mostly order of execution of objects.
QueryCache & condition(Args &&... args)
Adds a new condition to the query.
virtual void onNode(ConstNodeRange::const_iterator &node_it) override
Called for each node.
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
const TheWarehouse::Query _query