Skip to content
Snippets Groups Projects
Commit c4180b0b authored by Florian Zill's avatar Florian Zill Committed by Dmitri Naumov
Browse files

[PL] added ids of active elements to process

parent 1a9aaaf1
No related branches found
No related tags found
No related merge requests found
......@@ -202,6 +202,26 @@ void Process::updateDeactivatedSubdomains(double const time,
{
variable.get().updateDeactivatedSubdomains(time);
}
_ids_of_active_elements.clear();
for (ProcessLib::ProcessVariable const& pv :
getProcessVariables(process_id))
{
auto const pv_active_element_ids = pv.getActiveElementIDs();
// empty if no deactivated_subdomains exist in process variable
// executeSelectedMemberDereferenced with empty active_element_ids
// will run executeMemberDereferenced (i.e. on all elements)
if (pv_active_element_ids.empty())
{
_ids_of_active_elements.clear();
return;
}
std::vector<std::size_t> tempResult;
std::set_union(
_ids_of_active_elements.begin(), _ids_of_active_elements.end(),
pv_active_element_ids.begin(), pv_active_element_ids.end(),
std::back_inserter(tempResult));
_ids_of_active_elements = std::move(tempResult);
}
}
void Process::preAssemble(const double t, double const dt,
......
......@@ -157,6 +157,11 @@ public:
return _process_variables[process_id];
}
std::vector<std::size_t> const& getActiveElementIDs() const
{
return _ids_of_active_elements;
}
SecondaryVariableCollection const& getSecondaryVariables() const
{
return _secondary_variables;
......@@ -393,6 +398,9 @@ private:
std::vector<SourceTermCollection> _source_term_collections;
ExtrapolatorData _extrapolator_data;
/// Union of active element ids per process variable
mutable std::vector<std::size_t> _ids_of_active_elements;
};
} // namespace ProcessLib
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment