14 #include "libmesh/elem.h" 15 #include "libmesh/enum_order.h" 16 #include "libmesh/boundary_info.h" 17 #include "libmesh/mesh_base.h" 18 #include "libmesh/parallel.h" 19 #include "libmesh/parallel_algebra.h" 20 #include "libmesh/utility.h" 21 #include "libmesh/cell_tet4.h" 22 #include "libmesh/face_tri3.h" 30 const std::vector<libMesh::BoundaryInfo::BCTuple> & bdry_side_list,
32 std::vector<dof_id_type> & converted_elems_ids)
37 std::vector<std::vector<boundary_id_type>> elem_side_list;
38 elem_side_list.resize(6);
42 std::vector<dof_id_type> exist_extra_ids(n_elem_extra_ids);
44 for (
unsigned int j = 0; j < n_elem_extra_ids; j++)
47 std::vector<std::vector<unsigned int>> opt_option;
56 std::vector<std::vector<unsigned int>> rotated_tet_face_indices;
58 std::vector<std::vector<const Node *>> optimized_node_list;
61 std::vector<Elem *> elems_Tet4;
62 for (
const auto i :
index_range(optimized_node_list))
64 auto new_elem = std::make_unique<Tet4>();
65 new_elem->set_node(0, const_cast<Node *>(optimized_node_list[i][0]));
66 new_elem->set_node(1, const_cast<Node *>(optimized_node_list[i][1]));
67 new_elem->set_node(2, const_cast<Node *>(optimized_node_list[i][2]));
68 new_elem->set_node(3, const_cast<Node *>(optimized_node_list[i][3]));
70 elems_Tet4.push_back(
mesh.
add_elem(std::move(new_elem)));
71 converted_elems_ids.push_back(elems_Tet4.back()->id());
73 for (
unsigned int j = 0; j < 4; j++)
78 if (rotated_tet_face_indices[i][j] < 6)
80 for (
const auto & side_info : elem_side_list[rotated_tet_face_indices[i][j]])
81 boundary_info.
add_side(elems_Tet4.back(), j, side_info);
87 for (
unsigned int i = 0; i < 6; i++)
88 for (
unsigned int j = 0; j < n_elem_extra_ids; j++)
90 elems_Tet4[i]->set_extra_integer(j, exist_extra_ids[j]);
96 const std::vector<libMesh::BoundaryInfo::BCTuple> & bdry_side_list,
98 std::vector<dof_id_type> & converted_elems_ids)
103 std::vector<std::vector<boundary_id_type>> elem_side_list;
107 std::vector<dof_id_type> exist_extra_ids(n_elem_extra_ids);
110 for (
unsigned int j = 0; j < n_elem_extra_ids; j++)
119 std::vector<std::vector<unsigned int>> rotated_tet_face_indices;
120 std::vector<std::vector<const Node *>> optimized_node_list;
123 std::vector<Elem *> elems_Tet4;
124 for (
const auto i :
index_range(optimized_node_list))
126 auto new_elem = std::make_unique<Tet4>();
127 new_elem->set_node(0, const_cast<Node *>(optimized_node_list[i][0]));
128 new_elem->set_node(1, const_cast<Node *>(optimized_node_list[i][1]));
129 new_elem->set_node(2, const_cast<Node *>(optimized_node_list[i][2]));
130 new_elem->set_node(3, const_cast<Node *>(optimized_node_list[i][3]));
132 elems_Tet4.push_back(
mesh.
add_elem(std::move(new_elem)));
133 converted_elems_ids.push_back(elems_Tet4.back()->id());
135 for (
unsigned int j = 0; j < 4; j++)
140 if (rotated_tet_face_indices[i][j] < 5)
142 for (
const auto & side_info : elem_side_list[rotated_tet_face_indices[i][j]])
143 boundary_info.
add_side(elems_Tet4.back(), j, side_info);
149 for (
unsigned int i = 0; i < 3; i++)
150 for (
unsigned int j = 0; j < n_elem_extra_ids; j++)
152 elems_Tet4[i]->set_extra_integer(j, exist_extra_ids[j]);
158 const std::vector<libMesh::BoundaryInfo::BCTuple> & bdry_side_list,
160 std::vector<dof_id_type> & converted_elems_ids)
165 std::vector<std::vector<boundary_id_type>> elem_side_list;
169 std::vector<dof_id_type> exist_extra_ids(n_elem_extra_ids);
171 for (
unsigned int j = 0; j < n_elem_extra_ids; j++)
179 std::vector<std::vector<unsigned int>> rotated_tet_face_indices;
180 std::vector<std::vector<const Node *>> optimized_node_list;
183 std::vector<Elem *> elems_Tet4;
184 for (
const auto i :
index_range(optimized_node_list))
186 auto new_elem = std::make_unique<Tet4>();
187 new_elem->set_node(0, const_cast<Node *>(optimized_node_list[i][0]));
188 new_elem->set_node(1, const_cast<Node *>(optimized_node_list[i][1]));
189 new_elem->set_node(2, const_cast<Node *>(optimized_node_list[i][2]));
190 new_elem->set_node(3, const_cast<Node *>(optimized_node_list[i][3]));
192 elems_Tet4.push_back(
mesh.
add_elem(std::move(new_elem)));
193 converted_elems_ids.push_back(elems_Tet4.back()->id());
195 for (
unsigned int j = 0; j < 4; j++)
200 if (rotated_tet_face_indices[i][j] < 5)
202 for (
const auto & side_info : elem_side_list[rotated_tet_face_indices[i][j]])
203 boundary_info.
add_side(elems_Tet4.back(), j, side_info);
209 for (
unsigned int i = 0; i < 2; i++)
210 for (
unsigned int j = 0; j < n_elem_extra_ids; j++)
212 elems_Tet4[i]->set_extra_integer(j, exist_extra_ids[j]);
216 std::vector<unsigned int>
219 const std::vector<std::vector<unsigned int>> preset_indices = {
220 {1, 3, 4}, {0, 2, 5}, {3, 1, 6}, {2, 0, 7}, {5, 7, 0}, {4, 6, 1}, {7, 5, 2}, {6, 4, 3}};
221 if (min_id_index > 7)
222 mooseError(
"The input node index is out of range.");
224 return preset_indices[min_id_index];
229 std::vector<std::vector<unsigned int>> & rotated_tet_face_indices,
230 std::vector<std::vector<const Node *>> & tet_nodes_list)
233 std::vector<dof_id_type> node_ids(8);
234 for (
unsigned int i = 0; i < 8; i++)
235 node_ids[i] = hex_nodes[i]->
id();
237 const unsigned int min_node_id_index = std::distance(
238 std::begin(node_ids), std::min_element(std::begin(node_ids), std::end(node_ids)));
244 const auto neighbor_node_ids = {node_ids[neighbor_node_indices[0]],
245 node_ids[neighbor_node_indices[1]],
246 node_ids[neighbor_node_indices[2]]};
247 const unsigned int sec_min_pos =
248 std::distance(std::begin(neighbor_node_ids),
249 std::min_element(std::begin(neighbor_node_ids), std::end(neighbor_node_ids)));
255 std::vector<unsigned int> face_rotation;
256 std::vector<unsigned int> rotated_indices;
257 nodeRotationHEX8(min_node_id_index, sec_min_pos, face_rotation, rotated_indices);
258 std::vector<const Node *> rotated_hex_nodes;
259 for (
unsigned int i = 0; i < 8; i++)
260 rotated_hex_nodes.push_back(hex_nodes[rotated_indices[i]]);
267 std::vector<std::vector<unsigned int>> tet_face_indices;
268 const auto tet_nodes_set =
tetNodesForHex(diagonal_directions, tet_face_indices);
269 for (
const auto & tet_face_index : tet_face_indices)
271 rotated_tet_face_indices.push_back(std::vector<unsigned int>());
272 for (
const auto & face_index : tet_face_index)
275 rotated_tet_face_indices.back().push_back(face_rotation[face_index]);
277 rotated_tet_face_indices.back().push_back(6);
281 for (
const auto & tet_nodes : tet_nodes_set)
283 tet_nodes_list.push_back(std::vector<const Node *>());
284 for (
const auto & tet_node : tet_nodes)
285 tet_nodes_list.back().push_back(rotated_hex_nodes[tet_node]);
293 const std::vector<std::vector<unsigned int>> face_indices = {
294 {0, 1, 2, 3}, {4, 5, 6, 7}, {0, 1, 5, 4}, {2, 3, 7, 6}, {1, 2, 6, 5}, {3, 0, 4, 7}};
295 std::vector<bool> diagonal_directions;
296 for (
const auto & face_index : face_indices)
298 std::vector<const Node *> quad_nodes = {hex_nodes[face_index[0]],
299 hex_nodes[face_index[1]],
300 hex_nodes[face_index[2]],
301 hex_nodes[face_index[3]]};
304 return diagonal_directions;
310 const std::vector<dof_id_type> node_ids = {
311 quad_nodes[0]->id(), quad_nodes[1]->id(), quad_nodes[2]->id(), quad_nodes[3]->id()};
312 const unsigned int min_id_index = std::distance(
313 std::begin(node_ids), std::min_element(std::begin(node_ids), std::end(node_ids)));
314 if (min_id_index == 0 || min_id_index == 2)
320 std::vector<std::vector<unsigned int>>
322 std::vector<std::vector<unsigned int>> & tet_face_indices)
324 const std::vector<std::vector<bool>> possible_inputs = {{
true,
true,
true,
true,
true,
false},
325 {
true,
true,
true,
true,
false,
false},
326 {
true,
true,
true,
false,
true,
false},
327 {
true,
false,
true,
true,
true,
false},
328 {
true,
false,
true,
true,
false,
false},
329 {
true,
false,
true,
false,
true,
false},
330 {
true,
false,
true,
false,
false,
false}};
332 const unsigned int input_index = std::distance(
333 std::begin(possible_inputs),
334 std::find(std::begin(possible_inputs), std::end(possible_inputs), diagonal_directions));
340 {0, 6, 2, 6}, {1, 6, 2, 6}, {1, 6, 5, 6}, {0, 6, 3, 4}, {6, 6, 3, 6}, {6, 4, 5, 6}};
341 return {{0, 1, 2, 6}, {0, 5, 1, 6}, {0, 4, 5, 6}, {0, 2, 3, 7}, {0, 6, 2, 7}, {0, 4, 6, 7}};
344 {0, 1, 2, 6}, {6, 6, 2, 6}, {6, 6, 5, 1}, {0, 6, 3, 4}, {6, 6, 3, 6}, {6, 4, 5, 6}};
345 return {{0, 1, 2, 5}, {0, 2, 6, 5}, {0, 6, 4, 5}, {0, 2, 3, 7}, {0, 6, 2, 7}, {0, 4, 6, 7}};
348 {0, 6, 2, 6}, {1, 6, 2, 6}, {1, 6, 5, 6}, {4, 6, 5, 6}, {4, 6, 3, 6}, {0, 6, 3, 6}};
349 return {{0, 1, 2, 6}, {0, 5, 1, 6}, {0, 4, 5, 6}, {0, 7, 4, 6}, {0, 3, 7, 6}, {0, 2, 3, 6}};
352 {4, 6, 5, 1}, {6, 6, 5, 6}, {6, 1, 2, 6}, {4, 0, 3, 6}, {6, 6, 3, 6}, {6, 6, 2, 0}};
353 return {{0, 7, 4, 5}, {0, 6, 7, 5}, {0, 1, 6, 5}, {0, 3, 7, 2}, {0, 7, 6, 2}, {0, 6, 1, 2}};
355 tet_face_indices = {{0, 1, 2, 6}, {0, 6, 3, 4}, {5, 4, 6, 1}, {5, 6, 3, 2}, {6, 6, 6, 6}};
356 return {{0, 1, 2, 5}, {0, 2, 3, 7}, {4, 7, 5, 0}, {5, 7, 6, 2}, {0, 2, 7, 5}};
359 {4, 6, 5, 1}, {6, 6, 5, 6}, {6, 1, 2, 6}, {2, 6, 6, 0}, {3, 6, 6, 0}, {3, 6, 6, 4}};
360 return {{0, 7, 4, 5}, {0, 6, 7, 5}, {0, 1, 6, 5}, {1, 6, 2, 0}, {2, 6, 3, 0}, {3, 6, 7, 0}};
363 {1, 4, 5, 6}, {6, 6, 5, 6}, {6, 6, 3, 4}, {1, 6, 2, 0}, {6, 6, 2, 6}, {6, 0, 3, 6}};
364 return {{0, 4, 5, 7}, {0, 5, 6, 7}, {0, 6, 3, 7}, {0, 5, 1, 2}, {0, 6, 5, 2}, {0, 3, 6, 2}};
372 const unsigned int sec_min_pos,
373 std::vector<unsigned int> & face_rotation,
374 std::vector<unsigned int> & node_rotation)
380 const std::vector<std::vector<std::vector<unsigned int>>> preset_indices = {
381 {{0, 1, 2, 3, 4, 5, 6, 7}, {0, 3, 7, 4, 1, 2, 6, 5}, {0, 4, 5, 1, 3, 7, 6, 2}},
382 {{1, 0, 4, 5, 2, 3, 7, 6}, {1, 2, 3, 0, 5, 6, 7, 4}, {1, 5, 6, 2, 0, 4, 7, 3}},
383 {{2, 3, 0, 1, 6, 7, 4, 5}, {2, 1, 5, 6, 3, 0, 4, 7}, {2, 6, 7, 3, 1, 5, 4, 0}},
384 {{3, 2, 6, 7, 0, 1, 5, 4}, {3, 0, 1, 2, 7, 4, 5, 6}, {3, 7, 4, 0, 2, 6, 5, 1}},
385 {{4, 5, 1, 0, 7, 6, 2, 3}, {4, 7, 6, 5, 0, 3, 2, 1}, {4, 0, 3, 7, 5, 1, 2, 6}},
386 {{5, 4, 7, 6, 1, 0, 3, 2}, {5, 6, 2, 1, 4, 7, 3, 0}, {5, 1, 0, 4, 6, 2, 3, 7}},
387 {{6, 7, 3, 2, 5, 4, 0, 1}, {6, 5, 4, 7, 2, 1, 0, 3}, {6, 2, 1, 5, 7, 3, 0, 4}},
388 {{7, 6, 5, 4, 3, 2, 1, 0}, {7, 4, 0, 3, 6, 5, 1, 2}, {7, 3, 2, 6, 4, 0, 1, 5}}};
390 const std::vector<std::vector<std::vector<unsigned int>>> preset_face_indices = {
391 {{0, 1, 2, 3, 4, 5}, {4, 0, 3, 5, 1, 2}, {1, 4, 5, 2, 0, 3}},
392 {{1, 0, 4, 5, 2, 3}, {0, 2, 3, 4, 1, 5}, {2, 1, 5, 3, 0, 4}},
393 {{0, 3, 4, 1, 2, 5}, {2, 0, 1, 5, 3, 4}, {3, 2, 5, 4, 0, 1}},
394 {{3, 0, 2, 5, 4, 1}, {0, 4, 1, 2, 3, 5}, {4, 3, 5, 1, 0, 2}},
395 {{1, 5, 2, 0, 4, 3}, {5, 4, 3, 2, 1, 0}, {4, 1, 0, 3, 5, 2}},
396 {{5, 1, 4, 3, 2, 0}, {2, 5, 3, 0, 1, 4}, {1, 2, 0, 4, 5, 3}},
397 {{3, 5, 4, 0, 2, 1}, {5, 2, 1, 4, 3, 0}, {2, 3, 0, 1, 5, 4}},
398 {{5, 3, 2, 1, 4, 0}, {4, 5, 1, 0, 3, 2}, {3, 4, 0, 2, 5, 1}}};
400 if (min_id_index > 7 || sec_min_pos > 2)
401 mooseError(
"The input node index is out of range.");
405 face_rotation = preset_face_indices[min_id_index][sec_min_pos];
406 node_rotation = preset_indices[min_id_index][sec_min_pos];
412 std::vector<unsigned int> & face_rotation,
413 std::vector<unsigned int> & node_rotation)
415 const std::vector<std::vector<unsigned int>> preset_indices = {{0, 1, 2, 3, 4, 5},
422 const std::vector<std::vector<unsigned int>> preset_face_indices = {{0, 1, 2, 3, 4},
429 if (min_id_index > 5)
430 mooseError(
"The input node index is out of range.");
434 face_rotation = preset_face_indices[min_id_index];
435 node_rotation = preset_indices[min_id_index];
441 std::vector<std::vector<unsigned int>> & rotated_tet_face_indices,
442 std::vector<std::vector<const Node *>> & tet_nodes_list)
445 std::vector<dof_id_type> node_ids(6);
446 for (
unsigned int i = 0; i < 6; i++)
447 node_ids[i] = prism_nodes[i]->
id();
449 const unsigned int min_node_id_index = std::distance(
450 std::begin(node_ids), std::min_element(std::begin(node_ids), std::end(node_ids)));
455 std::vector<unsigned int> face_rotation;
456 std::vector<unsigned int> rotated_indices;
458 std::vector<const Node *> rotated_prism_nodes;
459 for (
unsigned int i = 0; i < 6; i++)
460 rotated_prism_nodes.push_back(prism_nodes[rotated_indices[i]]);
462 std::vector<const Node *> key_quad_nodes = {rotated_prism_nodes[1],
463 rotated_prism_nodes[2],
464 rotated_prism_nodes[5],
465 rotated_prism_nodes[4]};
472 std::vector<std::vector<unsigned int>> tet_face_indices;
473 const auto tet_nodes_set =
tetNodesForPrism(diagonal_direction, tet_face_indices);
474 for (
const auto & tet_face_index : tet_face_indices)
476 rotated_tet_face_indices.push_back(std::vector<unsigned int>());
477 for (
const auto & face_index : tet_face_index)
480 rotated_tet_face_indices.back().push_back(face_rotation[face_index]);
482 rotated_tet_face_indices.back().push_back(5);
486 for (
const auto & tet_nodes : tet_nodes_set)
488 tet_nodes_list.push_back(std::vector<const Node *>());
489 for (
const auto & tet_node : tet_nodes)
490 tet_nodes_list.back().push_back(rotated_prism_nodes[tet_node]);
494 std::vector<std::vector<unsigned int>>
496 std::vector<std::vector<unsigned int>> & tet_face_indices)
499 if (diagonal_direction)
501 tet_face_indices = {{4, 3, 5, 1}, {2, 1, 5, 5}, {2, 5, 3, 0}};
502 return {{3, 5, 4, 0}, {1, 4, 5, 0}, {1, 5, 2, 0}};
506 tet_face_indices = {{4, 3, 5, 1}, {2, 1, 5, 0}, {2, 5, 5, 3}};
507 return {{3, 5, 4, 0}, {1, 4, 2, 0}, {2, 4, 5, 0}};
513 std::vector<unsigned int> & face_rotation,
514 std::vector<unsigned int> & node_rotation)
516 const std::vector<std::vector<unsigned int>> preset_indices = {
517 {0, 1, 2, 3, 4}, {1, 2, 3, 0, 4}, {2, 3, 0, 1, 4}, {3, 0, 1, 2, 4}};
519 const std::vector<std::vector<unsigned int>> preset_face_indices = {
520 {0, 1, 2, 3, 4}, {1, 2, 3, 0, 4}, {2, 3, 0, 1, 4}, {3, 0, 1, 2, 4}};
522 if (min_id_index > 3)
523 mooseError(
"The input node index is out of range.");
527 face_rotation = preset_face_indices[min_id_index];
528 node_rotation = preset_indices[min_id_index];
534 std::vector<std::vector<unsigned int>> & rotated_tet_face_indices,
535 std::vector<std::vector<const Node *>> & tet_nodes_list)
538 std::vector<dof_id_type> node_ids(4);
539 for (
unsigned int i = 0; i < 4; i++)
540 node_ids[i] = pyramid_nodes[i]->
id();
542 const unsigned int min_node_id_index = std::distance(
543 std::begin(node_ids), std::min_element(std::begin(node_ids), std::end(node_ids)));
548 std::vector<unsigned int> face_rotation;
549 std::vector<unsigned int> rotated_indices;
551 std::vector<const Node *> rotated_pyramid_nodes;
552 for (
unsigned int i = 0; i < 5; i++)
553 rotated_pyramid_nodes.push_back(pyramid_nodes[rotated_indices[i]]);
556 const std::vector<std::vector<unsigned int>> tet_nodes_set = {{0, 1, 2, 4}, {0, 2, 3, 4}};
557 const std::vector<std::vector<unsigned int>> tet_face_indices = {{4, 0, 1, 5}, {4, 5, 2, 3}};
561 for (
const auto & tet_face_index : tet_face_indices)
563 rotated_tet_face_indices.push_back(std::vector<unsigned int>());
564 for (
const auto & face_index : tet_face_index)
567 rotated_tet_face_indices.back().push_back(face_rotation[face_index]);
569 rotated_tet_face_indices.back().push_back(5);
573 for (
const auto & tet_nodes : tet_nodes_set)
575 tet_nodes_list.push_back(std::vector<const Node *>());
576 for (
const auto & tet_node : tet_nodes)
577 tet_nodes_list.back().push_back(rotated_pyramid_nodes[tet_node]);
583 const std::vector<std::pair<dof_id_type, bool>> & elems_to_process,
584 std::vector<dof_id_type> & converted_elems_ids_to_track,
586 const bool delete_block_to_remove)
588 std::vector<dof_id_type> converted_elems_ids_to_retain;
592 for (
const auto & elem_to_process : elems_to_process)
599 elem_to_process.first,
600 elem_to_process.second ? converted_elems_ids_to_track
601 : converted_elems_ids_to_retain);
604 case ElemType::PYRAMID5:
607 elem_to_process.first,
608 elem_to_process.second ? converted_elems_ids_to_track
609 : converted_elems_ids_to_retain);
612 case ElemType::PRISM6:
615 elem_to_process.first,
616 elem_to_process.second ? converted_elems_ids_to_track
617 : converted_elems_ids_to_retain);
621 if (elem_to_process.second)
622 converted_elems_ids_to_track.push_back(elem_to_process.first);
624 converted_elems_ids_to_retain.push_back(elem_to_process.first);
631 if (delete_block_to_remove)
633 for (
auto elem_it =
mesh.active_subdomain_elements_begin(block_id_to_remove);
634 elem_it !=
mesh.active_subdomain_elements_end(block_id_to_remove);
647 std::set<subdomain_id_type> subdomain_ids_set;
651 std::vector<std::pair<dof_id_type, bool>> original_elems;
653 for (
auto elem_it =
mesh.active_elements_begin(); elem_it !=
mesh.active_elements_end();
656 if ((*elem_it)->default_order() != Order::FIRST)
657 mooseError(
"Only first order elements are supported for cutting.");
658 original_elems.push_back(std::make_pair((*elem_it)->id(),
false));
661 std::vector<dof_id_type> converted_elems_ids_to_track;
664 mesh, original_elems, converted_elems_ids_to_track, block_id_to_remove,
true);
670 const unsigned short n_elem_sides,
671 std::vector<std::vector<boundary_id_type>> & elem_side_list)
673 elem_side_list.resize(n_elem_sides);
674 const auto selected_bdry_side_list =
675 std::equal_range(bdry_side_list.begin(), bdry_side_list.end(), elem_id,
BCTupleKeyComp{});
676 for (
auto selected_bdry_side = selected_bdry_side_list.first;
677 selected_bdry_side != selected_bdry_side_list.second;
678 ++selected_bdry_side)
680 elem_side_list[std::get<1>(*selected_bdry_side)].push_back(std::get<2>(*selected_bdry_side));
void pyramidElemSplitter(ReplicatedMesh &mesh, const std::vector< libMesh::BoundaryInfo::BCTuple > &bdry_side_list, const dof_id_type elem_id, std::vector< dof_id_type > &converted_elems_ids)
std::vector< bool > quadFaceDiagonalDirectionsHex(const std::vector< const Node *> &hex_nodes)
void nodeRotationHEX8(const unsigned int min_id_index, const unsigned int sec_min_pos, std::vector< unsigned int > &face_rotation, std::vector< unsigned int > &node_rotation)
Rotate a HEX8 element's nodes to ensure that the node with the minimum id is the first node; and the ...
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
void prepare_for_use(const bool skip_renumber_nodes_and_elements, const bool skip_find_neighbors)
unsigned int n_elem_integers() const
bool quadFaceDiagonalDirection(const std::vector< const Node *> &quad_nodes)
void hexNodesToTetNodesDeterminer(std::vector< const Node *> &hex_nodes, std::vector< std::vector< unsigned int >> &rotated_tet_face_indices, std::vector< std::vector< const Node *>> &tet_nodes_list)
void elementBoundaryInfoCollector(const std::vector< libMesh::BoundaryInfo::BCTuple > &bdry_side_list, const dof_id_type elem_id, const unsigned short n_elem_sides, std::vector< std::vector< boundary_id_type >> &elem_side_list)
Collect the boundary information of the given element in a mesh.
std::vector< unsigned int > neighborNodeIndicesHEX8(unsigned int min_id_index)
Calculate the indices (within the element nodes) of the three neighboring nodes of a node in a HEX8 e...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
const BoundaryInfo & get_boundary_info() const
void convert3DMeshToAllTet4(ReplicatedMesh &mesh)
void build_side_list(std::vector< dof_id_type > &element_id_list, std::vector< unsigned short int > &side_list, std::vector< boundary_id_type > &bc_id_list) const
std::vector< std::vector< unsigned int > > tetNodesForPrism(const bool diagonal_direction, std::vector< std::vector< unsigned int >> &tet_face_indices)
Creates sets of four nodes indices that can form TET4 elements to replace the original PRISM6 element...
virtual void delete_elem(Elem *e)=0
virtual Elem * add_elem(Elem *e)=0
void nodeRotationPRISM6(unsigned int min_id_index, std::vector< unsigned int > &face_rotation, std::vector< unsigned int > &node_rotation)
Rotate a PRISM6 element nodes to ensure that the node with the minimum id is the first node...
void subdomain_ids(std::set< subdomain_id_type > &ids, const bool global=true) const
void nodeRotationPYRAMID5(unsigned int min_id_index, std::vector< unsigned int > &face_rotation, std::vector< unsigned int > &node_rotation)
Rotate a PYRAMID5 element nodes to ensure that the node with the minimum id is the first node for the...
virtual const Elem * elem_ptr(const dof_id_type i) const=0
void prismElemSplitter(ReplicatedMesh &mesh, const std::vector< libMesh::BoundaryInfo::BCTuple > &bdry_side_list, const dof_id_type elem_id, std::vector< dof_id_type > &converted_elems_ids)
virtual bool contract()=0
subdomain_id_type subdomain_id() const
const Node * node_ptr(const unsigned int i) const
void pyramidNodesToTetNodesDeterminer(std::vector< const Node *> &pyramid_nodes, std::vector< std::vector< unsigned int >> &rotated_tet_face_indices, std::vector< std::vector< const Node *>> &tet_nodes_list)
void hexElemSplitter(ReplicatedMesh &mesh, const std::vector< libMesh::BoundaryInfo::BCTuple > &bdry_side_list, const dof_id_type elem_id, std::vector< dof_id_type > &converted_elems_ids)
void add_side(const dof_id_type elem, const unsigned short int side, const boundary_id_type id)
std::vector< std::vector< unsigned int > > tetNodesForHex(const std::vector< bool > diagonal_directions, std::vector< std::vector< unsigned int >> &tet_face_indices)
Creates sets of four nodes indices that can form TET4 elements to replace the original HEX8 element...
void prismNodesToTetNodesDeterminer(std::vector< const Node *> &prism_nodes, std::vector< std::vector< unsigned int >> &rotated_tet_face_indices, std::vector< std::vector< const Node *>> &tet_nodes_list)
virtual ElemType type() const=0
auto index_range(const T &sizable)
dof_id_type get_extra_integer(const unsigned int index) const