17 : _fe_problem(fe_problem)
23 : _fe_problem(x._fe_problem)
28 FEProblemBase & fe_problem,
const std::set<VariableName> * target_vars)
29 : _fe_problem(fe_problem), _target_vars(target_vars)
44 for (
const auto & elem : range)
46 const unsigned int n_nodes = elem->n_nodes();
50 std::set<SubdomainID> block_ids;
51 for (
unsigned int n = 0; n <
n_nodes; n++)
53 auto node = elem->node_ptr(n);
55 block_ids.insert(ids.begin(), ids.end());
61 std::vector<MooseVariableFEBase *> order;
70 std::map<MooseVariableFEBase *, std::vector<std::shared_ptr<InitialConditionBase>>> groups;
71 for (
auto id : block_ids)
75 if ((
id != elem->subdomain_id() && !ic->variable().isNodal()) ||
76 ic->getState() != current_ic_state)
80 const auto & var_name = ic->variable().name();
84 order.push_back(&(ic->variable()));
85 groups[&(ic->variable())].push_back(ic);
92 for (
auto var : order)
95 auto & vec = groups[var];
102 DependencyResolverInterface::sort<std::shared_ptr<InitialConditionBase>>(vec);
106 DependencyResolverInterface::cyclicDependencyError<std::shared_ptr<InitialConditionBase>>(
107 e,
"Cyclic dependency detected in object ordering");
115 var->insert(var->sys().solution());
133 console <<
"[DBG] Executing initial conditions on elements on " << execute_on << std::endl;
134 console <<
"[DBG] Unordered list:" << std::endl;
135 console << ic_wh.activeObjectsToFormattedString() << std::endl;
136 console <<
"[DBG] The order of execution is defined by dependency resolution on every element" const std::set< VariableName > * _target_vars
the names of target variables for which the initial conditions are applied
unsigned short getCurrentICState()
Retrieves the current initial condition state.
bool hasActiveBlockObjects(THREAD_ID tid=0) const
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
virtual void prepare(const Elem *elem, const THREAD_ID tid) override
Warehouse for storing initial conditions.
const ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
void printGeneralExecutionInformation() const
Print information about the loop, mostly order of execution of objects.
const std::set< SubdomainID > & getNodeBlockIds(const Node &node) const
Return list of blocks to which the given node belongs.
const InitialConditionWarehouse & getInitialConditionWarehouse() const
Return InitialCondition storage.
ComputeInitialConditionThread(FEProblemBase &fe_problem)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const dof_id_type n_nodes
bool shouldPrintExecution(const THREAD_ID tid) const
Check whether the problem should output execution orders at this time.
virtual void reinitElem(const Elem *elem, const THREAD_ID tid) override
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid) override
const ConsoleStream & console() const
Return console handle.
virtual MooseMesh & mesh() override
void operator()(const libMesh::ConstElemRange &range)
void join(const ComputeInitialConditionThread &)
FEProblemBase & _fe_problem