https://mooseframework.inl.gov
PatternedHexMeshGenerator.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
13 #include "MooseEnum.h"
14 #include "MeshMetaDataInterface.h"
15 
21 {
22 public:
24 
26 
27  std::unique_ptr<MeshBase> generate() override;
28 
29 protected:
31  const std::vector<std::unique_ptr<MeshBase> *> _mesh_ptrs;
32 
34  const std::vector<MeshGeneratorName> & _input_names;
36  const std::vector<std::vector<unsigned int>> & _pattern;
42  const unsigned int _background_intervals;
44  const bool _has_assembly_duct;
46  std::vector<Real> _duct_sizes;
50  const std::vector<unsigned int> _duct_intervals;
60  const std::vector<subdomain_id_type> _duct_block_ids;
62  const std::vector<SubdomainName> _duct_block_names;
66  const BoundaryName _external_boundary_name;
78  std::vector<subdomain_id_type> _peripheral_block_ids;
80  std::vector<SubdomainName> _peripheral_block_names;
82  const bool _use_reporting_id;
84  std::vector<std::string> _reporting_id_names;
86  std::vector<ReportingIDGeneratorUtils::AssignType> _assign_types;
88  const bool _use_exclude_id;
90  std::vector<bool> _exclude_ids;
92  std::map<std::string, std::vector<std::vector<dof_id_type>>> _id_patterns;
96  std::vector<std::vector<boundary_id_type>> _interface_boundary_id_shift_pattern;
101 
116  void addPeripheralMesh(ReplicatedMesh & mesh,
117  const unsigned int pattern, //_pattern{i][j]
118  const Real pitch, // pitch_array.front()
119  const std::vector<Real> & extra_dist,
120  const std::vector<unsigned int> & num_sectors_per_side_array,
121  const std::vector<unsigned int> & peripheral_duct_intervals,
122  const Real rotation_angle,
123  const unsigned int mesh_type);
124 
136  void positionSetup(std::vector<std::pair<Real, Real>> & positions_inner,
137  std::vector<std::pair<Real, Real>> & d_positions_outer,
138  const Real extra_dist_in,
139  const Real extra_dist_out,
140  const Real pitch,
141  const unsigned int radial_index) const;
147  void addReportingIDs(MeshBase & mesh,
148  const std::vector<std::unique_ptr<ReplicatedMesh>> & from_meshes) const;
149 };
const bool _use_reporting_id
Whether reporting ID is added to mesh.
const PolygonSizeStyle _duct_sizes_style
Style of the duct size parameter(s)
void positionSetup(std::vector< std::pair< Real, Real >> &positions_inner, std::vector< std::pair< Real, Real >> &d_positions_outer, const Real extra_dist_in, const Real extra_dist_out, const Real pitch, const unsigned int radial_index) const
Computes the inner and outer node positions of the peripheral region for a single layer...
const std::vector< unsigned int > _duct_intervals
Number(s) of radial intervals of duct layer(s)
std::vector< std::string > _reporting_id_names
names of reporting ID
const bool _allow_unused_inputs
Whether to allow additional assembly types to be passed to "inputs" parameter without being used in l...
const MooseEnum _pattern_boundary
Type of the external boundary shape.
const bool _has_assembly_duct
Whether the hexagonal pattern has external duct(s)
const unsigned int _background_intervals
Number of radial intervals in the background region.
std::vector< SubdomainName > _peripheral_block_names
Subdomain Names of the peripheral regions.
const bool _assign_control_drum_id
Wheter control drum IDs are assigned as an extra element integer.
const std::vector< std::vector< unsigned int > > & _pattern
2D vector of the hexagonal pattern
const PolygonSizeStyle _hexagon_size_style
Style of the polygon size parameter.
const bool _create_inward_interface_boundaries
Whether inward interface boundaries are created.
const bool _create_outward_interface_boundaries
Whether outward interface boundaries are created.
std::vector< std::vector< boundary_id_type > > _interface_boundary_id_shift_pattern
hold user-defined shift values for each pattern cell
const std::vector< MeshGeneratorName > & _input_names
Names of input meshes.
const Real _rotate_angle
The mesh rotation angle after mesh generation.
int8_t boundary_id_type
const std::vector< SubdomainName > _duct_block_names
Subdomain Names of the duct layers.
std::vector< ReportingIDGeneratorUtils::AssignType > _assign_types
reporting ID assignment type
const bool _uniform_mesh_on_sides
Whether the nodes on the external boundary are uniformly distributed.
static const std::string pitch
QUAD_ELEM_TYPE _boundary_quad_elem_type
Type of quadrilateral elements to be generated in the periphery region.
std::vector< Real > _duct_sizes
Size parameter(s) of duct(s)
const std::vector< std::unique_ptr< MeshBase > * > _mesh_ptrs
The input meshes.
const bool _use_exclude_id
flag to indicate if exclude_id is defined
const std::vector< subdomain_id_type > _duct_block_ids
Subdomain IDs of the duct layers.
const boundary_id_type _external_boundary_id
Boundary ID of mesh&#39;s external boundary.
const bool _deform_non_circular_region
Whether the non-circular region (outside the rings) can be deformed.
const bool _generate_control_drum_positions_file
Whether a text file containing control drum positions is generated.
std::vector< subdomain_id_type > _peripheral_block_ids
Subdomain IDs of the peripheral regions.
std::unique_ptr< MeshBase > generate() override
const bool _use_interface_boundary_id_shift
whether the interface boundary ids from input meshes are shifted, using a user-defined pattern of val...
PatternedHexMeshGenerator(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addPeripheralMesh(ReplicatedMesh &mesh, const unsigned int pattern, const Real pitch, const std::vector< Real > &extra_dist, const std::vector< unsigned int > &num_sectors_per_side_array, const std::vector< unsigned int > &peripheral_duct_intervals, const Real rotation_angle, const unsigned int mesh_type)
Adds background and duct region mesh to stitched hexagon meshes.
This PatternedHexMeshGenerator source code assembles hexagonal meshes into a hexagonal grid and optio...
void addReportingIDs(MeshBase &mesh, const std::vector< std::unique_ptr< ReplicatedMesh >> &from_meshes) const
Adds the reporting IDs onto the input mesh.
A base class that contains common members for Reactor module mesh generators.
Real _pattern_pitch
Pitch size of the input assembly mesh.
static InputParameters validParams()
const InputParameters & parameters() const
const BoundaryName _external_boundary_name
Boundary name of mesh&#39;s external boundary.
std::vector< bool > _exclude_ids
vector indicating which ids in the pattern to exclude (true at pattern positions to exclude) ...
std::map< std::string, std::vector< std::vector< dof_id_type > > > _id_patterns
hold ID patterns for each manual reporting ID. Individual ID pattern contains ID values for each patt...
const bool _generate_core_metadata
Whether a reactor core mesh with core metadata is generated.
PolygonSizeStyle
An enum class for style of input polygon size.