12 #include "libmesh/replicated_mesh.h" 13 #include "libmesh/face_quad4.h" 14 #include "libmesh/mesh_modification.h" 15 #include "libmesh/serial_mesh.h" 16 #include "libmesh/boundary_info.h" 17 #include "libmesh/utility.h" 18 #include "libmesh/mesh_smoother_laplace.h" 30 "full top_right top_left bottom_left bottom_right right_half left_half top_half bottom_half",
33 "num_sectors % 2 = 0, num_sectors > 0" 34 "Number of azimuthal sectors in each quadrant" 35 "'num_sectors' must be an even number.");
36 params.
addRequiredParam<std::vector<Real>>(
"radii",
"Radii of major concentric circles");
38 "rings",
"Number of rings in each circle or in the enclosing square");
41 "It determines if meshes for a outer square are added to concentric circle meshes.");
46 "The enclosing square can be added to the completed concentric circle mesh." 47 "Elements are quad meshes.");
48 params.
addParam<
MooseEnum>(
"portion", portion,
"Control of which part of mesh is created");
50 "preserve_volumes",
"Volume of concentric circles can be preserved using this function.");
51 params.
addParam<
unsigned int>(
"smoothing_max_it", 1,
"Number of Laplacian smoothing iterations");
53 "This ConcentricCircleMeshGenerator source code is to generate concentric " 61 _num_sectors(getParam<unsigned
int>(
"num_sectors")),
62 _radii(getParam<
std::vector<
Real>>(
"radii")),
63 _rings(getParam<
std::vector<unsigned
int>>(
"rings")),
64 _has_outer_square(getParam<bool>(
"has_outer_square")),
65 _pitch(getParam<
Real>(
"pitch")),
66 _preserve_volumes(getParam<bool>(
"preserve_volumes")),
67 _smoothing_max_it(getParam<unsigned
int>(
"smoothing_max_it")),
73 paramError(
"num_sectors",
"must be an even number.");
76 for (
unsigned i = 0; i <
_radii.size() - 1; ++i)
79 paramError(
"radii",
"must be positive numbers.");
82 "must be provided in order by starting with the smallest radius providing the " 83 "following gradual radii.");
90 paramError(
"rings",
"The size of 'rings' must be equal to the size of 'radii' plus 1.");
95 paramError(
"rings",
"The size of 'rings' must be equal to the size of 'radii'.");
99 for (
unsigned i = 0; i <
_radii.size(); ++i)
101 paramError(
"pitch",
"The pitch / 2 must be larger than any radii.");
104 std::unique_ptr<MeshBase>
108 BoundaryInfo & boundary_info =
mesh->get_boundary_info();
112 std::vector<Real> total_concentric_circles;
127 total_concentric_circles.push_back(
_radii[j - 1] +
139 Real original_radius = 0.0;
140 for (
unsigned i = 0; i < total_concentric_circles.size(); ++i)
147 original_radius = total_concentric_circles[i];
148 total_concentric_circles[i] = modified_radius;
157 original_radius = total_concentric_circles[i];
158 total_concentric_circles[i] = modified_radius;
164 unsigned num_total_nodes = 0;
174 std::vector<Node *> nodes(num_total_nodes);
176 unsigned node_id = 0;
180 Point p1 = Point(xx, 0, 0);
181 Point p2 = Point(0, xx, 0);
189 Point p = p1 * fx * (1 - fy) + p2 * fy * (1 - fx) + p3 * fx * fy;
190 nodes[node_id] =
mesh->add_point(p, node_id);
196 Real current_radius = total_concentric_circles[0];
199 for (
unsigned layers = 0; layers < total_concentric_circles.size(); ++layers)
201 current_radius = total_concentric_circles[layers];
202 for (
unsigned num_outer_nodes = 0; num_outer_nodes <=
_num_sectors; ++num_outer_nodes)
204 const Real x = current_radius *
std::cos(num_outer_nodes * d_angle);
205 const Real y = current_radius *
std::sin(num_outer_nodes * d_angle);
206 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
223 const Real a2 = total_concentric_circles.back() *
std::cos(M_PI / 2 - i * d_angle);
224 const Real b2 = total_concentric_circles.back() *
std::sin(M_PI / 2 - i * d_angle);
226 for (
unsigned j = 0; j <=
_rings.back(); ++j)
230 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
236 for (
unsigned i = 1; i <=
_rings.back() + 1; ++i)
245 const Real a3 = total_concentric_circles.back() *
std::cos(M_PI / 4);
246 const Real b3 = total_concentric_circles.back() *
std::sin(M_PI / 4);
248 const Real a4 = ((
_rings.back() + 1 - k) * a3 + k * a2) / (
_rings.back() + 1);
249 const Real b4 = ((
_rings.back() + 1 - k) * b3 + k * b2) / (
_rings.back() + 1);
251 for (
unsigned j = 0; j <=
_rings.back() + 1; ++j)
255 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
268 const Real a2 = total_concentric_circles.back() *
std::cos(M_PI / 4 - i * d_angle);
269 const Real b2 = total_concentric_circles.back() *
std::sin(M_PI / 4 - i * d_angle);
271 for (
unsigned j = 0; j <=
_rings.back(); ++j)
275 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
290 int additional_term = 0;
291 int counter = standard;
294 counter = counter - 2;
295 additional_term = additional_term + counter;
297 limit = standard + additional_term;
299 else if (standard == 4)
303 std::vector<unsigned int> subdomainIDs;
306 for (
unsigned int i = 0; i <
_rings.size() - 1; ++i)
307 for (
unsigned int j = 0; j <
_rings[i]; ++j)
308 subdomainIDs.push_back(i + 1);
310 for (
unsigned int i = 0; i <
_rings.size(); ++i)
311 for (
unsigned int j = 0; j <
_rings[i]; ++j)
312 subdomainIDs.push_back(i + 1);
315 while (index <= limit)
318 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
319 elem->set_node(0, nodes[index]);
322 elem->set_node(3, nodes[index + 1]);
323 elem->subdomain_id() = subdomainIDs[0];
325 if (index < standard / 2)
326 boundary_info.add_side(elem, 3, 1);
327 if (index % (standard / 2 + 1) == 0)
328 boundary_info.add_side(elem, 0, 2);
333 if ((index - standard / 2) % (standard / 2 + 1) == 0)
341 while (index < limit)
344 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
345 elem->set_node(0, nodes[index]);
348 elem->set_node(3, nodes[index + 1]);
349 elem->subdomain_id() = subdomainIDs[0];
351 if (index == (standard / 2 + 1) * (standard / 2))
352 boundary_info.add_side(elem, 0, 2);
359 while (index != standard / 2)
362 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
363 elem->set_node(0, nodes[index]);
367 elem->subdomain_id() = subdomainIDs[0];
369 if (index == standard + 1)
370 boundary_info.add_side(elem, 2, 1);
380 (
_num_sectors + 1) * (total_concentric_circles.size() - 1);
382 int num_nodes_boundary =
Utility::pow<2>(standard / 2 + 1) + standard + 1;
384 while (index < limit)
386 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
387 elem->set_node(0, nodes[index]);
388 elem->set_node(1, nodes[index + standard + 1]);
389 elem->set_node(2, nodes[index + standard + 2]);
390 elem->set_node(3, nodes[index + 1]);
392 for (
int i = 0; i < static_cast<int>(subdomainIDs.size() - 1); ++i)
393 if (index < limit - (standard + 1) * i && index >= limit - (standard + 1) * (i + 1))
394 elem->subdomain_id() = subdomainIDs[subdomainIDs.size() - 1 - i];
399 if ((index - initial) % (standard + 1) == 0)
400 boundary_info.add_side(elem, 0, 2);
401 if ((index -
final) % (standard + 1) == 0)
402 boundary_info.add_side(elem, 2, 1);
404 if (index >= limit - (standard + 1))
405 boundary_info.add_side(elem, 1, 3);
412 if (index == (num_nodes_boundary + counter * (standard + 1)) - 1)
427 Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size();
430 Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size();
436 index =
Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size();
437 limit =
Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
440 while (index <= limit)
443 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
444 elem->set_node(0, nodes[index]);
445 elem->set_node(1, nodes[index + 1]);
446 elem->set_node(2, nodes[index + 1 +
_rings.back() + 1]);
447 elem->set_node(3, nodes[index + 1 +
_rings.back()]);
448 elem->subdomain_id() = subdomainIDs.back() + 1;
450 if (index < (initial2 + static_cast<int>(
_rings.back())))
451 boundary_info.add_side(elem, 0, 1);
453 if (index == initial)
454 boundary_info.add_side(elem, 3, 4);
460 if ((index - initial) % static_cast<int>(
_rings.back()) == 0)
463 initial = initial + (
static_cast<int>(
_rings.back()) + 1);
469 (standard + 1) * total_concentric_circles.size() +
470 (
_rings.back() + 1) * (standard / 2 + 1);
472 limit =
Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
476 while (index <= limit)
479 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
480 elem->set_node(3, nodes[index]);
481 elem->set_node(2, nodes[index +
_rings.back() + 2]);
482 elem->set_node(1, nodes[index +
_rings.back() + 3]);
483 elem->set_node(0, nodes[index + 1]);
484 elem->subdomain_id() = subdomainIDs.back() + 1;
486 if (index >= static_cast<int>(limit - (
_rings.back() + 1)))
487 boundary_info.add_side(elem, 1, 3);
489 if ((index - initial) % static_cast<int>(
_rings.back() + 2) == 0)
490 boundary_info.add_side(elem, 2, 4);
494 if ((index - initial) % static_cast<int>(
_rings.back() + 1) == 0)
497 initial = initial + (
static_cast<int>(
_rings.back()) + 2);
503 (standard + 1) * (total_concentric_circles.size() - 1) + standard / 2;
506 (standard + 1) * total_concentric_circles.size() +
511 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
512 elem->set_node(3, nodes[index1]);
513 elem->set_node(2, nodes[index2]);
514 elem->set_node(1, nodes[index2 +
_rings.back() + 1]);
515 elem->set_node(0, nodes[index2 +
_rings.back() + 2]);
516 elem->subdomain_id() = subdomainIDs.back() + 1;
520 (standard + 1) * (total_concentric_circles.size() - 1);
521 limit = index + standard / 2 - 1;
523 while (index <= limit)
526 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
527 elem->set_node(3, nodes[index]);
528 elem->set_node(2, nodes[index + 1]);
529 elem->set_node(1, nodes[index2 -
_rings.back() - 1]);
530 elem->set_node(0, nodes[index2]);
531 elem->subdomain_id() = subdomainIDs.back() + 1;
534 boundary_info.add_side(elem, 1, 1);
539 index2 = index2 -
_rings.back() - 1;
544 (standard + 1) * (total_concentric_circles.size() - 1);
546 (standard + 1) * total_concentric_circles.size() +
550 Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
554 elem =
mesh->add_elem(std::make_unique<Quad4>());
555 elem->set_node(0, nodes[index1]);
556 elem->set_node(1, nodes[index1 - 1]);
557 elem->set_node(2, nodes[index2]);
558 elem->set_node(3, nodes[index3]);
559 elem->subdomain_id() = subdomainIDs.back() + 1;
562 boundary_info.add_side(elem, 1, 2);
567 (standard + 1) * (total_concentric_circles.size() - 1) - 2;
569 (standard + 1) * total_concentric_circles.size() +
574 (standard + 1) * (total_concentric_circles.size() - 1) - standard / 2;
578 while (index >= limit)
581 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
582 elem->set_node(0, nodes[index]);
583 elem->set_node(1, nodes[index1]);
584 elem->set_node(2, nodes[index1 - (
_rings.back() + 1)]);
585 elem->set_node(3, nodes[index + 1]);
586 elem->subdomain_id() = subdomainIDs.back() + 1;
589 boundary_info.add_side(elem, 0, 2);
591 index1 = index1 + (
_rings.back() + 1);
596 index =
Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
599 index1 = index - (
_rings.back() + 2);
604 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
605 elem->set_node(3, nodes[index]);
606 elem->set_node(2, nodes[index + 1]);
607 elem->set_node(1, nodes[index + 2]);
608 elem->set_node(0, nodes[index1]);
609 elem->subdomain_id() = subdomainIDs.back() + 1;
611 boundary_info.add_side(elem, 2, 3);
614 boundary_info.add_side(elem, 1, 2);
617 index =
Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
621 limit =
Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
622 (
_rings.back() + 1) * (standard / 2) + (
_rings.back() + 2) * 2 - 2;
625 while (index > limit)
627 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
628 elem->set_node(3, nodes[index]);
629 elem->set_node(2, nodes[index + (
_rings.back() + 2) * k + k + 1]);
630 elem->set_node(1, nodes[index + (
_rings.back() + 2) * k + k + 2]);
631 elem->set_node(0, nodes[index -
_rings.back() - 2]);
632 elem->subdomain_id() = subdomainIDs.back() + 1;
633 index = index - (
_rings.back() + 2);
637 boundary_info.add_side(elem, 1, 2);
640 index =
Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
643 (standard + 1) * total_concentric_circles.size() +
645 limit =
Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
650 (standard + 1) * total_concentric_circles.size() +
656 while (index < limit)
658 Elem * elem =
mesh->add_elem(std::make_unique<Quad4>());
659 elem->set_node(0, nodes[index]);
660 elem->set_node(1, nodes[index + 1]);
661 elem->set_node(2, nodes[index + 1 +
_rings.back() + 1]);
662 elem->set_node(3, nodes[index + 1 +
_rings.back()]);
663 elem->subdomain_id() = subdomainIDs.back() + 1;
665 if (index > initial2)
666 boundary_info.add_side(elem, 2, 2);
668 if ((index - initial) == 0)
669 boundary_info.add_side(elem, 3, 3);
673 if ((index - initial) % static_cast<int>(
_rings.back()) == 0)
676 initial = initial + (
static_cast<int>(
_rings.back()) + 1);
684 boundary_info.sideset_name(1) =
"left";
685 boundary_info.sideset_name(2) =
"bottom";
688 boundary_info.sideset_name(3) =
"outer";
691 boundary_info.sideset_name(3) =
"right";
692 boundary_info.sideset_name(4) =
"top";
697 MeshTools::Modification::rotate(*
mesh, 90, 0, 0);
698 boundary_info.sideset_name(1) =
"bottom";
699 boundary_info.sideset_name(2) =
"right";
702 boundary_info.sideset_name(3) =
"outer";
705 boundary_info.sideset_name(3) =
"top";
706 boundary_info.sideset_name(4) =
"left";
711 MeshTools::Modification::rotate(*
mesh, 180, 0, 0);
712 boundary_info.sideset_name(1) =
"right";
713 boundary_info.sideset_name(2) =
"top";
716 boundary_info.sideset_name(3) =
"outer";
719 boundary_info.sideset_name(3) =
"left";
720 boundary_info.sideset_name(4) =
"bottom";
723 else if (
_portion ==
"bottom_right")
725 MeshTools::Modification::rotate(*
mesh, 270, 0, 0);
726 boundary_info.sideset_name(1) =
"top";
727 boundary_info.sideset_name(2) =
"left";
730 boundary_info.sideset_name(3) =
"outer";
733 boundary_info.sideset_name(3) =
"bottom";
734 boundary_info.sideset_name(4) =
"right";
740 ReplicatedMesh other_mesh(*
mesh);
742 MeshTools::Modification::rotate(other_mesh, 90, 0, 0);
745 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
746 MeshTools::Modification::change_boundary_id(other_mesh, 2, 6);
747 MeshTools::Modification::change_boundary_id(other_mesh, 3, 7);
748 MeshTools::Modification::change_boundary_id(other_mesh, 4, 1);
749 MeshTools::Modification::change_boundary_id(other_mesh, 5, 2);
750 MeshTools::Modification::change_boundary_id(other_mesh, 6, 3);
751 MeshTools::Modification::change_boundary_id(other_mesh, 7, 4);
752 mesh->prepare_for_use();
753 other_mesh.prepare_for_use();
754 mesh->stitch_meshes(other_mesh, 1, 3, TOLERANCE,
true,
false);
755 mesh->get_boundary_info().sideset_name(1) =
"left";
756 mesh->get_boundary_info().sideset_name(2) =
"bottom";
757 mesh->get_boundary_info().sideset_name(3) =
"right";
758 mesh->get_boundary_info().sideset_name(4) =
"top";
762 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
763 MeshTools::Modification::change_boundary_id(other_mesh, 2, 1);
764 MeshTools::Modification::change_boundary_id(other_mesh, 5, 2);
765 mesh->prepare_for_use();
766 other_mesh.prepare_for_use();
767 mesh->stitch_meshes(other_mesh, 1, 1, TOLERANCE,
true,
false);
769 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
770 MeshTools::Modification::change_boundary_id(*
mesh, 3, 2);
771 mesh->get_boundary_info().sideset_name(1) =
"bottom";
772 mesh->get_boundary_info().sideset_name(2) =
"outer";
779 ReplicatedMesh other_mesh(*
mesh);
781 MeshTools::Modification::rotate(other_mesh, 270, 0, 0);
784 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
785 MeshTools::Modification::change_boundary_id(other_mesh, 2, 6);
786 MeshTools::Modification::change_boundary_id(other_mesh, 3, 7);
787 MeshTools::Modification::change_boundary_id(other_mesh, 4, 3);
788 MeshTools::Modification::change_boundary_id(other_mesh, 5, 4);
789 MeshTools::Modification::change_boundary_id(other_mesh, 6, 1);
790 MeshTools::Modification::change_boundary_id(other_mesh, 7, 2);
791 mesh->prepare_for_use();
792 other_mesh.prepare_for_use();
793 mesh->stitch_meshes(other_mesh, 2, 4, TOLERANCE,
true,
false);
794 mesh->get_boundary_info().sideset_name(1) =
"left";
795 mesh->get_boundary_info().sideset_name(2) =
"bottom";
796 mesh->get_boundary_info().sideset_name(3) =
"right";
797 mesh->get_boundary_info().sideset_name(4) =
"top";
801 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
802 MeshTools::Modification::change_boundary_id(other_mesh, 2, 1);
803 MeshTools::Modification::change_boundary_id(other_mesh, 5, 2);
804 mesh->prepare_for_use();
805 other_mesh.prepare_for_use();
806 mesh->stitch_meshes(other_mesh, 2, 2, TOLERANCE,
true,
false);
808 MeshTools::Modification::change_boundary_id(*
mesh, 3, 2);
809 mesh->get_boundary_info().sideset_name(1) =
"left";
810 mesh->get_boundary_info().sideset_name(2) =
"outer";
816 ReplicatedMesh other_mesh(*
mesh);
819 MeshTools::Modification::rotate(other_mesh, 90, 0, 0);
820 MeshTools::Modification::rotate(*
mesh, 180, 0, 0);
824 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
825 MeshTools::Modification::change_boundary_id(other_mesh, 2, 6);
826 MeshTools::Modification::change_boundary_id(other_mesh, 3, 7);
827 MeshTools::Modification::change_boundary_id(other_mesh, 4, 1);
828 MeshTools::Modification::change_boundary_id(other_mesh, 5, 2);
829 MeshTools::Modification::change_boundary_id(other_mesh, 6, 3);
830 MeshTools::Modification::change_boundary_id(other_mesh, 7, 4);
832 MeshTools::Modification::change_boundary_id(*
mesh, 1, 5);
833 MeshTools::Modification::change_boundary_id(*
mesh, 2, 6);
834 MeshTools::Modification::change_boundary_id(*
mesh, 3, 7);
835 MeshTools::Modification::change_boundary_id(*
mesh, 4, 2);
836 MeshTools::Modification::change_boundary_id(*
mesh, 5, 3);
837 MeshTools::Modification::change_boundary_id(*
mesh, 6, 4);
838 MeshTools::Modification::change_boundary_id(*
mesh, 7, 1);
839 mesh->prepare_for_use();
840 other_mesh.prepare_for_use();
841 mesh->stitch_meshes(other_mesh, 4, 2, TOLERANCE,
true,
false);
842 mesh->get_boundary_info().sideset_name(1) =
"left";
843 mesh->get_boundary_info().sideset_name(2) =
"bottom";
844 mesh->get_boundary_info().sideset_name(3) =
"right";
845 mesh->get_boundary_info().sideset_name(4) =
"top";
849 MeshTools::Modification::change_boundary_id(*
mesh, 1, 5);
850 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
851 MeshTools::Modification::change_boundary_id(*
mesh, 5, 2);
852 mesh->prepare_for_use();
853 other_mesh.prepare_for_use();
854 mesh->stitch_meshes(other_mesh, 1, 1, TOLERANCE,
true,
false);
856 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
857 MeshTools::Modification::change_boundary_id(*
mesh, 3, 2);
858 mesh->get_boundary_info().sideset_name(1) =
"right";
859 mesh->get_boundary_info().sideset_name(2) =
"outer";
865 ReplicatedMesh other_mesh(*
mesh);
867 MeshTools::Modification::rotate(other_mesh, 180, 0, 0);
868 MeshTools::Modification::rotate(*
mesh, 270, 0, 0);
872 MeshTools::Modification::change_boundary_id(other_mesh, 1, 5);
873 MeshTools::Modification::change_boundary_id(other_mesh, 2, 6);
874 MeshTools::Modification::change_boundary_id(other_mesh, 3, 7);
875 MeshTools::Modification::change_boundary_id(other_mesh, 4, 2);
876 MeshTools::Modification::change_boundary_id(other_mesh, 5, 3);
877 MeshTools::Modification::change_boundary_id(other_mesh, 6, 4);
878 MeshTools::Modification::change_boundary_id(other_mesh, 7, 1);
880 MeshTools::Modification::change_boundary_id(*
mesh, 1, 5);
881 MeshTools::Modification::change_boundary_id(*
mesh, 2, 6);
882 MeshTools::Modification::change_boundary_id(*
mesh, 3, 7);
883 MeshTools::Modification::change_boundary_id(*
mesh, 4, 3);
884 MeshTools::Modification::change_boundary_id(*
mesh, 5, 4);
885 MeshTools::Modification::change_boundary_id(*
mesh, 6, 1);
886 MeshTools::Modification::change_boundary_id(*
mesh, 7, 2);
887 mesh->prepare_for_use();
888 other_mesh.prepare_for_use();
889 mesh->stitch_meshes(other_mesh, 1, 3, TOLERANCE,
true,
false);
890 mesh->get_boundary_info().sideset_name(1) =
"left";
891 mesh->get_boundary_info().sideset_name(2) =
"bottom";
892 mesh->get_boundary_info().sideset_name(3) =
"right";
893 mesh->get_boundary_info().sideset_name(4) =
"top";
897 MeshTools::Modification::change_boundary_id(*
mesh, 1, 5);
898 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
899 MeshTools::Modification::change_boundary_id(*
mesh, 5, 2);
900 mesh->prepare_for_use();
901 other_mesh.prepare_for_use();
902 mesh->stitch_meshes(other_mesh, 1, 1, TOLERANCE,
true,
false);
904 MeshTools::Modification::change_boundary_id(*
mesh, 2, 1);
905 MeshTools::Modification::change_boundary_id(*
mesh, 3, 2);
906 mesh->get_boundary_info().sideset_name(1) =
"top";
907 mesh->get_boundary_info().sideset_name(2) =
"outer";
913 ReplicatedMesh portion_two(*
mesh);
916 MeshTools::Modification::rotate(portion_two, 90, 0, 0);
921 MeshTools::Modification::change_boundary_id(portion_two, 1, 5);
922 MeshTools::Modification::change_boundary_id(portion_two, 2, 6);
923 MeshTools::Modification::change_boundary_id(portion_two, 3, 7);
924 MeshTools::Modification::change_boundary_id(portion_two, 4, 1);
925 MeshTools::Modification::change_boundary_id(portion_two, 5, 2);
926 MeshTools::Modification::change_boundary_id(portion_two, 6, 3);
927 MeshTools::Modification::change_boundary_id(portion_two, 7, 4);
928 mesh->prepare_for_use();
929 portion_two.prepare_for_use();
931 mesh->stitch_meshes(portion_two, 1, 3, TOLERANCE,
true,
false);
934 ReplicatedMesh portion_bottom(*
mesh);
935 MeshTools::Modification::rotate(portion_bottom, 180, 0, 0);
936 MeshTools::Modification::change_boundary_id(portion_bottom, 1, 5);
937 MeshTools::Modification::change_boundary_id(portion_bottom, 2, 6);
938 MeshTools::Modification::change_boundary_id(portion_bottom, 3, 7);
939 MeshTools::Modification::change_boundary_id(portion_bottom, 4, 2);
940 MeshTools::Modification::change_boundary_id(portion_bottom, 5, 3);
941 MeshTools::Modification::change_boundary_id(portion_bottom, 6, 4);
942 MeshTools::Modification::change_boundary_id(portion_bottom, 7, 1);
943 mesh->prepare_for_use();
944 portion_bottom.prepare_for_use();
946 mesh->stitch_meshes(portion_bottom, 2, 4, TOLERANCE,
true,
false);
948 mesh->get_boundary_info().sideset_name(1) =
"left";
949 mesh->get_boundary_info().sideset_name(2) =
"bottom";
950 mesh->get_boundary_info().sideset_name(3) =
"right";
951 mesh->get_boundary_info().sideset_name(4) =
"top";
952 portion_bottom.clear();
956 MeshTools::Modification::change_boundary_id(portion_two, 1, 5);
957 MeshTools::Modification::change_boundary_id(portion_two, 2, 1);
958 MeshTools::Modification::change_boundary_id(portion_two, 5, 2);
960 mesh->prepare_for_use();
961 portion_two.prepare_for_use();
962 mesh->stitch_meshes(portion_two, 1, 1, TOLERANCE,
true,
false);
964 ReplicatedMesh portion_bottom(*
mesh);
965 MeshTools::Modification::rotate(portion_bottom, 180, 0, 0);
967 mesh->prepare_for_use();
968 portion_bottom.prepare_for_use();
969 mesh->stitch_meshes(portion_bottom, 2, 2, TOLERANCE,
true,
false);
970 MeshTools::Modification::change_boundary_id(*
mesh, 3, 1);
971 mesh->get_boundary_info().sideset_name(1) =
"outer";
972 portion_bottom.clear();
979 mesh->prepare_for_use();
985 mesh->prepare_for_use();
unsigned int _smoothing_max_it
Iteration number for Laplace smoothing.
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sin(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tan
registerMooseObject("MooseApp", ConcentricCircleMeshGenerator)
virtual void smooth() override
std::unique_ptr< ReplicatedMesh > buildReplicatedMesh(unsigned int dim=libMesh::invalid_uint)
Build a replicated mesh.
static InputParameters validParams()
bool _preserve_volumes
Volume preserving function is optional.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
These are reworked from https://stackoverflow.com/a/11003103.
std::vector< Real > _radii
Radii of concentric circles.
Generates a mesh based on concentric circles, given all the parameters.
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
std::vector< unsigned int > _rings
Number of rings in each circle or in the enclosing square.
bool _has_outer_square
Adding the enclosing square is optional.
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template cos(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(cos
MooseEnum _portion
Control of which portion of mesh will be developed.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
ConcentricCircleMeshGenerator(const InputParameters ¶meters)
unsigned int _num_sectors
Number of sectors in one quadrant.
T & declareMeshProperty(const std::string &data_name, Args &&... args)
Methods for writing out attributes to the mesh meta-data store, which can be retrieved from most othe...
MeshGenerators are objects that can modify or add to an existing mesh.
void ErrorVector unsigned int
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template pow< 2 >(tan(_arg))+1.0) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(sqrt