21 MooseEnum element_type(
"TRI QUAD HYBRID",
"TRI");
24 "Whether the simple hexagon mesh is made of TRI or QUAD elements.");
26 "hexagon_size",
"hexagon_size>0.0",
"Size of the hexagon to be generated.");
27 MooseEnum hexagon_size_style(
"apothem radius",
"apothem");
31 "Style in which the hexagon size is given (default: apothem i.e. half-pitch). Option: " +
36 "Number of pin radial meshing rings (only applicable when 'element_type' is 'HYBRID').");
40 "Optional customized block id; two ids are needed for HYBRID 'element_type'.");
41 params.
addParam<std::vector<SubdomainName>>(
43 "Optional customized block name; two names are needed for HYBRID 'element_type'.");
45 "external_boundary_id>=0",
46 "Optional customized external boundary id.");
47 params.
addParam<BoundaryName>(
"external_boundary_name",
48 "Optional customized external boundary name.");
50 "Customized Subdomain/Boundary");
52 "This SimpleHexagonGenerator object is designed to generate a simple hexagonal mesh that " 53 "only contains six simple azimuthal triangular elements, two quadrilateral elements, or six " 54 "central azimuthal triangular elements plus a several layers of quadrilateral elements.");
62 _hexagon_size(getParam<
Real>(
"hexagon_size")),
65 _radial_intervals(isParamValid(
"radial_intervals")
66 ? getParam<unsigned
int>(
"radial_intervals")
67 : (_element_type ==
ElemType::HYBRID ? 2 : 1)),
70 _block_name(isParamValid(
"block_name") ? getParam<
std::vector<SubdomainName>>(
"block_name")
71 :
std::vector<SubdomainName>()),
72 _boundary_id_valid(isParamValid(
"external_boundary_id")),
73 _external_boundary_id(isParamValid(
"external_boundary_id")
76 _external_boundary_name(isParamValid(
"external_boundary_name")
77 ? getParam<BoundaryName>(
"external_boundary_name")
83 "A non-unity 'radial_intervals' value is only supported when 'element_type' is 'HYBRID'.");
90 "if provided, the size of this parameter must be one if 'element_type' is TRI or QUAD.");
93 "if provided, the size of this parameter must be two if 'element_type' is HYBRID.");
95 paramError(
"block_name",
"if provided, this parameter must have the same size as 'block_id'.");
96 declareMeshProperty<unsigned int>(
"background_intervals_meta",
_radial_intervals);
97 declareMeshProperty<dof_id_type>(
"node_id_background_meta",
99 declareMeshProperty<Real>(
"max_radius_meta", 0.0);
100 declareMeshProperty<std::vector<unsigned int>>(
"num_sectors_per_side_meta", {1, 1, 1, 1, 1, 1});
101 declareMeshProperty<Real>(
"pitch_meta",
_pitch);
104 std::unique_ptr<MeshBase>
109 BoundaryInfo & boundary_info =
mesh->get_boundary_info();
120 Point center_p = Point(0.0, 0.0, 0.0);
146 Elem * elem =
mesh->add_elem(
new Quad4);
156 elem->subdomain_id() = 2;
162 Elem * elem =
mesh->add_elem(
new Tri3);
172 elem->subdomain_id() = 1;
179 Elem * elem =
mesh->add_elem(
new Quad4);
180 elem->set_node(0, nodes[i * 3]);
182 elem->set_node(2, nodes[i * 3 + 2]);
183 elem->set_node(3, nodes[i * 3 + 1]);
190 elem->subdomain_id() = 1;
195 for (
const auto & elem :
mesh->active_element_ptr_range())
197 if (elem->subdomain_id() == 1)
198 elem->subdomain_id() =
_block_id.front();
203 for (
unsigned int i = 0; i <
_block_name.size(); i++)
210 mesh->get_boundary_info().sideset_name(
213 mesh->get_boundary_info().nodeset_name(
218 mesh->prepare_for_use();
static InputParameters validParams()
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sin(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tan
const Real _hexagon_size
Size parameter of the hexagon.
std::unique_ptr< ReplicatedMesh > buildReplicatedMesh(unsigned int dim=libMesh::invalid_uint)
const boundary_id_type _external_boundary_id
Boundary ID of the external boundary.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
const std::vector< subdomain_id_type > _block_id
Subdomain ID of the mesh.
void changeBoundaryId(const boundary_id_type old_id, const boundary_id_type new_id, bool delete_prev)
std::string getRawNames() const
const std::vector< SubdomainName > _block_name
Subdomain Name of the mesh.
const BoundaryName _external_boundary_name
Boundary Name of the external boundary.
std::unique_ptr< MeshBase > generate() override
SimpleHexagonGenerator(const InputParameters ¶meters)
static InputParameters validParams()
const PolygonSizeStyle _hexagon_size_style
Style of the size parameter.
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template cos(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(cos
enum SimpleHexagonGenerator::ElemType _element_type
Real _pitch
Pitch size of the hexagon.
void paramError(const std::string ¶m, Args... args) const
This SimpleHexagonGenerator object is designed to generate a simple hexagonal mesh that only contains...
ElemType
Type of elements to build the mesh.
registerMooseObject("ReactorApp", SimpleHexagonGenerator)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
A base class that contains common members for Reactor module mesh generators.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const bool _boundary_id_valid
Whether external_boundary_id is provided.
const unsigned int _radial_intervals
Number of radial meshing intervals.
void ErrorVector unsigned int
PolygonSizeStyle
An enum class for style of input polygon size.