53 std::vector<MeshLib::Element*>
const all_bhe_elements =
58 DBUG(
"-> found total {:d} soil elements and {:d} BHE elements",
60 all_bhe_elements.size());
64 if (opt_material_ids ==
nullptr)
66 OGS_FATAL(
"Not able to get material IDs! ");
68 auto const& material_ids = *opt_material_ids;
70 auto const& bhe_material_ids =
71 getUniqueMaterialIds(material_ids, all_bhe_elements);
72 DBUG(
"-> found {:d} BHE material groups", bhe_material_ids.size());
75 std::vector<std::vector<MeshLib::Element*>> bhe_elements;
76 bhe_elements.resize(bhe_material_ids.size());
77 for (
unsigned bhe_id = 0; bhe_id < bhe_material_ids.size(); bhe_id++)
79 const auto bhe_mat_id = bhe_material_ids[bhe_id];
80 std::vector<MeshLib::Element*>& vec_elements = bhe_elements[bhe_id];
81 copy_if(begin(all_bhe_elements), end(all_bhe_elements),
82 back_inserter(vec_elements),
84 {
return material_ids[e->
getID()] == bhe_mat_id; });
85 DBUG(
"-> found {:d} elements on the BHE_{:d}", vec_elements.size(),
90 std::vector<std::vector<MeshLib::Node*>> bhe_nodes;
91 bhe_nodes.resize(bhe_material_ids.size());
92 for (
unsigned bhe_id = 0; bhe_id < bhe_material_ids.size(); bhe_id++)
94 std::vector<MeshLib::Node*>& vec_nodes = bhe_nodes[bhe_id];
97 for (
unsigned i = 0; i < e->getNumberOfNodes(); i++)
99 vec_nodes.push_back(
const_cast<MeshLib::Node*
>(e->getNode(i)));
105 DBUG(
"-> found {:d} nodes on the BHE_{:d}", vec_nodes.size(), bhe_id);
108 return {bhe_material_ids, bhe_elements, bhe_nodes};