16 #include "libmesh/elem.h" 24 params.
addRequiredParam<MeshGeneratorName>(
"input",
"The input mesh to be modified.");
26 "peripheral_ring_radius>0",
27 "Radius of the peripheral ring to be added.");
29 "peripheral_ring_num_segments>0",
30 "Number of segments of the peripheral ring.");
35 "Desired (maximum) triangle area, or 0 to skip uniform refinement");
39 "Desired area as a function of x,y; omit to skip non-uniform refinement");
42 "use_auto_area_func",
false,
"Use the automatic area function in the peripheral region.");
44 "auto_area_func_default_size",
46 "Background size for automatic area function, or 0 to use non background size");
47 params.
addParam<
Real>(
"auto_area_func_default_size_dist",
49 "Effective distance of background size for automatic area " 50 "function, or negative to use non background size");
51 params.
addParam<
unsigned int>(
"auto_area_function_num_points",
53 "Maximum number of nearest points used for the inverse distance " 54 "interpolation algorithm for automatic area function calculation.");
56 "auto_area_function_power",
58 "auto_area_function_power>0",
59 "Polynomial power of the inverse distance interpolation algorithm for automatic area " 60 "function calculation.");
63 "peripheral_ring_block_name",
"",
"The block name assigned to the created peripheral layer.");
64 params.
addParam<BoundaryName>(
"external_boundary_name",
65 "Optional customized external boundary name.");
66 MooseEnum tri_elem_type(
"TRI3 TRI6 TRI7 DEFAULT",
"DEFAULT");
68 "tri_element_type", tri_elem_type,
"Type of the triangular elements to be generated.");
69 params.
addClassDescription(
"This PeripheralTriangleMeshGenerator object is designed to generate " 70 "a triangulated mesh between a generated outer circle boundary " 71 "and a provided inner mesh.");
73 "auto_area_func_default_size auto_area_func_default_size_dist " 74 "auto_area_function_num_points auto_area_function_power",
75 "Peripheral Area Delaunay");
81 _input_name(getParam<MeshGeneratorName>(
"input")),
82 _peripheral_ring_radius(getParam<
Real>(
"peripheral_ring_radius")),
83 _peripheral_ring_num_segments(getParam<unsigned
int>(
"peripheral_ring_num_segments")),
84 _desired_area(getParam<
Real>(
"desired_area")),
85 _desired_area_func(getParam<
std::string>(
"desired_area_func"))
89 std::vector<libMesh::Point> outer_polyline;
95 Real theta = i * d_theta;
101 outer_polyline.emplace_back(
x,
y, 0);
107 params.
set<std::vector<Point>>(
"points") = outer_polyline;
108 params.set<
unsigned int>(
"num_edges_between_points") = 1;
109 params.set<
bool>(
"loop") =
true;
117 params.
set<MeshGeneratorName>(
"boundary") =
118 (MeshGeneratorName)
_input_name +
"_periphery_polyline";
119 params.set<std::vector<MeshGeneratorName>>(
"holes") =
121 params.set<
unsigned int>(
"add_nodes_per_boundary_segment") = 0;
124 params.set<
bool>(
"use_auto_area_func") = getParam<bool>(
"use_auto_area_func");
126 params.set<
Real>(
"auto_area_func_default_size") =
127 getParam<Real>(
"auto_area_func_default_size");
129 params.set<
Real>(
"auto_area_func_default_size_dist") =
130 getParam<Real>(
"auto_area_func_default_size_dist");
132 params.set<
unsigned int>(
"auto_area_function_num_points") =
133 getParam<unsigned int>(
"auto_area_function_num_points");
135 params.set<
Real>(
"auto_area_function_power") = getParam<Real>(
"auto_area_function_power");
136 params.set<
bool>(
"refine_boundary") =
false;
137 params.set<std::vector<bool>>(
"refine_holes") = std::vector<bool>{
false};
138 params.set<std::vector<bool>>(
"stitch_holes") = std::vector<bool>{
true};
140 params.set<BoundaryName>(
"output_boundary") =
141 getParam<BoundaryName>(
"external_boundary_name");
142 params.set<SubdomainName>(
"output_subdomain_name") =
143 getParam<SubdomainName>(
"peripheral_ring_block_name");
144 params.set<
MooseEnum>(
"tri_element_type") = getParam<MooseEnum>(
"tri_element_type");
145 params.set<
bool>(
"verbose_stitching") =
false;
151 std::unique_ptr<MeshBase>
154 (*_build_mesh)->find_neighbors();
const Real _peripheral_ring_radius
Radius of the peripheral region's outer circular boundary.
std::unique_ptr< MeshBase > & getMeshByName(const MeshGeneratorName &mesh_generator_name)
const unsigned int _peripheral_ring_num_segments
Number of segments in the peripheral region's outer circular boundary.
InputParameters getValidParams(const std::string &name) const
const std::vector< double > y
PeripheralTriangleMeshGenerator(const InputParameters ¶meters)
void declareMeshForSub(const std::string ¶m_name)
bool isParamValid(const std::string &name) const
registerMooseObject("ReactorApp", PeripheralTriangleMeshGenerator)
const std::vector< double > x
void addMeshSubgenerator(const std::string &type, const std::string &name, Ts... extra_input_parameters)
std::string _desired_area_func
Desired area as a function of (x,y)
static InputParameters validParams()
const Real _desired_area
Desired (maximum) triangle area.
This PeripheralTriangleMeshGenerator object adds a circular peripheral region to the input mesh...
std::unique_ptr< MeshBase > * _build_mesh
The final mesh that is generated by the subgenerators;.
bool isParamSetByUser(const std::string &nm) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MeshGeneratorName _input_name
Name of the mesh generator to get the input mesh.
static InputParameters validParams()
void ErrorVector unsigned int
std::unique_ptr< MeshBase > generate() override