215 std::vector<MeshLib::Element*>& vec_matrix_elements,
216 std::vector<int>& vec_fracture_mat_IDs,
217 std::vector<std::vector<MeshLib::Element*>>& vec_fracture_elements,
218 std::vector<std::vector<MeshLib::Element*>>& vec_fracture_matrix_elements,
219 std::vector<std::vector<MeshLib::Node*>>& vec_fracture_nodes,
220 std::vector<std::pair<std::size_t, std::vector<int>>>&
221 vec_branch_nodeID_matIDs,
222 std::vector<std::pair<std::size_t, std::vector<int>>>&
223 vec_junction_nodeID_matIDs)
225 IsCrackTip isCrackTip(mesh);
229 std::vector<MeshLib::Element*> all_fracture_elements;
234 vec_matrix_elements.push_back(e);
238 all_fracture_elements.push_back(e);
241 DBUG(
"-> found total {:d} matrix elements and {:d} fracture elements",
242 vec_matrix_elements.size(), all_fracture_elements.size());
245 auto const material_ids = materialIDs(mesh);
248 OGS_FATAL(
"Could not access MaterialIDs property from mesh.");
250 transform(cbegin(all_fracture_elements), cend(all_fracture_elements),
251 back_inserter(vec_fracture_mat_IDs),
252 [&material_ids](
auto const* e)
253 {
return (*material_ids)[e->getID()]; });
256 DBUG(
"-> found {:d} fracture material groups", vec_fracture_mat_IDs.size());
259 vec_fracture_elements.resize(vec_fracture_mat_IDs.size());
260 for (
unsigned frac_id = 0; frac_id < vec_fracture_mat_IDs.size(); frac_id++)
262 const auto frac_mat_id = vec_fracture_mat_IDs[frac_id];
263 std::vector<MeshLib::Element*>& vec_elements =
264 vec_fracture_elements[frac_id];
265 std::copy_if(all_fracture_elements.begin(), all_fracture_elements.end(),
266 std::back_inserter(vec_elements),
268 { return (*material_ids)[e->getID()] == frac_mat_id; });
269 DBUG(
"-> found {:d} elements on the fracture {:d}", vec_elements.size(),
274 vec_fracture_nodes.resize(vec_fracture_mat_IDs.size());
275 for (
unsigned frac_id = 0; frac_id < vec_fracture_mat_IDs.size(); frac_id++)
277 std::vector<MeshLib::Node*>& vec_nodes = vec_fracture_nodes[frac_id];
280 for (
unsigned i = 0; i < e->getNumberOfNodes(); i++)
282 if (isCrackTip(*e->getNode(i)))
286 vec_nodes.push_back(
const_cast<MeshLib::Node*
>(e->getNode(i)));
291 DBUG(
"-> found {:d} nodes on the fracture {:d}", vec_nodes.size(),
296 std::vector<std::vector<MeshLib::Element*>> intersected_fracture_elements;
297 findFracutreIntersections(mesh, vec_fracture_mat_IDs, vec_fracture_nodes,
298 intersected_fracture_elements,
299 vec_branch_nodeID_matIDs,
300 vec_junction_nodeID_matIDs);
304 for (
unsigned fid = 0; fid < vec_fracture_elements.size(); fid++)
306 auto const& fracture_elements = vec_fracture_elements[fid];
307 std::vector<MeshLib::Element*> vec_ele;
313 for (
unsigned i = 0; i < e->getNumberOfBaseNodes(); i++)
316 if (isCrackTip(*node))
320 auto const& elements_connected_to_node =
322 for (
unsigned j = 0; j < elements_connected_to_node.size(); j++)
325 if (elements_connected_to_node[j]->getDimension() <
331 elements_connected_to_node[j]));
339 std::copy(fracture_elements.begin(), fracture_elements.end(),
340 std::back_inserter(vec_ele));
342 std::copy(intersected_fracture_elements[fid].begin(),
343 intersected_fracture_elements[fid].end(),
344 std::back_inserter(vec_ele));
346 vec_fracture_matrix_elements.push_back(vec_ele);
void getFractureMatrixDataInMesh(MeshLib::Mesh const &mesh, std::vector< MeshLib::Element * > &vec_matrix_elements, std::vector< int > &vec_fracture_mat_IDs, std::vector< std::vector< MeshLib::Element * > > &vec_fracture_elements, std::vector< std::vector< MeshLib::Element * > > &vec_fracture_matrix_elements, std::vector< std::vector< MeshLib::Node * > > &vec_fracture_nodes, std::vector< std::pair< std::size_t, std::vector< int > > > &vec_branch_nodeID_matIDs, std::vector< std::pair< std::size_t, std::vector< int > > > &vec_junction_nodeID_matIDs)