https://mooseframework.inl.gov
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 {
20 public:
22 
24 
25  std::unique_ptr<MeshBase> generate() override;
26 
27 protected:
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;
45  const bool _preserve_volumes;
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;
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 
95 private:
99  template <typename T>
100  std::vector<std::vector<T>> getRingParamValues(const std::string & param_name) const;
101 };
102 
103 template <typename T>
104 std::vector<std::vector<T>>
105 TriPinHexAssemblyGenerator::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 std::string _external_boundary_name
Boundary name of mesh&#39;s external boundary.
AssmOrient
Assembly orientation option.
const std::vector< std::vector< unsigned int > > _ring_intervals
Numbers of radial layers in each ring region in the three diamond sections.
enum TriPinHexAssemblyGenerator::AssmOrient _assembly_orientation
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 std::vector< std::vector< SubdomainName > > _ring_block_names
Block names of the ring regions in the three diamond sections.
const Real _ring_offset
Offset distance of the circle centers from the center of each diamond section.
const bool _preserve_volumes
Whether the radii need to be corrected for polygonization during meshing.
const PolygonSizeStyle _hexagon_size_style
Type of hexagon_size parameter.
bool isParamValid(const std::string &name) const
const std::vector< dof_id_type > _pin_id_values
Values of extra integer ID to be assigned to each of the three pin domains.
This TriPinHexAssemblyGenerator object is a base class to be inherited for polygon mesh generators...
int8_t boundary_id_type
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
const unsigned int _background_intervals
Numbers of radial intervals of the background regions.
const std::vector< std::vector< Real > > _ring_radii
Radii of concentric circles in the three diamond sections.
const std::vector< bool > _has_rings
Whether the generated mesh contains ring regions.
dof_id_type & _node_id_background_meta
MeshMetaData: maximum node id of the background region.
void paramError(const std::string &param, Args... args) const
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< MeshBase > generate() override
const boundary_id_type _external_boundary_id
Boundary ID of mesh&#39;s external boundary.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string ring_radii
const std::vector< SubdomainName > _background_block_names
Block names of the background region.
const Real _side_length
Length of the side of the hexagon.
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 ...
std::vector< std::vector< T > > getRingParamValues(const std::string &param_name) const
Helper for getting a parameter that describes rings.
A base class that contains common members for Reactor module mesh generators.
TriPinHexAssemblyGenerator(const InputParameters &parameters)
const std::string _pin_id_name
Name of extra integer ID to be assigned to each of the three pin domains.
const InputParameters & parameters() const
uint8_t dof_id_type
PolygonSizeStyle
An enum class for style of input polygon size.
static InputParameters validParams()