113 BoundaryInfo & boundary_info =
mesh->get_boundary_info();
117 std::vector<Real> radii_all_circles;
118 std::vector<Real> cum_num_rings(
_radii.size());
123 cum_num_rings[j] = ((j > 0) ? cum_num_rings[j - 1] : 0) +
_rings[j];
136 radii_all_circles.push_back(
_radii[j - 1] +
148 Real original_radius = 0.0;
149 for (
unsigned i = 0; i < radii_all_circles.size(); ++i)
154 const Real target_area = M_PI * Utility::pow<2>(radii_all_circles[i]);
155 Real modified_radius = std::sqrt(2 * target_area / std::sin(d_angle) /
_num_sectors / 4);
156 original_radius = radii_all_circles[i];
157 radii_all_circles[i] = modified_radius;
162 const Real target_area =
163 M_PI * (Utility::pow<2>(radii_all_circles[i]) - Utility::pow<2>(original_radius));
164 Real modified_radius = std::sqrt(target_area / std::sin(d_angle) /
_num_sectors / 2 +
165 Utility::pow<2>(radii_all_circles[i - 1]));
166 original_radius = radii_all_circles[i];
167 radii_all_circles[i] = modified_radius;
173 unsigned num_total_nodes = 0;
176 num_total_nodes = Utility::pow<2>(
_num_sectors / 2 + 1) +
183 std::vector<Node *> nodes(num_total_nodes);
185 unsigned node_id = 0;
189 Point p1 = Point(xx, 0, 0);
190 Point p2 = Point(0, xx, 0);
191 Point p3 = Point(xx * std::sqrt(2.0) / 2, xx * std::sqrt(2.0) / 2, 0);
198 Point p = p1 * fx * (1 - fy) + p2 * fy * (1 - fx) + p3 * fx * fy;
199 nodes[node_id] =
mesh->add_point(p, node_id);
205 Real current_radius = radii_all_circles[0];
208 for (
unsigned layers = 0; layers < radii_all_circles.size(); ++layers)
210 current_radius = radii_all_circles[layers];
211 for (
unsigned num_outer_nodes = 0; num_outer_nodes <=
_num_sectors; ++num_outer_nodes)
213 const Real x = current_radius * std::cos(num_outer_nodes * d_angle);
214 const Real y = current_radius * std::sin(num_outer_nodes * d_angle);
215 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
230 const Real b1 =
_pitch / 2;
232 const Real a2 = radii_all_circles.back() * std::cos(M_PI / 2 - i * d_angle);
233 const Real b2 = radii_all_circles.back() * std::sin(M_PI / 2 - i * d_angle);
235 for (
unsigned j = 0; j <=
_rings.back(); ++j)
237 Real x = ((
_rings.back() + 1 - j) * a1 + j * a2) / (
_rings.back() + 1);
238 Real y = ((
_rings.back() + 1 - j) * b1 + j * b2) / (
_rings.back() + 1);
239 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
245 for (
unsigned i = 1; i <=
_rings.back() + 1; ++i)
249 const Real b1 =
_pitch / 2;
251 const Real a2 =
_pitch / 2;
254 const Real a3 = radii_all_circles.back() * std::cos(M_PI / 4);
255 const Real b3 = radii_all_circles.back() * std::sin(M_PI / 4);
257 const Real a4 = ((
_rings.back() + 1 - k) * a3 + k * a2) / (
_rings.back() + 1);
258 const Real b4 = ((
_rings.back() + 1 - k) * b3 + k * b2) / (
_rings.back() + 1);
260 for (
unsigned j = 0; j <=
_rings.back() + 1; ++j)
262 Real x = ((
_rings.back() + 1 - j) * a1 + j * a4) / (
_rings.back() + 1);
263 Real y = ((
_rings.back() + 1 - j) * b1 + j * b4) / (
_rings.back() + 1);
264 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
273 const Real a1 =
_pitch / 2;
277 const Real a2 = radii_all_circles.back() * std::cos(M_PI / 4 - i * d_angle);
278 const Real b2 = radii_all_circles.back() * std::sin(M_PI / 4 - i * d_angle);
280 for (
unsigned j = 0; j <=
_rings.back(); ++j)
282 Real x = ((
_rings.back() + 1 - j) * a1 + j * a2) / (
_rings.back() + 1);
283 Real y = ((
_rings.back() + 1 - j) * b1 + j * b2) / (
_rings.back() + 1);
284 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
299 int additional_term = 0;
300 int counter = standard;
303 counter = counter - 2;
304 additional_term = additional_term + counter;
306 limit = standard + additional_term;
308 else if (standard == 4)
312 std::vector<unsigned int> subdomainIDs;
317 subdomainIDs.push_back(i + 1);
320 subdomainIDs.push_back(subdomainIDs.back() + 1);
323 while (index <= limit)
326 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
327 elem->set_node(0, nodes[index]);
330 elem->set_node(3, nodes[index + 1]);
331 elem->subdomain_id() = subdomainIDs[0];
333 if (index < standard / 2)
334 boundary_info.add_side(elem, 3, 1);
335 if (index % (standard / 2 + 1) == 0)
336 boundary_info.add_side(elem, 0, 2);
341 if ((index - standard / 2) % (standard / 2 + 1) == 0)
349 while (index < limit)
352 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
353 elem->set_node(0, nodes[index]);
356 elem->set_node(3, nodes[index + 1]);
357 elem->subdomain_id() = subdomainIDs[0];
359 if (index == (standard / 2 + 1) * (standard / 2))
360 boundary_info.add_side(elem, 0, 2);
367 while (index != standard / 2)
370 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
371 elem->set_node(0, nodes[index]);
375 elem->subdomain_id() = subdomainIDs[0];
377 if (index == standard + 1)
378 boundary_info.add_side(elem, 2, 1);
386 index = Utility::pow<2>(standard / 2 + 1);
387 limit = Utility::pow<2>(standard / 2 + 1) + (
_num_sectors + 1) * (radii_all_circles.size() - 1);
389 int num_nodes_boundary = Utility::pow<2>(standard / 2 + 1) + standard + 1;
391 while (index < limit)
393 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
394 elem->set_node(0, nodes[index]);
395 elem->set_node(1, nodes[index + standard + 1]);
396 elem->set_node(2, nodes[index + standard + 2]);
397 elem->set_node(3, nodes[index + 1]);
400 const auto ring = counter + 1;
403 if (i > 0 && ring >= cum_num_rings[i - 1] && ring < cum_num_rings[i])
404 elem->subdomain_id() = subdomainIDs[i];
405 else if (i == 0 && ring < cum_num_rings[0])
406 elem->subdomain_id() = subdomainIDs[0];
409 const int initial = Utility::pow<2>(standard / 2 + 1);
410 const int final = Utility::pow<2>(standard / 2 + 1) + standard - 1;
412 if ((index - initial) % (standard + 1) == 0)
413 boundary_info.add_side(elem, 0, 2);
414 if ((index -
final) % (standard + 1) == 0)
415 boundary_info.add_side(elem, 2, 1);
417 if (index >= limit - (standard + 1))
418 boundary_info.add_side(elem, 1, 3);
425 if (index == (num_nodes_boundary + counter * (standard + 1)) - 1)
439 int initial = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size();
441 int initial2 = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size();
447 index = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size();
448 limit = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
449 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 3 -
451 while (index <= limit)
454 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
455 elem->set_node(0, nodes[index]);
456 elem->set_node(1, nodes[index + 1]);
457 elem->set_node(2, nodes[index + 1 +
_rings.back() + 1]);
458 elem->set_node(3, nodes[index + 1 +
_rings.back()]);
459 elem->subdomain_id() = subdomainIDs.back();
461 if (index < (initial2 +
static_cast<int>(
_rings.back())))
462 boundary_info.add_side(elem, 0, 1);
464 if (index == initial)
465 boundary_info.add_side(elem, 3, 4);
471 if ((index - initial) %
static_cast<int>(
_rings.back()) == 0)
474 initial = initial + (
static_cast<int>(
_rings.back()) + 1);
479 initial = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
480 (
_rings.back() + 1) * (standard / 2 + 1);
482 limit = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
483 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 3 -
486 while (index <= limit)
489 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
490 elem->set_node(3, nodes[index]);
491 elem->set_node(2, nodes[index +
_rings.back() + 2]);
492 elem->set_node(1, nodes[index +
_rings.back() + 3]);
493 elem->set_node(0, nodes[index + 1]);
494 elem->subdomain_id() = subdomainIDs.back();
496 if (index >=
static_cast<int>(limit - (
_rings.back() + 1)))
497 boundary_info.add_side(elem, 1, 3);
499 if ((index - initial) %
static_cast<int>(
_rings.back() + 2) == 0)
500 boundary_info.add_side(elem, 2, 4);
504 if ((index - initial) %
static_cast<int>(
_rings.back() + 1) == 0)
507 initial = initial + (
static_cast<int>(
_rings.back()) + 2);
512 int index1 = Utility::pow<2>(standard / 2 + 1) +
513 (standard + 1) * (radii_all_circles.size() - 1) + standard / 2;
515 int index2 = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
516 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 3 -
520 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
521 elem->set_node(3, nodes[index1]);
522 elem->set_node(2, nodes[index2]);
523 elem->set_node(1, nodes[index2 +
_rings.back() + 1]);
524 elem->set_node(0, nodes[index2 +
_rings.back() + 2]);
525 elem->subdomain_id() = subdomainIDs.back();
528 index = Utility::pow<2>(standard / 2 + 1) + standard / 2 +
529 (standard + 1) * (radii_all_circles.size() - 1);
530 limit = index + standard / 2 - 1;
532 while (index <= limit)
535 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
536 elem->set_node(3, nodes[index]);
537 elem->set_node(2, nodes[index + 1]);
538 elem->set_node(1, nodes[index2 -
_rings.back() - 1]);
539 elem->set_node(0, nodes[index2]);
540 elem->subdomain_id() = subdomainIDs.back();
543 boundary_info.add_side(elem, 1, 1);
548 index2 = index2 -
_rings.back() - 1;
552 index1 = Utility::pow<2>(standard / 2 + 1) + standard / 2 +
553 (standard + 1) * (radii_all_circles.size() - 1);
554 index2 = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
555 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 2 +
557 int index3 = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
558 (
_rings.back() + 1) * (standard / 2) - 1 + (
_rings.back() + 1) +
562 elem =
mesh->add_elem(std::make_unique<Quad4>());
563 elem->set_node(0, nodes[index1]);
564 elem->set_node(1, nodes[index1 - 1]);
565 elem->set_node(2, nodes[index2]);
566 elem->set_node(3, nodes[index3]);
567 elem->subdomain_id() = subdomainIDs.back();
570 boundary_info.add_side(elem, 1, 2);
574 index = Utility::pow<2>(standard / 2 + 1) + standard / 2 +
575 (standard + 1) * (radii_all_circles.size() - 1) - 2;
576 index1 = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
577 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 2 +
580 limit = Utility::pow<2>(standard / 2 + 1) + standard / 2 +
581 (standard + 1) * (radii_all_circles.size() - 1) - standard / 2;
585 while (index >= limit)
588 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
589 elem->set_node(0, nodes[index]);
590 elem->set_node(1, nodes[index1]);
591 elem->set_node(2, nodes[index1 - (
_rings.back() + 1)]);
592 elem->set_node(3, nodes[index + 1]);
593 elem->subdomain_id() = subdomainIDs.back();
596 boundary_info.add_side(elem, 0, 2);
598 index1 = index1 + (
_rings.back() + 1);
603 index = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
604 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 2;
606 index1 = index - (
_rings.back() + 2);
611 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
612 elem->set_node(3, nodes[index]);
613 elem->set_node(2, nodes[index + 1]);
614 elem->set_node(1, nodes[index + 2]);
615 elem->set_node(0, nodes[index1]);
616 elem->subdomain_id() = subdomainIDs.back();
618 boundary_info.add_side(elem, 2, 3);
621 boundary_info.add_side(elem, 1, 2);
624 index = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
625 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 2 -
628 limit = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
629 (
_rings.back() + 1) * (standard / 2) + (
_rings.back() + 2) * 2 - 2;
632 while (index > limit)
634 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
635 elem->set_node(3, nodes[index]);
636 elem->set_node(2, nodes[index + (
_rings.back() + 2) * k + k + 1]);
637 elem->set_node(1, nodes[index + (
_rings.back() + 2) * k + k + 2]);
638 elem->set_node(0, nodes[index -
_rings.back() - 2]);
639 elem->subdomain_id() = subdomainIDs.back();
640 index = index - (
_rings.back() + 2);
644 boundary_info.add_side(elem, 1, 2);
647 index = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
648 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 1;
649 initial = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
650 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 1;
651 limit = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
652 (
_rings.back() + 1) * (standard / 2) * 2 + Utility::pow<2>(
_rings.back() + 2) - 2 -
655 initial2 = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * radii_all_circles.size() +
656 (
_rings.back() + 1) * (standard / 2) * 2 + Utility::pow<2>(
_rings.back() + 2) - 2 -
661 while (index < limit)
663 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
664 elem->set_node(0, nodes[index]);
665 elem->set_node(1, nodes[index + 1]);
666 elem->set_node(2, nodes[index + 1 +
_rings.back() + 1]);
667 elem->set_node(3, nodes[index + 1 +
_rings.back()]);
668 elem->subdomain_id() = subdomainIDs.back();
670 if (index > initial2)
671 boundary_info.add_side(elem, 2, 2);
673 if ((index - initial) == 0)
674 boundary_info.add_side(elem, 3, 3);
678 if ((index - initial) %
static_cast<int>(
_rings.back()) == 0)
681 initial = initial + (
static_cast<int>(
_rings.back()) + 1);
702 MeshTools::Modification::rotate(*
mesh, 90, 0, 0);
716 MeshTools::Modification::rotate(*
mesh, 180, 0, 0);
728 else if (
_portion ==
"bottom_right")
730 MeshTools::Modification::rotate(*
mesh, 270, 0, 0);
745 ReplicatedMesh other_mesh(*
mesh);
747 MeshTools::Modification::rotate(other_mesh, 90, 0, 0);
750 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
751 MeshTools::Modification::change_boundary_id(other_mesh, 2, 6);
752 MeshTools::Modification::change_boundary_id(other_mesh, 3, 7);
753 MeshTools::Modification::change_boundary_id(other_mesh, 4, 1);
754 MeshTools::Modification::change_boundary_id(other_mesh, 5, 2);
755 MeshTools::Modification::change_boundary_id(other_mesh, 6, 3);
756 MeshTools::Modification::change_boundary_id(other_mesh, 7, 4);
757 mesh->prepare_for_use();
758 other_mesh.prepare_for_use();
759 mesh->stitch_meshes(other_mesh, 1, 3, TOLERANCE,
true,
false);
767 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
768 MeshTools::Modification::change_boundary_id(other_mesh, 2, 1);
769 MeshTools::Modification::change_boundary_id(other_mesh, 5, 2);
770 mesh->prepare_for_use();
771 other_mesh.prepare_for_use();
772 mesh->stitch_meshes(other_mesh, 1, 1, TOLERANCE,
true,
false);
774 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
775 MeshTools::Modification::change_boundary_id(*
mesh, 3, 2);
784 ReplicatedMesh other_mesh(*
mesh);
786 MeshTools::Modification::rotate(other_mesh, 270, 0, 0);
789 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
790 MeshTools::Modification::change_boundary_id(other_mesh, 2, 6);
791 MeshTools::Modification::change_boundary_id(other_mesh, 3, 7);
792 MeshTools::Modification::change_boundary_id(other_mesh, 4, 3);
793 MeshTools::Modification::change_boundary_id(other_mesh, 5, 4);
794 MeshTools::Modification::change_boundary_id(other_mesh, 6, 1);
795 MeshTools::Modification::change_boundary_id(other_mesh, 7, 2);
796 mesh->prepare_for_use();
797 other_mesh.prepare_for_use();
798 mesh->stitch_meshes(other_mesh, 2, 4, TOLERANCE,
true,
false);
806 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
807 MeshTools::Modification::change_boundary_id(other_mesh, 2, 1);
808 MeshTools::Modification::change_boundary_id(other_mesh, 5, 2);
809 mesh->prepare_for_use();
810 other_mesh.prepare_for_use();
811 mesh->stitch_meshes(other_mesh, 2, 2, TOLERANCE,
true,
false);
813 MeshTools::Modification::change_boundary_id(*
mesh, 3, 2);
821 ReplicatedMesh other_mesh(*
mesh);
824 MeshTools::Modification::rotate(other_mesh, 90, 0, 0);
825 MeshTools::Modification::rotate(*
mesh, 180, 0, 0);
829 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
830 MeshTools::Modification::change_boundary_id(other_mesh, 2, 6);
831 MeshTools::Modification::change_boundary_id(other_mesh, 3, 7);
832 MeshTools::Modification::change_boundary_id(other_mesh, 4, 1);
833 MeshTools::Modification::change_boundary_id(other_mesh, 5, 2);
834 MeshTools::Modification::change_boundary_id(other_mesh, 6, 3);
835 MeshTools::Modification::change_boundary_id(other_mesh, 7, 4);
837 MeshTools::Modification::change_boundary_id(*
mesh, 1, 5);
838 MeshTools::Modification::change_boundary_id(*
mesh, 2, 6);
839 MeshTools::Modification::change_boundary_id(*
mesh, 3, 7);
840 MeshTools::Modification::change_boundary_id(*
mesh, 4, 2);
841 MeshTools::Modification::change_boundary_id(*
mesh, 5, 3);
842 MeshTools::Modification::change_boundary_id(*
mesh, 6, 4);
843 MeshTools::Modification::change_boundary_id(*
mesh, 7, 1);
844 mesh->prepare_for_use();
845 other_mesh.prepare_for_use();
846 mesh->stitch_meshes(other_mesh, 4, 2, TOLERANCE,
true,
false);
854 MeshTools::Modification::change_boundary_id(*
mesh, 1, 5);
855 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
856 MeshTools::Modification::change_boundary_id(*
mesh, 5, 2);
857 mesh->prepare_for_use();
858 other_mesh.prepare_for_use();
859 mesh->stitch_meshes(other_mesh, 1, 1, TOLERANCE,
true,
false);
861 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
862 MeshTools::Modification::change_boundary_id(*
mesh, 3, 2);
870 ReplicatedMesh other_mesh(*
mesh);
872 MeshTools::Modification::rotate(other_mesh, 180, 0, 0);
873 MeshTools::Modification::rotate(*
mesh, 270, 0, 0);
877 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
878 MeshTools::Modification::change_boundary_id(other_mesh, 2, 6);
879 MeshTools::Modification::change_boundary_id(other_mesh, 3, 7);
880 MeshTools::Modification::change_boundary_id(other_mesh, 4, 2);
881 MeshTools::Modification::change_boundary_id(other_mesh, 5, 3);
882 MeshTools::Modification::change_boundary_id(other_mesh, 6, 4);
883 MeshTools::Modification::change_boundary_id(other_mesh, 7, 1);
885 MeshTools::Modification::change_boundary_id(*
mesh, 1, 5);
886 MeshTools::Modification::change_boundary_id(*
mesh, 2, 6);
887 MeshTools::Modification::change_boundary_id(*
mesh, 3, 7);
888 MeshTools::Modification::change_boundary_id(*
mesh, 4, 3);
889 MeshTools::Modification::change_boundary_id(*
mesh, 5, 4);
890 MeshTools::Modification::change_boundary_id(*
mesh, 6, 1);
891 MeshTools::Modification::change_boundary_id(*
mesh, 7, 2);
892 mesh->prepare_for_use();
893 other_mesh.prepare_for_use();
894 mesh->stitch_meshes(other_mesh, 1, 3, TOLERANCE,
true,
false);
902 MeshTools::Modification::change_boundary_id(*
mesh, 1, 5);
903 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
904 MeshTools::Modification::change_boundary_id(*
mesh, 5, 2);
905 mesh->prepare_for_use();
906 other_mesh.prepare_for_use();
907 mesh->stitch_meshes(other_mesh, 1, 1, TOLERANCE,
true,
false);
909 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
910 MeshTools::Modification::change_boundary_id(*
mesh, 3, 2);
918 ReplicatedMesh portion_two(*
mesh);
921 MeshTools::Modification::rotate(portion_two, 90, 0, 0);
926 MeshTools::Modification::change_boundary_id(portion_two, 1, 5);
927 MeshTools::Modification::change_boundary_id(portion_two, 2, 6);
928 MeshTools::Modification::change_boundary_id(portion_two, 3, 7);
929 MeshTools::Modification::change_boundary_id(portion_two, 4, 1);
930 MeshTools::Modification::change_boundary_id(portion_two, 5, 2);
931 MeshTools::Modification::change_boundary_id(portion_two, 6, 3);
932 MeshTools::Modification::change_boundary_id(portion_two, 7, 4);
933 mesh->prepare_for_use();
934 portion_two.prepare_for_use();
936 mesh->stitch_meshes(portion_two, 1, 3, TOLERANCE,
true,
false);
939 ReplicatedMesh portion_bottom(*
mesh);
940 MeshTools::Modification::rotate(portion_bottom, 180, 0, 0);
941 MeshTools::Modification::change_boundary_id(portion_bottom, 1, 5);
942 MeshTools::Modification::change_boundary_id(portion_bottom, 2, 6);
943 MeshTools::Modification::change_boundary_id(portion_bottom, 3, 7);
944 MeshTools::Modification::change_boundary_id(portion_bottom, 4, 2);
945 MeshTools::Modification::change_boundary_id(portion_bottom, 5, 3);
946 MeshTools::Modification::change_boundary_id(portion_bottom, 6, 4);
947 MeshTools::Modification::change_boundary_id(portion_bottom, 7, 1);
948 mesh->prepare_for_use();
949 portion_bottom.prepare_for_use();
951 mesh->stitch_meshes(portion_bottom, 2, 4, TOLERANCE,
true,
false);
957 portion_bottom.clear();
961 MeshTools::Modification::change_boundary_id(portion_two, 1, 5);
962 MeshTools::Modification::change_boundary_id(portion_two, 2, 1);
963 MeshTools::Modification::change_boundary_id(portion_two, 5, 2);
965 mesh->prepare_for_use();
966 portion_two.prepare_for_use();
967 mesh->stitch_meshes(portion_two, 1, 1, TOLERANCE,
true,
false);
969 ReplicatedMesh portion_bottom(*
mesh);
970 MeshTools::Modification::rotate(portion_bottom, 180, 0, 0);
972 mesh->prepare_for_use();
973 portion_bottom.prepare_for_use();
974 mesh->stitch_meshes(portion_bottom, 2, 2, TOLERANCE,
true,
false);
975 MeshTools::Modification::change_boundary_id(*
mesh, 3, 1);
977 portion_bottom.clear();
984 mesh->prepare_for_use();
993 const auto & subdomain_names = getParam<std::vector<SubdomainName>>(
"subdomain_name");
994 if (subdomain_names.size() == subdomainIDs.size())
995 for (
const auto i : index_range(subdomain_names))
996 mesh->set_subdomain_name(subdomainIDs[i], subdomain_names[i],
true);
999 "Parameter (size: " + std::to_string(subdomain_names.size()) +
1000 ") must be the same size as the number of rings (= " +
1005 mesh->prepare_for_use();
1006 return dynamic_pointer_cast<MeshBase>(
mesh);