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" 29 params.
addParam<SubdomainName>(
"subdomain_name",
30 "Name of the subdomain assigned to all the elements");
32 "full top_right top_left bottom_left bottom_right right_half left_half top_half bottom_half",
35 "num_sectors % 2 = 0, num_sectors > 0" 36 "Number of azimuthal sectors in each quadrant" 37 "'num_sectors' must be an even number.");
38 params.
addRequiredParam<std::vector<Real>>(
"radii",
"Radii of major concentric circles");
40 "rings",
"Number of rings in each circle or in the enclosing square");
43 "It determines if meshes for a outer square are added to concentric circle meshes.");
48 "The enclosing square can be added to the completed concentric circle mesh." 49 "Elements are quad meshes.");
50 params.
addParam<
MooseEnum>(
"portion", portion,
"Control of which part of mesh is created");
52 "preserve_volumes",
"Volume of concentric circles can be preserved using this function.");
53 params.
addParam<
unsigned int>(
"smoothing_max_it", 1,
"Number of Laplacian smoothing iterations");
55 "This ConcentricCircleMeshGenerator source code is to generate concentric " 63 _num_sectors(getParam<unsigned
int>(
"num_sectors")),
64 _radii(getParam<
std::vector<
Real>>(
"radii")),
65 _rings(getParam<
std::vector<unsigned
int>>(
"rings")),
66 _has_outer_square(getParam<bool>(
"has_outer_square")),
67 _pitch(getParam<
Real>(
"pitch")),
68 _preserve_volumes(getParam<bool>(
"preserve_volumes")),
69 _smoothing_max_it(getParam<unsigned
int>(
"smoothing_max_it")),
75 paramError(
"num_sectors",
"must be an even number.");
78 for (
unsigned i = 0; i <
_radii.size() - 1; ++i)
81 paramError(
"radii",
"must be positive numbers.");
84 "must be provided in order by starting with the smallest radius providing the " 85 "following gradual radii.");
92 paramError(
"rings",
"The size of 'rings' must be equal to the size of 'radii' plus 1.");
97 paramError(
"rings",
"The size of 'rings' must be equal to the size of 'radii'.");
101 for (
unsigned i = 0; i <
_radii.size(); ++i)
103 paramError(
"pitch",
"The pitch / 2 must be larger than any radii.");
106 std::unique_ptr<MeshBase>
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)
149 original_radius = total_concentric_circles[i];
150 total_concentric_circles[i] = modified_radius;
159 original_radius = total_concentric_circles[i];
160 total_concentric_circles[i] = modified_radius;
166 unsigned num_total_nodes = 0;
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);
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);
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)
232 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
238 for (
unsigned i = 1; i <=
_rings.back() + 1; ++i)
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)
257 nodes[node_id] =
mesh->add_point(Point(x, y, 0.0), node_id);
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)
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);
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];
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() +
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);
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() +
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);
505 (standard + 1) * (total_concentric_circles.size() - 1) + standard / 2;
508 (standard + 1) * total_concentric_circles.size() +
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;
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;
546 (standard + 1) * (total_concentric_circles.size() - 1);
548 (standard + 1) * total_concentric_circles.size() +
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);
569 (standard + 1) * (total_concentric_circles.size() - 1) - 2;
571 (standard + 1) * total_concentric_circles.size() +
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() +
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() +
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() +
645 (standard + 1) * total_concentric_circles.size() +
647 limit =
Utility::pow<2>(standard / 2 + 1) + (standard + 1) * total_concentric_circles.size() +
652 (standard + 1) * total_concentric_circles.size() +
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->subdomain_name(0) = getParam<SubdomainName>(
"subdomain_name");
991 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)
std::unique_ptr< ReplicatedMesh > buildReplicatedMesh(unsigned int dim=libMesh::invalid_uint)
Build a replicated mesh.
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()
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.
virtual void smooth() override
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...
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...
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
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