https://mooseframework.inl.gov
Loading...
Searching...
No Matches
TriPinHexAssemblyGenerator.h
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
10#pragma once
11
13
19{
20public:
22
24
25 std::unique_ptr<MeshBase> generate() override;
26
27protected:
29 const std::vector<std::vector<Real>> _ring_radii;
31 const std::vector<bool> _has_rings;
33 const std::vector<std::vector<unsigned int>> _ring_intervals;
35 const std::vector<std::vector<subdomain_id_type>> _ring_block_ids;
37 const std::vector<std::vector<SubdomainName>> _ring_block_names;
41 const Real _side_length;
43 const Real _ring_offset;
49 const unsigned int _num_sectors_per_side;
51 const unsigned int _background_intervals;
53 const std::vector<subdomain_id_type> _background_block_ids;
55 const std::vector<SubdomainName> _background_block_names;
57 const boundary_id_type _external_boundary_id;
59 const std::string _external_boundary_name;
61 const std::string _pin_id_name;
63 const std::vector<dof_id_type> _pin_id_values;
66
83 std::unique_ptr<ReplicatedMesh>
84 buildSinglePinSection(const Real side_length,
85 const Real ring_offset,
86 const std::vector<Real> ring_radii,
87 const std::vector<unsigned int> ring_intervals,
88 const bool has_rings,
89 const bool preserve_volumes,
90 const unsigned int num_sectors_per_side,
91 const unsigned int background_intervals,
92 const std::vector<subdomain_id_type> block_ids_new,
93 dof_id_type & node_id_background_meta);
94
95private:
99 template <typename T>
100 std::vector<std::vector<T>> getRingParamValues(const std::string & param_name) const;
101};
102
103template <typename T>
104std::vector<std::vector<T>>
105TriPinHexAssemblyGenerator::getRingParamValues(const std::string & param_name) const
106{
107 std::vector<std::vector<T>> value = {{}, {}, {}};
108
109 if (isParamValid(param_name))
110 {
111 const auto & param_value = getParam<std::vector<std::vector<T>>>(param_name);
112 if (param_value.size() == 1)
113 value = {param_value[0], param_value[0], param_value[0]};
114 else if (param_value.size() == 3)
115 value = param_value;
116 else if (param_value.size() != 0) // override case where you want to unset it
117 paramError(param_name, "This parameter must have a size of one or three.");
118 }
119
120 return value;
121}
const InputParameters & parameters() const
void paramError(const std::string &param, Args... args) const
bool isParamValid(const std::string &name) const
A base class that contains common members for Reactor module mesh generators.
PolygonSizeStyle
An enum class for style of input polygon size.
This TriPinHexAssemblyGenerator object is a base class to be inherited for polygon mesh generators.
const Real _side_length
Length of the side of the hexagon.
static InputParameters validParams()
const std::vector< std::vector< SubdomainName > > _ring_block_names
Block names of the ring regions in the three diamond sections.
enum TriPinHexAssemblyGenerator::AssmOrient _assembly_orientation
const std::vector< std::vector< unsigned int > > _ring_intervals
Numbers of radial layers in each ring region in the three diamond sections.
AssmOrient
Assembly orientation option.
const PolygonSizeStyle _hexagon_size_style
Type of hexagon_size parameter.
dof_id_type & _node_id_background_meta
MeshMetaData: maximum node id of the background region.
std::unique_ptr< MeshBase > generate() override
const std::vector< subdomain_id_type > _background_block_ids
Block ids of the background region.
const unsigned int _num_sectors_per_side
Mesh sector number of each polygon side.
const unsigned int _background_intervals
Numbers of radial intervals of the background regions.
const std::vector< bool > _has_rings
Whether the generated mesh contains ring regions.
const std::string _external_boundary_name
Boundary name of mesh's external boundary.
const std::string _pin_id_name
Name of extra integer ID to be assigned to each of the three pin domains.
const std::vector< std::vector< Real > > _ring_radii
Radii of concentric circles in the three diamond sections.
const boundary_id_type _external_boundary_id
Boundary ID of mesh's external boundary.
const std::vector< dof_id_type > _pin_id_values
Values of extra integer ID to be assigned to each of the three pin domains.
const Real _ring_offset
Offset distance of the circle centers from the center of each diamond section.
const std::vector< SubdomainName > _background_block_names
Block names of the background region.
const std::vector< std::vector< subdomain_id_type > > _ring_block_ids
Block ids of the ring regions in the three diamond sections.
std::unique_ptr< ReplicatedMesh > buildSinglePinSection(const Real side_length, const Real ring_offset, const std::vector< Real > ring_radii, const std::vector< unsigned int > ring_intervals, const bool has_rings, const bool preserve_volumes, const unsigned int num_sectors_per_side, const unsigned int background_intervals, const std::vector< subdomain_id_type > block_ids_new, dof_id_type &node_id_background_meta)
Generates a single-pin diamond section mesh, which is one-third of the triple-pin hexagonal assembly ...
const bool _preserve_volumes
Whether the radii need to be corrected for polygonization during meshing.
std::vector< std::vector< T > > getRingParamValues(const std::string &param_name) const
Helper for getting a parameter that describes rings.