https://mooseframework.inl.gov
PatternedCartesianMeshGenerator.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 
14 #include "MooseEnum.h"
15 #include "MeshMetaDataInterface.h"
17 
23 {
24 public:
26 
28 
29  std::unique_ptr<MeshBase> generate() override;
30 
31 protected:
33  const std::vector<std::unique_ptr<MeshBase> *> _mesh_ptrs;
35  const std::vector<MeshGeneratorName> & _input_names;
37  const std::vector<std::vector<unsigned int>> & _pattern;
43  const unsigned int _background_intervals;
45  const bool _has_assembly_duct;
47  std::vector<Real> _duct_sizes;
51  const std::vector<unsigned int> _duct_intervals;
61  const std::vector<subdomain_id_type> _duct_block_ids;
63  const std::vector<SubdomainName> _duct_block_names;
65  const BoundaryName _stitching_boundary_name;
69  const BoundaryName _external_boundary_name;
79  std::vector<subdomain_id_type> _peripheral_block_ids;
81  std::vector<SubdomainName> _peripheral_block_names;
83  const bool _use_reporting_id;
85  std::vector<std::string> _reporting_id_names;
87  std::vector<ReportingIDGeneratorUtils::AssignType> _assign_types;
89  const bool _use_exclude_id;
91  std::vector<bool> _exclude_ids;
93  std::map<std::string, std::vector<std::vector<dof_id_type>>> _id_patterns;
97  std::vector<std::vector<boundary_id_type>> _interface_boundary_id_shift_pattern;
103  const bool _verbose_stitching;
104 
120  void addPeripheralMesh(ReplicatedMesh & mesh,
121  const unsigned int pattern, //_pattern[i][j]
122  const Real pitch, // pitch_array.front()
123  const std::vector<Real> & extra_dist,
124  const std::vector<unsigned int> & num_sectors_per_side_array,
125  const std::vector<unsigned int> & peripheral_duct_intervals,
126  const Real rotation_angle,
127  const unsigned int mesh_type);
128 
139  void positionSetup(std::vector<std::pair<Real, Real>> & positions_inner,
140  std::vector<std::pair<Real, Real>> & d_positions_outer,
141  const Real extra_dist_in,
142  const Real extra_dist_out,
143  const Real pitch) const;
149  void addReportingIDs(MeshBase & mesh,
150  const std::vector<std::unique_ptr<ReplicatedMesh>> & from_meshes) const;
151 };
const bool _deform_non_circular_region
Whether the non-circular region (outside the rings) can be deformed.
const std::vector< std::vector< unsigned int > > & _pattern
2D vector of the square pattern
const bool _use_interface_boundary_id_shift
whether the interface boundary ids from input meshes are shifted, using a user-defined pattern of val...
const bool _uniform_mesh_on_sides
Whether the nodes on the external boundary are uniformly distributed.
const bool _use_reporting_id
Whether reporting ID is added to mesh.
std::vector< std::vector< boundary_id_type > > _interface_boundary_id_shift_pattern
hold user-defined shift values for each pattern cell
const BoundaryName _stitching_boundary_name
Name of the boundary used for stitching.
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
Computes the inner and outer node positions of the peripheral region for a single layer...
const std::vector< MeshGeneratorName > & _input_names
Names of input meshes.
const InputParameters & parameters() const
const bool _generate_control_drum_positions_file
Whether a text file containing control drum positions is generated.
const std::vector< SubdomainName > _duct_block_names
Subdomain Names of the duct layers.
const bool _has_assembly_duct
Whether the square pattern has external duct(s)
QUAD_ELEM_TYPE _boundary_quad_elem_type
Type of quadrilateral elements to be generated in the periphery region.
std::vector< SubdomainName > _peripheral_block_names
Subdomain Names of the peripheral regions.
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...
This PatternedCartesianMeshGenerator source code assembles square meshes into a rectangular grid and ...
std::unique_ptr< MeshBase > generate() override
Real _pattern_pitch
Pitch size of the input assembly mesh.
const bool _create_outward_interface_boundaries
Whether outward interface boundaries are created.
const BoundaryName _external_boundary_name
Boundary name of mesh&#39;s external boundary.
const bool _use_exclude_id
flag to indicate if exclude_id is defined
const PolygonSizeStyle _duct_sizes_style
Style of the duct size parameter(s)
const MooseEnum _pattern_boundary
Type of the external boundary shape.
int8_t boundary_id_type
PatternedCartesianMeshGenerator(const InputParameters &parameters)
static const std::string pitch
std::vector< ReportingIDGeneratorUtils::AssignType > _assign_types
reporting ID assignment type
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 each part outer part of stitched square meshes.
const unsigned int _background_intervals
Number of radial intervals in the background region.
std::vector< std::string > _reporting_id_names
names of reporting ID
const std::vector< std::unique_ptr< MeshBase > * > _mesh_ptrs
The input meshes.
const bool _create_inward_interface_boundaries
Whether inward interface boundaries are created.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
A base class that contains common members for Reactor module mesh generators.
const Real _rotate_angle
The mesh rotation angle after mesh generation.
const bool _generate_core_metadata
Whether a reactor core mesh with core metadata is generated.
std::vector< Real > _duct_sizes
Size parameter(s) of duct(s)
void addReportingIDs(MeshBase &mesh, const std::vector< std::unique_ptr< ReplicatedMesh >> &from_meshes) const
Adds the reporting IDs onto the input mesh.
std::vector< bool > _exclude_ids
vector indicating which ids in the pattern to exclude (true at pattern positions to exclude) ...
const boundary_id_type _external_boundary_id
Boundary ID of mesh&#39;s external boundary.
const std::vector< subdomain_id_type > _duct_block_ids
Subdomain IDs of the duct layers.
const bool _allow_unused_inputs
Whether to allow additional assembly types to be passed to "inputs" parameter without being used in l...
std::vector< subdomain_id_type > _peripheral_block_ids
Subdomain IDs of the peripheral regions.
const bool _assign_control_drum_id
Wheter control drum IDs are assigned as an extra element integer.
const bool _verbose_stitching
Whether the mesh stitching should be verbose.
const std::vector< unsigned int > _duct_intervals
Number(s) of radial intervals of duct layer(s)
PolygonSizeStyle
An enum class for style of input polygon size.