110 BoundaryInfo & boundary_info =
mesh->get_boundary_info();
114 std::vector<Real> total_concentric_circles;
129 total_concentric_circles.push_back(
_radii[j - 1] +
141 Real original_radius = 0.0;
142 for (
unsigned i = 0; i < total_concentric_circles.size(); ++i)
147 const Real target_area = M_PI * Utility::pow<2>(total_concentric_circles[i]);
148 Real modified_radius = std::sqrt(2 * target_area / std::sin(d_angle) /
_num_sectors / 4);
149 original_radius = total_concentric_circles[i];
150 total_concentric_circles[i] = modified_radius;
155 const Real target_area = M_PI * (Utility::pow<2>(total_concentric_circles[i]) -
156 Utility::pow<2>(original_radius));
157 Real modified_radius = std::sqrt(target_area / std::sin(d_angle) /
_num_sectors / 2 +
158 Utility::pow<2>(total_concentric_circles[i - 1]));
159 original_radius = total_concentric_circles[i];
160 total_concentric_circles[i] = modified_radius;
166 unsigned num_total_nodes = 0;
169 num_total_nodes = Utility::pow<2>(
_num_sectors / 2 + 1) +
173 num_total_nodes = Utility::pow<2>(
_num_sectors / 2 + 1) +
176 std::vector<Node *> nodes(num_total_nodes);
178 unsigned node_id = 0;
182 Point p1 = Point(xx, 0, 0);
183 Point p2 = Point(0, xx, 0);
184 Point p3 = Point(xx * std::sqrt(2.0) / 2, xx * std::sqrt(2.0) / 2, 0);
191 Point p = p1 * fx * (1 - fy) + p2 * fy * (1 - fx) + p3 * fx * fy;
192 nodes[node_id] =
mesh->add_point(p, node_id);
198 Real current_radius = total_concentric_circles[0];
201 for (
unsigned layers = 0; layers < total_concentric_circles.size(); ++layers)
203 current_radius = total_concentric_circles[layers];
204 for (
unsigned num_outer_nodes = 0; num_outer_nodes <=
_num_sectors; ++num_outer_nodes)
206 const Real x = current_radius * std::cos(num_outer_nodes * d_angle);
207 const Real y = current_radius * std::sin(num_outer_nodes * d_angle);
208 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
223 const Real b1 =
_pitch / 2;
225 const Real a2 = total_concentric_circles.back() * std::cos(M_PI / 2 - i * d_angle);
226 const Real b2 = total_concentric_circles.back() * std::sin(M_PI / 2 - i * d_angle);
228 for (
unsigned j = 0; j <=
_rings.back(); ++j)
230 Real x = ((
_rings.back() + 1 - j) * a1 + j * a2) / (
_rings.back() + 1);
231 Real y = ((
_rings.back() + 1 - j) * b1 + j * b2) / (
_rings.back() + 1);
232 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
238 for (
unsigned i = 1; i <=
_rings.back() + 1; ++i)
242 const Real b1 =
_pitch / 2;
244 const Real a2 =
_pitch / 2;
247 const Real a3 = total_concentric_circles.back() * std::cos(M_PI / 4);
248 const Real b3 = total_concentric_circles.back() * std::sin(M_PI / 4);
250 const Real a4 = ((
_rings.back() + 1 - k) * a3 + k * a2) / (
_rings.back() + 1);
251 const Real b4 = ((
_rings.back() + 1 - k) * b3 + k * b2) / (
_rings.back() + 1);
253 for (
unsigned j = 0; j <=
_rings.back() + 1; ++j)
255 Real x = ((
_rings.back() + 1 - j) * a1 + j * a4) / (
_rings.back() + 1);
256 Real y = ((
_rings.back() + 1 - j) * b1 + j * b4) / (
_rings.back() + 1);
257 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
266 const Real a1 =
_pitch / 2;
270 const Real a2 = total_concentric_circles.back() * std::cos(M_PI / 4 - i * d_angle);
271 const Real b2 = total_concentric_circles.back() * std::sin(M_PI / 4 - i * d_angle);
273 for (
unsigned j = 0; j <=
_rings.back(); ++j)
275 Real x = ((
_rings.back() + 1 - j) * a1 + j * a2) / (
_rings.back() + 1);
276 Real y = ((
_rings.back() + 1 - j) * b1 + j * b2) / (
_rings.back() + 1);
277 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
292 int additional_term = 0;
293 int counter = standard;
296 counter = counter - 2;
297 additional_term = additional_term + counter;
299 limit = standard + additional_term;
301 else if (standard == 4)
305 std::vector<unsigned int> subdomainIDs;
308 for (
unsigned int i = 0; i <
_rings.size() - 1; ++i)
309 for (
unsigned int j = 0; j <
_rings[i]; ++j)
310 subdomainIDs.push_back(i + 1);
312 for (
unsigned int i = 0; i <
_rings.size(); ++i)
313 for (
unsigned int j = 0; j <
_rings[i]; ++j)
314 subdomainIDs.push_back(i + 1);
317 while (index <= limit)
320 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
321 elem->set_node(0, nodes[index]);
324 elem->set_node(3, nodes[index + 1]);
325 elem->subdomain_id() = subdomainIDs[0];
327 if (index < standard / 2)
328 boundary_info.add_side(elem, 3, 1);
329 if (index % (standard / 2 + 1) == 0)
330 boundary_info.add_side(elem, 0, 2);
335 if ((index - standard / 2) % (standard / 2 + 1) == 0)
343 while (index < limit)
346 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
347 elem->set_node(0, nodes[index]);
350 elem->set_node(3, nodes[index + 1]);
351 elem->subdomain_id() = subdomainIDs[0];
353 if (index == (standard / 2 + 1) * (standard / 2))
354 boundary_info.add_side(elem, 0, 2);
361 while (index != standard / 2)
364 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
365 elem->set_node(0, nodes[index]);
369 elem->subdomain_id() = subdomainIDs[0];
371 if (index == standard + 1)
372 boundary_info.add_side(elem, 2, 1);
380 index = Utility::pow<2>(standard / 2 + 1);
381 limit = Utility::pow<2>(standard / 2 + 1) +
382 (
_num_sectors + 1) * (total_concentric_circles.size() - 1);
384 int num_nodes_boundary = Utility::pow<2>(standard / 2 + 1) + standard + 1;
386 while (index < limit)
388 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
389 elem->set_node(0, nodes[index]);
390 elem->set_node(1, nodes[index + standard + 1]);
391 elem->set_node(2, nodes[index + standard + 2]);
392 elem->set_node(3, nodes[index + 1]);
394 for (
int i = 0; i < static_cast<int>(subdomainIDs.size() - 1); ++i)
395 if (index < limit - (standard + 1) * i && index >= limit - (standard + 1) * (i + 1))
396 elem->subdomain_id() = subdomainIDs[subdomainIDs.size() - 1 - i];
398 const int initial = Utility::pow<2>(standard / 2 + 1);
399 const int final = Utility::pow<2>(standard / 2 + 1) + standard - 1;
401 if ((index - initial) % (standard + 1) == 0)
402 boundary_info.add_side(elem, 0, 2);
403 if ((index -
final) % (standard + 1) == 0)
404 boundary_info.add_side(elem, 2, 1);
406 if (index >= limit - (standard + 1))
407 boundary_info.add_side(elem, 1, 3);
414 if (index == (num_nodes_boundary + counter * (standard + 1)) - 1)
429 Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size();
432 Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size();
438 index = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size();
439 limit = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
440 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 3 -
442 while (index <= limit)
445 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
446 elem->set_node(0, nodes[index]);
447 elem->set_node(1, nodes[index + 1]);
448 elem->set_node(2, nodes[index + 1 +
_rings.back() + 1]);
449 elem->set_node(3, nodes[index + 1 +
_rings.back()]);
450 elem->subdomain_id() = subdomainIDs.back() + 1;
452 if (index < (initial2 +
static_cast<int>(
_rings.back())))
453 boundary_info.add_side(elem, 0, 1);
455 if (index == initial)
456 boundary_info.add_side(elem, 3, 4);
462 if ((index - initial) %
static_cast<int>(
_rings.back()) == 0)
465 initial = initial + (
static_cast<int>(
_rings.back()) + 1);
470 initial = Utility::pow<2>(standard / 2 + 1) +
471 (standard + 1) * total_concentric_circles.size() +
472 (
_rings.back() + 1) * (standard / 2 + 1);
474 limit = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
475 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 3 -
478 while (index <= limit)
481 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
482 elem->set_node(3, nodes[index]);
483 elem->set_node(2, nodes[index +
_rings.back() + 2]);
484 elem->set_node(1, nodes[index +
_rings.back() + 3]);
485 elem->set_node(0, nodes[index + 1]);
486 elem->subdomain_id() = subdomainIDs.back() + 1;
488 if (index >=
static_cast<int>(limit - (
_rings.back() + 1)))
489 boundary_info.add_side(elem, 1, 3);
491 if ((index - initial) %
static_cast<int>(
_rings.back() + 2) == 0)
492 boundary_info.add_side(elem, 2, 4);
496 if ((index - initial) %
static_cast<int>(
_rings.back() + 1) == 0)
499 initial = initial + (
static_cast<int>(
_rings.back()) + 2);
504 int index1 = Utility::pow<2>(standard / 2 + 1) +
505 (standard + 1) * (total_concentric_circles.size() - 1) + standard / 2;
507 int index2 = Utility::pow<2>(standard / 2 + 1) +
508 (standard + 1) * total_concentric_circles.size() +
509 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 3 -
513 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
514 elem->set_node(3, nodes[index1]);
515 elem->set_node(2, nodes[index2]);
516 elem->set_node(1, nodes[index2 +
_rings.back() + 1]);
517 elem->set_node(0, nodes[index2 +
_rings.back() + 2]);
518 elem->subdomain_id() = subdomainIDs.back() + 1;
521 index = Utility::pow<2>(standard / 2 + 1) + standard / 2 +
522 (standard + 1) * (total_concentric_circles.size() - 1);
523 limit = index + standard / 2 - 1;
525 while (index <= limit)
528 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
529 elem->set_node(3, nodes[index]);
530 elem->set_node(2, nodes[index + 1]);
531 elem->set_node(1, nodes[index2 -
_rings.back() - 1]);
532 elem->set_node(0, nodes[index2]);
533 elem->subdomain_id() = subdomainIDs.back() + 1;
536 boundary_info.add_side(elem, 1, 1);
541 index2 = index2 -
_rings.back() - 1;
545 index1 = Utility::pow<2>(standard / 2 + 1) + standard / 2 +
546 (standard + 1) * (total_concentric_circles.size() - 1);
547 index2 = Utility::pow<2>(standard / 2 + 1) +
548 (standard + 1) * total_concentric_circles.size() +
549 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 2 +
552 Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
556 elem =
mesh->add_elem(std::make_unique<Quad4>());
557 elem->set_node(0, nodes[index1]);
558 elem->set_node(1, nodes[index1 - 1]);
559 elem->set_node(2, nodes[index2]);
560 elem->set_node(3, nodes[index3]);
561 elem->subdomain_id() = subdomainIDs.back() + 1;
564 boundary_info.add_side(elem, 1, 2);
568 index = Utility::pow<2>(standard / 2 + 1) + standard / 2 +
569 (standard + 1) * (total_concentric_circles.size() - 1) - 2;
570 index1 = Utility::pow<2>(standard / 2 + 1) +
571 (standard + 1) * total_concentric_circles.size() +
572 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 2 +
575 limit = Utility::pow<2>(standard / 2 + 1) + standard / 2 +
576 (standard + 1) * (total_concentric_circles.size() - 1) - standard / 2;
580 while (index >= limit)
583 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
584 elem->set_node(0, nodes[index]);
585 elem->set_node(1, nodes[index1]);
586 elem->set_node(2, nodes[index1 - (
_rings.back() + 1)]);
587 elem->set_node(3, nodes[index + 1]);
588 elem->subdomain_id() = subdomainIDs.back() + 1;
591 boundary_info.add_side(elem, 0, 2);
593 index1 = index1 + (
_rings.back() + 1);
598 index = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
599 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 2;
601 index1 = index - (
_rings.back() + 2);
606 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
607 elem->set_node(3, nodes[index]);
608 elem->set_node(2, nodes[index + 1]);
609 elem->set_node(1, nodes[index + 2]);
610 elem->set_node(0, nodes[index1]);
611 elem->subdomain_id() = subdomainIDs.back() + 1;
613 boundary_info.add_side(elem, 2, 3);
616 boundary_info.add_side(elem, 1, 2);
619 index = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
620 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 2 -
623 limit = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
624 (
_rings.back() + 1) * (standard / 2) + (
_rings.back() + 2) * 2 - 2;
627 while (index > limit)
629 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
630 elem->set_node(3, nodes[index]);
631 elem->set_node(2, nodes[index + (
_rings.back() + 2) * k + k + 1]);
632 elem->set_node(1, nodes[index + (
_rings.back() + 2) * k + k + 2]);
633 elem->set_node(0, nodes[index -
_rings.back() - 2]);
634 elem->subdomain_id() = subdomainIDs.back() + 1;
635 index = index - (
_rings.back() + 2);
639 boundary_info.add_side(elem, 1, 2);
642 index = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
643 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 1;
644 initial = Utility::pow<2>(standard / 2 + 1) +
645 (standard + 1) * total_concentric_circles.size() +
646 (
_rings.back() + 1) * (standard / 2) + Utility::pow<2>(
_rings.back() + 2) - 1;
647 limit = Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
648 (
_rings.back() + 1) * (standard / 2) * 2 + Utility::pow<2>(
_rings.back() + 2) - 2 -
651 initial2 = Utility::pow<2>(standard / 2 + 1) +
652 (standard + 1) * total_concentric_circles.size() +
653 (
_rings.back() + 1) * (standard / 2) * 2 + Utility::pow<2>(
_rings.back() + 2) - 2 -
658 while (index < limit)
660 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
661 elem->set_node(0, nodes[index]);
662 elem->set_node(1, nodes[index + 1]);
663 elem->set_node(2, nodes[index + 1 +
_rings.back() + 1]);
664 elem->set_node(3, nodes[index + 1 +
_rings.back()]);
665 elem->subdomain_id() = subdomainIDs.back() + 1;
667 if (index > initial2)
668 boundary_info.add_side(elem, 2, 2);
670 if ((index - initial) == 0)
671 boundary_info.add_side(elem, 3, 3);
675 if ((index - initial) %
static_cast<int>(
_rings.back()) == 0)
678 initial = initial + (
static_cast<int>(
_rings.back()) + 1);
686 boundary_info.sideset_name(1) =
"left";
687 boundary_info.sideset_name(2) =
"bottom";
690 boundary_info.sideset_name(3) =
"outer";
693 boundary_info.sideset_name(3) =
"right";
694 boundary_info.sideset_name(4) =
"top";
699 MeshTools::Modification::rotate(*
mesh, 90, 0, 0);
700 boundary_info.sideset_name(1) =
"bottom";
701 boundary_info.sideset_name(2) =
"right";
704 boundary_info.sideset_name(3) =
"outer";
707 boundary_info.sideset_name(3) =
"top";
708 boundary_info.sideset_name(4) =
"left";
713 MeshTools::Modification::rotate(*
mesh, 180, 0, 0);
714 boundary_info.sideset_name(1) =
"right";
715 boundary_info.sideset_name(2) =
"top";
718 boundary_info.sideset_name(3) =
"outer";
721 boundary_info.sideset_name(3) =
"left";
722 boundary_info.sideset_name(4) =
"bottom";
725 else if (
_portion ==
"bottom_right")
727 MeshTools::Modification::rotate(*
mesh, 270, 0, 0);
728 boundary_info.sideset_name(1) =
"top";
729 boundary_info.sideset_name(2) =
"left";
732 boundary_info.sideset_name(3) =
"outer";
735 boundary_info.sideset_name(3) =
"bottom";
736 boundary_info.sideset_name(4) =
"right";
742 ReplicatedMesh other_mesh(*
mesh);
744 MeshTools::Modification::rotate(other_mesh, 90, 0, 0);
747 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
748 MeshTools::Modification::change_boundary_id(other_mesh, 2, 6);
749 MeshTools::Modification::change_boundary_id(other_mesh, 3, 7);
750 MeshTools::Modification::change_boundary_id(other_mesh, 4, 1);
751 MeshTools::Modification::change_boundary_id(other_mesh, 5, 2);
752 MeshTools::Modification::change_boundary_id(other_mesh, 6, 3);
753 MeshTools::Modification::change_boundary_id(other_mesh, 7, 4);
754 mesh->prepare_for_use();
755 other_mesh.prepare_for_use();
756 mesh->stitch_meshes(other_mesh, 1, 3, TOLERANCE,
true,
false);
757 mesh->get_boundary_info().sideset_name(1) =
"left";
758 mesh->get_boundary_info().sideset_name(2) =
"bottom";
759 mesh->get_boundary_info().sideset_name(3) =
"right";
760 mesh->get_boundary_info().sideset_name(4) =
"top";
764 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
765 MeshTools::Modification::change_boundary_id(other_mesh, 2, 1);
766 MeshTools::Modification::change_boundary_id(other_mesh, 5, 2);
767 mesh->prepare_for_use();
768 other_mesh.prepare_for_use();
769 mesh->stitch_meshes(other_mesh, 1, 1, TOLERANCE,
true,
false);
771 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
772 MeshTools::Modification::change_boundary_id(*
mesh, 3, 2);
773 mesh->get_boundary_info().sideset_name(1) =
"bottom";
774 mesh->get_boundary_info().sideset_name(2) =
"outer";
781 ReplicatedMesh other_mesh(*
mesh);
783 MeshTools::Modification::rotate(other_mesh, 270, 0, 0);
786 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
787 MeshTools::Modification::change_boundary_id(other_mesh, 2, 6);
788 MeshTools::Modification::change_boundary_id(other_mesh, 3, 7);
789 MeshTools::Modification::change_boundary_id(other_mesh, 4, 3);
790 MeshTools::Modification::change_boundary_id(other_mesh, 5, 4);
791 MeshTools::Modification::change_boundary_id(other_mesh, 6, 1);
792 MeshTools::Modification::change_boundary_id(other_mesh, 7, 2);
793 mesh->prepare_for_use();
794 other_mesh.prepare_for_use();
795 mesh->stitch_meshes(other_mesh, 2, 4, TOLERANCE,
true,
false);
796 mesh->get_boundary_info().sideset_name(1) =
"left";
797 mesh->get_boundary_info().sideset_name(2) =
"bottom";
798 mesh->get_boundary_info().sideset_name(3) =
"right";
799 mesh->get_boundary_info().sideset_name(4) =
"top";
803 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
804 MeshTools::Modification::change_boundary_id(other_mesh, 2, 1);
805 MeshTools::Modification::change_boundary_id(other_mesh, 5, 2);
806 mesh->prepare_for_use();
807 other_mesh.prepare_for_use();
808 mesh->stitch_meshes(other_mesh, 2, 2, TOLERANCE,
true,
false);
810 MeshTools::Modification::change_boundary_id(*
mesh, 3, 2);
811 mesh->get_boundary_info().sideset_name(1) =
"left";
812 mesh->get_boundary_info().sideset_name(2) =
"outer";
818 ReplicatedMesh other_mesh(*
mesh);
821 MeshTools::Modification::rotate(other_mesh, 90, 0, 0);
822 MeshTools::Modification::rotate(*
mesh, 180, 0, 0);
826 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
827 MeshTools::Modification::change_boundary_id(other_mesh, 2, 6);
828 MeshTools::Modification::change_boundary_id(other_mesh, 3, 7);
829 MeshTools::Modification::change_boundary_id(other_mesh, 4, 1);
830 MeshTools::Modification::change_boundary_id(other_mesh, 5, 2);
831 MeshTools::Modification::change_boundary_id(other_mesh, 6, 3);
832 MeshTools::Modification::change_boundary_id(other_mesh, 7, 4);
834 MeshTools::Modification::change_boundary_id(*
mesh, 1, 5);
835 MeshTools::Modification::change_boundary_id(*
mesh, 2, 6);
836 MeshTools::Modification::change_boundary_id(*
mesh, 3, 7);
837 MeshTools::Modification::change_boundary_id(*
mesh, 4, 2);
838 MeshTools::Modification::change_boundary_id(*
mesh, 5, 3);
839 MeshTools::Modification::change_boundary_id(*
mesh, 6, 4);
840 MeshTools::Modification::change_boundary_id(*
mesh, 7, 1);
841 mesh->prepare_for_use();
842 other_mesh.prepare_for_use();
843 mesh->stitch_meshes(other_mesh, 4, 2, TOLERANCE,
true,
false);
844 mesh->get_boundary_info().sideset_name(1) =
"left";
845 mesh->get_boundary_info().sideset_name(2) =
"bottom";
846 mesh->get_boundary_info().sideset_name(3) =
"right";
847 mesh->get_boundary_info().sideset_name(4) =
"top";
851 MeshTools::Modification::change_boundary_id(*
mesh, 1, 5);
852 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
853 MeshTools::Modification::change_boundary_id(*
mesh, 5, 2);
854 mesh->prepare_for_use();
855 other_mesh.prepare_for_use();
856 mesh->stitch_meshes(other_mesh, 1, 1, TOLERANCE,
true,
false);
858 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
859 MeshTools::Modification::change_boundary_id(*
mesh, 3, 2);
860 mesh->get_boundary_info().sideset_name(1) =
"right";
861 mesh->get_boundary_info().sideset_name(2) =
"outer";
867 ReplicatedMesh other_mesh(*
mesh);
869 MeshTools::Modification::rotate(other_mesh, 180, 0, 0);
870 MeshTools::Modification::rotate(*
mesh, 270, 0, 0);
874 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
875 MeshTools::Modification::change_boundary_id(other_mesh, 2, 6);
876 MeshTools::Modification::change_boundary_id(other_mesh, 3, 7);
877 MeshTools::Modification::change_boundary_id(other_mesh, 4, 2);
878 MeshTools::Modification::change_boundary_id(other_mesh, 5, 3);
879 MeshTools::Modification::change_boundary_id(other_mesh, 6, 4);
880 MeshTools::Modification::change_boundary_id(other_mesh, 7, 1);
882 MeshTools::Modification::change_boundary_id(*
mesh, 1, 5);
883 MeshTools::Modification::change_boundary_id(*
mesh, 2, 6);
884 MeshTools::Modification::change_boundary_id(*
mesh, 3, 7);
885 MeshTools::Modification::change_boundary_id(*
mesh, 4, 3);
886 MeshTools::Modification::change_boundary_id(*
mesh, 5, 4);
887 MeshTools::Modification::change_boundary_id(*
mesh, 6, 1);
888 MeshTools::Modification::change_boundary_id(*
mesh, 7, 2);
889 mesh->prepare_for_use();
890 other_mesh.prepare_for_use();
891 mesh->stitch_meshes(other_mesh, 1, 3, TOLERANCE,
true,
false);
892 mesh->get_boundary_info().sideset_name(1) =
"left";
893 mesh->get_boundary_info().sideset_name(2) =
"bottom";
894 mesh->get_boundary_info().sideset_name(3) =
"right";
895 mesh->get_boundary_info().sideset_name(4) =
"top";
899 MeshTools::Modification::change_boundary_id(*
mesh, 1, 5);
900 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
901 MeshTools::Modification::change_boundary_id(*
mesh, 5, 2);
902 mesh->prepare_for_use();
903 other_mesh.prepare_for_use();
904 mesh->stitch_meshes(other_mesh, 1, 1, TOLERANCE,
true,
false);
906 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
907 MeshTools::Modification::change_boundary_id(*
mesh, 3, 2);
908 mesh->get_boundary_info().sideset_name(1) =
"top";
909 mesh->get_boundary_info().sideset_name(2) =
"outer";
915 ReplicatedMesh portion_two(*
mesh);
918 MeshTools::Modification::rotate(portion_two, 90, 0, 0);
923 MeshTools::Modification::change_boundary_id(portion_two, 1, 5);
924 MeshTools::Modification::change_boundary_id(portion_two, 2, 6);
925 MeshTools::Modification::change_boundary_id(portion_two, 3, 7);
926 MeshTools::Modification::change_boundary_id(portion_two, 4, 1);
927 MeshTools::Modification::change_boundary_id(portion_two, 5, 2);
928 MeshTools::Modification::change_boundary_id(portion_two, 6, 3);
929 MeshTools::Modification::change_boundary_id(portion_two, 7, 4);
930 mesh->prepare_for_use();
931 portion_two.prepare_for_use();
933 mesh->stitch_meshes(portion_two, 1, 3, TOLERANCE,
true,
false);
936 ReplicatedMesh portion_bottom(*
mesh);
937 MeshTools::Modification::rotate(portion_bottom, 180, 0, 0);
938 MeshTools::Modification::change_boundary_id(portion_bottom, 1, 5);
939 MeshTools::Modification::change_boundary_id(portion_bottom, 2, 6);
940 MeshTools::Modification::change_boundary_id(portion_bottom, 3, 7);
941 MeshTools::Modification::change_boundary_id(portion_bottom, 4, 2);
942 MeshTools::Modification::change_boundary_id(portion_bottom, 5, 3);
943 MeshTools::Modification::change_boundary_id(portion_bottom, 6, 4);
944 MeshTools::Modification::change_boundary_id(portion_bottom, 7, 1);
945 mesh->prepare_for_use();
946 portion_bottom.prepare_for_use();
948 mesh->stitch_meshes(portion_bottom, 2, 4, TOLERANCE,
true,
false);
950 mesh->get_boundary_info().sideset_name(1) =
"left";
951 mesh->get_boundary_info().sideset_name(2) =
"bottom";
952 mesh->get_boundary_info().sideset_name(3) =
"right";
953 mesh->get_boundary_info().sideset_name(4) =
"top";
954 portion_bottom.clear();
958 MeshTools::Modification::change_boundary_id(portion_two, 1, 5);
959 MeshTools::Modification::change_boundary_id(portion_two, 2, 1);
960 MeshTools::Modification::change_boundary_id(portion_two, 5, 2);
962 mesh->prepare_for_use();
963 portion_two.prepare_for_use();
964 mesh->stitch_meshes(portion_two, 1, 1, TOLERANCE,
true,
false);
966 ReplicatedMesh portion_bottom(*
mesh);
967 MeshTools::Modification::rotate(portion_bottom, 180, 0, 0);
969 mesh->prepare_for_use();
970 portion_bottom.prepare_for_use();
971 mesh->stitch_meshes(portion_bottom, 2, 2, TOLERANCE,
true,
false);
972 MeshTools::Modification::change_boundary_id(*
mesh, 3, 1);
973 mesh->get_boundary_info().sideset_name(1) =
"outer";
974 portion_bottom.clear();
981 mesh->prepare_for_use();
989 mesh->set_subdomain_name(0, getParam<SubdomainName>(
"subdomain_name"),
true);
991 mesh->prepare_for_use();
992 return dynamic_pointer_cast<MeshBase>(
mesh);