35{
39
42
43
44 for (const auto & elem : range)
45 {
46 const unsigned int n_nodes = elem->n_nodes();
47
48
49
50 std::set<SubdomainID> block_ids;
51 for (
unsigned int n = 0; n <
n_nodes; n++)
52 {
53 auto node = elem->node_ptr(n);
55 block_ids.insert(ids.begin(), ids.end());
56 }
57
58
59
60
61 std::vector<MooseVariableFEBase *> order;
62
63
64
65
66
67
68
69
70 std::map<MooseVariableFEBase *, std::vector<std::shared_ptr<InitialConditionBase>>> groups;
71 for (auto id : block_ids)
72 if (warehouse.hasActiveBlockObjects(id,
_tid))
73 for (auto ic : warehouse.getActiveBlockObjects(id,
_tid))
74 {
75 if ((id != elem->subdomain_id() && !ic->variable().isNodal()) ||
76 ic->getState() != current_ic_state)
77 continue;
78
79
80 const auto & var_name = ic->variable().name();
82 continue;
83
84 order.push_back(&(ic->variable()));
85 groups[&(ic->variable())].push_back(ic);
86 }
87
91
92 for (auto var : order)
93 {
94 DenseVector<Real> Ue;
95 auto & vec = groups[var];
96
97
98
99
100 try
101 {
102 DependencyResolverInterface::sort<std::shared_ptr<InitialConditionBase>>(vec);
103 }
105 {
106 DependencyResolverInterface::cyclicDependencyError<std::shared_ptr<InitialConditionBase>>(
107 e, "Cyclic dependency detected in object ordering");
108 }
109
110 for (auto ic : vec)
111 ic->compute();
112 vec.clear();
113
114
115 var->insert(var->sys().solution());
116 }
117 }
118}
for(PetscInt i=0;i< nvars;++i)
if(!dmm->_nl) SETERRQ(PETSC_COMM_WORLD
void printGeneralExecutionInformation() const
Print information about the loop, mostly order of execution of objects.
unsigned short getCurrentICState()
Retrieves the current initial condition state.
virtual void reinitElem(const Elem *elem, const THREAD_ID tid) override
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid) override
const InitialConditionWarehouse & getInitialConditionWarehouse() const
Return InitialCondition storage.
virtual void prepare(const Elem *elem, const THREAD_ID tid) override
virtual MooseMesh & mesh() override
Warehouse for storing initial conditions.
const std::set< SubdomainID > & getNodeBlockIds(const Node &node) const
Return list of blocks to which the given node belongs.
const dof_id_type n_nodes