https://mooseframework.inl.gov
Loading...
Searching...
No Matches
HexagonConcentricCircleAdaptiveBoundaryMeshGenerator.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11
12#include <cmath>
13
15
18{
21 "hexagon_size", "hexagon_size>0.0", "Size of the hexagon to be generated.");
22 MooseEnum hexagon_size_style("apothem radius", "apothem");
23 params.addParam<MooseEnum>(
24 "hexagon_size_style",
25 hexagon_size_style,
26 "Style in which the hexagon size is given (default: apothem i.e. half-pitch).");
27 params.addParam<std::vector<unsigned int>>(
28 "sides_to_adapt",
29 "List of the hexagon reference side indices that correspond to the sides that need adaptive "
30 "meshing. The meshes to adapt these sides to are provided in 'inputs'.");
31 params.addDeprecatedParam<std::vector<MeshGeneratorName>>(
32 "inputs",
33 "The name list of the input meshes to adapt to.",
34 "Deprecated parameter, please use 'meshes_to_adapt_to' instead.");
35 params.addParam<std::vector<MeshGeneratorName>>("meshes_to_adapt_to",
36 "The name list of the input meshes to adapt to.");
37 params.addParam<bool>("is_control_drum",
38 false,
39 "Whether this mesh is for a control drum. The value can be set as 'false' "
40 "if the user wants to use this object for other components.");
41 params.setParameters<bool>("uniform_mesh_on_sides", false);
42 params.setParameters<bool>("quad_center_elements", false);
43 params.setParameters<unsigned int>("smoothing_max_it", 0);
44 params.suppressParameter<bool>("uniform_mesh_on_sides");
45 params.suppressParameter<bool>("quad_center_elements");
46 params.suppressParameter<unsigned int>("smoothing_max_it");
47 params.suppressParameter<Real>("center_quad_factor");
48 params.addParamNamesToGroup("is_control_drum", "Control Drum");
50 "This HexagonConcentricCircleAdaptiveBoundaryMeshGenerator object is designed to generate "
51 "hexagonal meshes with adaptive boundary to facilitate stitching.");
52
53 return params;
54}
55
59 _input_names(isParamValid("meshes_to_adapt_to")
60 ? getParam<std::vector<MeshGeneratorName>>("meshes_to_adapt_to")
61 : (isParamValid("inputs") ? getParam<std::vector<MeshGeneratorName>>("inputs")
62 : std::vector<MeshGeneratorName>()))
63{
64 if (_sides_to_adapt.size() != _input_names.size())
65 paramError("sides_to_adapt",
66 "This parameter and meshes_to_adapt_to must have the same length.");
67 if (isParamValid("inputs") && isParamValid("meshes_to_adapt_to"))
68 paramError("inputs",
69 "this parameter is deprecated; it cannot be provided along with the new parameter "
70 "'meshes_to_adapt_to'.");
71 if (isParamValid("inputs"))
72 _input_ptrs = getMeshes("inputs");
73 else if (isParamValid("meshes_to_adapt_to"))
74 _input_ptrs = getMeshes("meshes_to_adapt_to");
75 _is_control_drum_meta = getParam<bool>("is_control_drum");
76 _is_general_polygon = false;
77}
registerMooseObject("ReactorApp", HexagonConcentricCircleAdaptiveBoundaryMeshGenerator)
This HexagonConcentricCircleAdaptiveBoundaryMeshGenerator object is designed to generate hexagonal me...
const std::vector< MeshGeneratorName > _input_names
Name of input mesh generator.
void suppressParameter(const std::string &name)
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void setParameters(const std::string &name, const T &value, Ts... extra_input_parameters)
std::vector< std::unique_ptr< MeshBase > * > getMeshes(const std::string &param_name)
void paramError(const std::string &param, Args... args) const
bool isParamValid(const std::string &name) const
This PolygonConcentricCircleMeshGeneratorBase object is a base class to be inherited for polygon mesh...
bool _is_general_polygon
MeshMetaData: whether this produced mesh is a general polygon (or a hexagon)
std::vector< std::unique_ptr< MeshBase > * > _input_ptrs
Pointers to input mesh pointers.
bool & _is_control_drum_meta
MeshMetaData: whether this produced mesh is a control drum.
const std::vector< unsigned int > _sides_to_adapt
Indices of the hexagon sides that need to adapt.