20 "Print out RGMB-related metadata to console output",
21 "This parameter is deprecated. Please use MeshMetaDataReporter " 22 "system to print out mesh metadata to JSON output file instead");
23 params.
addClassDescription(
"A base class that contains common members and methods for Reactor " 24 "Geometry Mesh Builder mesh generators.");
35 "generate_depletion_id",
false,
"Determine wheter the depletion ID is assigned.");
36 MooseEnum depletion_id_option(
"assembly assembly_type pin pin_type");
39 "Determine level of details in depletion ID assignment.");
40 params.
addParamNamesToGroup(
"generate_depletion_id depletion_id_type",
"Depletion ID assignment");
56 mooseError(
"The reactor_params mesh is not of the correct type");
58 if (!hasMeshProperty<unsigned int>(
"mesh_dimensions",
_reactor_params) ||
60 mooseError(
"The reactor_params input must be a ReactorMeshParams type MeshGenerator\n Please " 61 "check that a valid definition and name of ReactorMeshParams has been provided.");
75 std::string extra_int_name,
78 if (input_mesh.has_elem_integer(extra_int_name))
79 return input_mesh.get_elem_integer_index(extra_int_name);
83 mooseError(
"Expected extruded mesh to have " + extra_int_name +
" extra integers");
85 return input_mesh.add_elem_integer(extra_int_name);
91 MeshBase & input_mesh,
93 std::map<std::string, SubdomainID> & name_id_map,
94 std::string elem_block_name,
98 if (name_id_map.find(elem_block_name) == name_id_map.end())
101 elem_block_id = next_free_id++;
102 elem->subdomain_id() = elem_block_id;
103 input_mesh.subdomain_name(elem_block_id) = elem_block_name;
104 name_id_map[elem_block_name] = elem_block_id;
109 elem_block_id = name_id_map[elem_block_name];
110 elem->subdomain_id() = elem_block_id;
121 std::vector<ExtraElementIDName> id_names = {};
123 id_names.push_back(
"plane_id");
127 id_names.insert(id_names.end(), {
"assembly_id",
"pin_id"});
128 else if (option ==
"pin_type")
129 id_names.insert(id_names.end(), {
"assembly_id",
"pin_type_id"});
130 else if (option ==
"assembly")
131 id_names.push_back(
"assembly_id");
132 else if (option ==
"assembly_type")
133 id_names.push_back(
"assembly_type_id");
138 id_names.push_back(
"pin_id");
139 else if (option ==
"pin_type")
140 id_names.push_back(
"pin_type_id");
143 "'assembly_id' or 'assembly_type_id' is not allowed in depletion ID generation at " 148 if (option ==
"pin_type")
149 id_names.push_back(
"pin_type_id");
152 "Only 'pin_type' is allowed in depletion ID generation at " 156 mooseError(
"Depletion ID generation is not supported at pin level yet in RGMB");
157 id_names.push_back(
"region_id");
159 std::set<SubdomainID> block_ids = {};
163 std::unordered_map<dof_id_type, dof_id_type> depl_ids =
166 const auto depl_id_index = input_mesh.add_elem_integer(
"depletion_id");
167 for (Elem *
const elem : input_mesh.active_element_ptr_range())
168 elem->set_extra_integer(depl_id_index, depl_ids.at(elem->id()));
173 const MeshGeneratorName input_mesh_name)
182 params.
set<MeshGeneratorName>(
"input") = input_mesh_name;
183 params.set<Point>(
"direction") = Point(0, 0, 1);
184 params.set<std::vector<unsigned int>>(
"num_layers") =
186 params.set<std::vector<Real>>(
"heights") = axial_boundaries;
187 params.set<BoundaryName>(
"bottom_boundary") = std::to_string(bottom_boundary);
188 params.set<BoundaryName>(
"top_boundary") = std::to_string(top_boundary);
195 params.
set<MeshGeneratorName>(
"input") =
name() +
"_extruded";
196 params.set<std::vector<BoundaryName>>(
"old_boundary") = {
197 std::to_string(top_boundary),
198 std::to_string(bottom_boundary)};
199 params.set<std::vector<BoundaryName>>(
"new_boundary") = {
"top",
"bottom"};
203 const MeshGeneratorName output_mesh_name =
name() +
"_extrudedIDs";
207 params.
set<MeshGeneratorName>(
"input") =
name() +
"_change_plane_name";
209 std::vector<Real> plane_heights{0};
210 for (
Real z : axial_boundaries)
211 plane_heights.push_back(z + plane_heights.back());
213 params.set<std::vector<Real>>(
"plane_coordinates") = plane_heights;
215 std::string plane_id_name =
"plane_id";
216 params.set<std::string>(
"id_name") =
"plane_id";
221 return output_mesh_name;
std::unique_ptr< MeshBase > & getMeshByName(const MeshGeneratorName &mesh_generator_name)
static void addDepletionIDParams(InputParameters ¶meters)
std::unordered_map< dof_id_type, dof_id_type > getExtraIDUniqueCombinationMap(const MeshBase &mesh, const std::set< SubdomainID > &block_ids, std::vector< ExtraElementIDName > extra_ids)
void updateElementBlockNameId(MeshBase &input_mesh, Elem *elem, std::map< std::string, SubdomainID > &name_id_map, std::string elem_block_name, SubdomainID &next_free_id)
Updates the block names and ids of the element in an input mesh according to a map of block name to b...
unsigned int getElemIntegerFromMesh(MeshBase &input_mesh, std::string extra_int_name, bool should_exist=false)
Initializes extra element integer from id name for a given mesh and throws an error if it should exis...
void initializeReactorMeshParams(const std::string reactor_param_name)
Initializes and checks validity of ReactorMeshParams mesh generator object.
InputParameters getValidParams(const std::string &name) const
void addDepletionId(MeshBase &input_mesh, const MooseEnum &option, const DepletionIDGenerationLevel generation_level, const bool extrude)
add depletion IDs
static const std::string axial_mesh_sizes
static InputParameters validParams()
virtual const std::string & name() const
const T & getReactorParam(const std::string ¶m_name)
Returns reference of parameter in ReactorMeshParams object.
std::unique_ptr< MeshBase > * _reactor_params_mesh
The dummy param mesh that we need to clear once we've generated (in freeReactorMeshParams) ...
void addMeshSubgenerator(const std::string &type, const std::string &name, Ts... extra_input_parameters)
MeshGeneratorName callExtrusionMeshSubgenerators(const MeshGeneratorName input_mesh_name)
Calls mesh subgenerators related to extrusion, renaming of top / bottom boundaries, and defining plane IDs.
DepletionIDGenerationLevel
specify the depletion id is generated at which reactor generation level
static const std::string top_boundary_id
MeshGeneratorName _reactor_params
The ReactorMeshParams object that is storing the reactor global information for this reactor geometry...
void paramError(const std::string ¶m, Args... args) const
ReactorGeometryMeshBuilderBase(const InputParameters ¶meters)
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string axial_mesh_intervals
void mooseError(Args &&... args) const
void freeReactorMeshParams()
Releases the mesh obtained in _reactor_params_mesh.
static void setHasGenerateData(InputParameters ¶ms)
T & declareMeshProperty(const std::string &data_name, Args &&... args)
static const std::string bottom_boundary_id