https://mooseframework.inl.gov
CartesianConcentricCircleAdaptiveBoundaryMeshGenerator.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  "square_size", "square_size>0.0", "Size (side length) of the square mesh to be generated.");
22  MooseEnum square_size_style("apothem radius", "apothem");
23  params.setParameters<MooseEnum>("square_size_style", square_size_style);
24  params.suppressParameter<MooseEnum>("square_size_style");
25  params.addParam<std::vector<unsigned int>>(
26  "sides_to_adapt",
27  "List of the square reference side indices that correspond to the sides that need adaptive "
28  "meshing. The meshes to adapt these sides to are provided in 'inputs'.");
29  params.addParam<std::vector<MeshGeneratorName>>("meshes_to_adapt_to",
30  "The name list of the input meshes to adapt to.");
31  params.addParam<bool>("is_control_drum",
32  false,
33  "Whether this mesh is for a control drum. The value can be set as 'false' "
34  "if the user wants to use this object for other components.");
35  params.setParameters<bool>("flat_side_up", true);
36  params.setParameters<bool>("uniform_mesh_on_sides", false);
37  params.setParameters<bool>("quad_center_elements", false);
38  params.setParameters<unsigned int>("smoothing_max_it", 0);
39  params.suppressParameter<bool>("flat_side_up");
40  params.suppressParameter<bool>("uniform_mesh_on_sides");
41  params.suppressParameter<bool>("quad_center_elements");
42  params.suppressParameter<unsigned int>("smoothing_max_it");
43  params.suppressParameter<Real>("center_quad_factor");
44  params.addParamNamesToGroup("is_control_drum", "Control Drum");
45  params.addClassDescription(
46  "This CartesianConcentricCircleAdaptiveBoundaryMeshGenerator object is designed to generate "
47  "square meshes with adaptive boundary to facilitate stitching.");
48 
49  return params;
50 }
51 
55  _input_names(isParamValid("meshes_to_adapt_to")
56  ? getParam<std::vector<MeshGeneratorName>>("meshes_to_adapt_to")
57  : std::vector<MeshGeneratorName>())
58 {
59  if (_sides_to_adapt.size() != _input_names.size())
60  paramError("sides_to_adapt",
61  "This parameter and meshes_to_adapt_to must have the same length.");
62  if (isParamValid("meshes_to_adapt_to"))
63  _input_ptrs = getMeshes("meshes_to_adapt_to");
64  _is_control_drum_meta = getParam<bool>("is_control_drum");
65  _is_general_polygon = false;
66 }
std::vector< std::unique_ptr< MeshBase > * > _input_ptrs
Pointers to input mesh pointers.
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
registerMooseObject("ReactorApp", CartesianConcentricCircleAdaptiveBoundaryMeshGenerator)
void suppressParameter(const std::string &name)
bool isParamValid(const std::string &name) const
This PolygonConcentricCircleMeshGeneratorBase object is a base class to be inherited for polygon mesh...
std::vector< std::unique_ptr< MeshBase > *> getMeshes(const std::string &param_name)
void paramError(const std::string &param, Args... args) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::vector< MeshGeneratorName > _input_names
Name of input mesh generator.
bool _is_general_polygon
MeshMetaData: whether this produced mesh is a general polygon (or a hexagon)
void addClassDescription(const std::string &doc_string)
This CartesianConcentricCircleAdaptiveBoundaryMeshGenerator object is designed to generate cartesian ...
const std::vector< unsigned int > _sides_to_adapt
Indices of the hexagon sides that need to adapt.
void setParameters(const std::string &name, const T &value, Ts... extra_input_parameters)
bool & _is_control_drum_meta
MeshMetaData: whether this produced mesh is a control drum.
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)