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
13 #include "MooseEnum.h"
14 #include "MeshMetaDataInterface.h"
16 
22 {
23 public:
25 
27 
28  std::unique_ptr<MeshBase> generate() override;
29 
30 protected:
32  const std::vector<std::unique_ptr<MeshBase> *> _mesh_ptrs;
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;
64  const BoundaryName _stitching_boundary_name;
68  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;
102  const bool _verbose_stitching;
103 
119  void addPeripheralMesh(ReplicatedMesh & mesh,
120  const unsigned int pattern, //_pattern[i][j]
121  const Real pitch, // pitch_array.front()
122  const std::vector<Real> & extra_dist,
123  const std::vector<unsigned int> & num_sectors_per_side_array,
124  const std::vector<unsigned int> & peripheral_duct_intervals,
125  const Real rotation_angle,
126  const unsigned int mesh_type);
127 
138  void positionSetup(std::vector<std::pair<Real, Real>> & positions_inner,
139  std::vector<std::pair<Real, Real>> & d_positions_outer,
140  const Real extra_dist_in,
141  const Real extra_dist_out,
142  const Real pitch) const;
148  void addReportingIDs(MeshBase & mesh,
149  const std::vector<std::unique_ptr<ReplicatedMesh>> & from_meshes) const;
150 };
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 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)
const InputParameters & parameters() const
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.