https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
PatternedCartesianMeshGenerator Class Reference

This PatternedCartesianMeshGenerator source code assembles square meshes into a rectangular grid and optionally adds a duct around the grid. More...

#include <PatternedCartesianMeshGenerator.h>

Inheritance diagram for PatternedCartesianMeshGenerator:
[legend]

Public Types

enum class  PolygonSizeStyle { apothem , radius }
 An enum class for style of input polygon size. More...
 
enum  MESH_TYPE { CORNER_MESH = 1 , BOUNDARY_MESH = 2 , INNER_MESH = 3 }
 
enum  RETURN_TYPE { ANGLE_DEGREE = 1 , ANGLE_TANGENT = 2 }
 
enum  INTRISIC_SUBDOMAIN_ID : subdomain_id_type { PERIPHERAL_ID_SHIFT = 1000 , TRANSITION_LAYER_DEFAULT = 10000 }
 
enum  INTRINSIC_SIDESET_ID : boundary_id_type {
  OUTER_SIDESET_ID = 10000 , OUTER_SIDESET_ID_ALT = 15000 , SLICE_BEGIN = 30000 , SLICE_END = 31000 ,
  SLICE_ALT = 30500
}
 
enum  INTRINSIC_NUM_SIDES { HEXAGON_NUM_SIDES = 6 , SQUARE_NUM_SIDES = 4 }
 
enum class  TRI_ELEM_TYPE { TRI3 , TRI6 , TRI7 }
 
enum class  QUAD_ELEM_TYPE { QUAD4 , QUAD8 , QUAD9 }
 
typedef DataFileName DataFileParameterType
 

Public Member Functions

 PatternedCartesianMeshGenerator (const InputParameters &parameters)
 
std::unique_ptr< MeshBase > generate () override
 
std::unique_ptr< CSG::CSGBasegenerateInternalCSG ()
 
std::unique_ptr< MeshBase > generateInternal ()
 
const std::set< MeshGeneratorName > & getRequestedMeshGenerators () const
 
const std::set< MeshGeneratorName > & getRequestedMeshGeneratorsForSub () const
 
void addParentMeshGenerator (const MeshGenerator &mg, const AddParentChildKey)
 
void addChildMeshGenerator (const MeshGenerator &mg, const AddParentChildKey)
 
const std::set< const MeshGenerator *, Comparator > & getParentMeshGenerators () const
 
const std::set< const MeshGenerator *, Comparator > & getChildMeshGenerators () const
 
const std::set< const MeshGenerator *, Comparator > & getSubMeshGenerators () const
 
bool isParentMeshGenerator (const MeshGeneratorName &name, const bool direct=true) const
 
bool isChildMeshGenerator (const MeshGeneratorName &name, const bool direct=true) const
 
bool isNullMeshName (const MeshGeneratorName &name) const
 
bool hasSaveMesh () const
 
bool hasOutput () const
 
const std::string & getSavedMeshName () const
 
bool hasGenerateData () const
 
bool hasGenerateCSG () const
 
bool isDataOnly () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
bool isKokkosObject () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static bool hasGenerateData (const InputParameters &params)
 
static bool hasGenerateCSG (const InputParameters &params)
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 
static void setHasGenerateData (InputParameters &params)
 
static void setHasGenerateCSG (InputParameters &params)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string data_only_param
 
static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

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.
 
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.
 
void addReportingIDs (MeshBase &mesh, const std::vector< std::unique_ptr< ReplicatedMesh > > &from_meshes) const
 Adds the reporting IDs onto the input mesh.
 
std::unique_ptr< ReplicatedMesh > buildSimpleSlice (std::vector< Real > ring_radii, const std::vector< unsigned int > ring_layers, const std::vector< Real > ring_radial_biases, const multiBdryLayerParams &ring_inner_boundary_layer_params, const multiBdryLayerParams &ring_outer_boundary_layer_params, std::vector< Real > ducts_center_dist, const std::vector< unsigned int > ducts_layers, const std::vector< Real > duct_radial_biases, const multiBdryLayerParams &duct_inner_boundary_layer_params, const multiBdryLayerParams &duct_outer_boundary_layer_params, const Real pitch, const unsigned int num_sectors_per_side, const unsigned int background_intervals, const Real background_radial_bias, const singleBdryLayerParams &background_inner_boundary_layer_params, const singleBdryLayerParams &background_outer_boundary_layer_params, dof_id_type &node_id_background_meta, const unsigned int side_number, const unsigned int side_index, const std::vector< Real > azimuthal_tangent=std::vector< Real >(), const subdomain_id_type block_id_shift=0, const bool quad_center_elements=false, const Real center_quad_factor=0.0, const bool create_inward_interface_boundaries=false, const bool create_outward_interface_boundaries=true, const boundary_id_type boundary_id_shift=0, const bool generate_side_specific_boundaries=true, const TRI_ELEM_TYPE tri_elem_type=TRI_ELEM_TYPE::TRI3, const QUAD_ELEM_TYPE quad_elem_type=QUAD_ELEM_TYPE::QUAD4)
 Creates a mesh of a slice that corresponds to a single side of the polygon to be generated.
 
std::unique_ptr< ReplicatedMesh > buildGeneralSlice (std::vector< Real > ring_radii, const std::vector< unsigned int > ring_layers, const std::vector< Real > ring_radial_biases, const multiBdryLayerParams &ring_inner_boundary_layer_params, const multiBdryLayerParams &ring_outer_boundary_layer_params, std::vector< Real > ducts_center_dist, const std::vector< unsigned int > ducts_layers, const std::vector< Real > duct_radial_biases, const multiBdryLayerParams &duct_inner_boundary_layer_params, const multiBdryLayerParams &duct_outer_boundary_layer_params, const Real primary_side_length, const Real secondary_side_length, const unsigned int num_sectors_per_side, const unsigned int background_intervals, const Real background_radial_bias, const singleBdryLayerParams &background_inner_boundary_layer_params, const singleBdryLayerParams &background_outer_boundary_layer_params, dof_id_type &node_id_background_meta, const Real azimuthal_angle, const std::vector< Real > azimuthal_tangent, const unsigned int side_index, const bool quad_center_elements, const Real center_quad_factor, const Real rotation_angle, const bool generate_side_specific_boundaries=true)
 Creates a mesh of a general polygon slice with a triangular shape and circular regions on one of its vertex.
 
std::unique_ptr< ReplicatedMesh > buildSlice (std::vector< Real > ring_radii, const std::vector< unsigned int > ring_layers, const std::vector< Real > ring_radial_biases, const multiBdryLayerParams &ring_inner_boundary_layer_params, const multiBdryLayerParams &ring_outer_boundary_layer_params, std::vector< Real > ducts_center_dist, const std::vector< unsigned int > ducts_layers, const std::vector< Real > duct_radial_biases, const multiBdryLayerParams &duct_inner_boundary_layer_params, const multiBdryLayerParams &duct_outer_boundary_layer_params, const Real pitch, const unsigned int num_sectors_per_side, const unsigned int background_intervals, const Real background_radial_bias, const singleBdryLayerParams &background_inner_boundary_layer_params, const singleBdryLayerParams &background_outer_boundary_layer_params, dof_id_type &node_id_background_meta, const Real virtual_side_number, const unsigned int side_index, const std::vector< Real > azimuthal_tangent=std::vector< Real >(), const subdomain_id_type block_id_shift=0, const bool quad_center_elements=false, const Real center_quad_factor=0.0, const bool create_inward_interface_boundaries=false, const bool create_outward_interface_boundaries=true, const boundary_id_type boundary_id_shift=0, const Real pitch_scale_factor=1.0, const bool generate_side_specific_boundaries=true, const TRI_ELEM_TYPE tri_elem_type=TRI_ELEM_TYPE::TRI3, const QUAD_ELEM_TYPE quad_elem_type=QUAD_ELEM_TYPE::QUAD4)
 Generates a mesh of a polygon slice, which is the foundation of both buildGeneralSlice and buildSimpleSlice.
 
void centerNodes (ReplicatedMesh &mesh, const Real virtual_side_number, const unsigned int div_num, const Real ring_radii_0, std::vector< std::vector< Node * > > &nodes) const
 Creates nodes of the very central mesh layer of the polygon for quad central elements.
 
void ringNodes (ReplicatedMesh &mesh, const std::vector< Real > ring_radii, const std::vector< unsigned int > ring_layers, const std::vector< std::vector< Real > > biased_terms, const unsigned int num_sectors_per_side, const Real corner_p[2][2], const Real corner_to_corner, const std::vector< Real > azimuthal_tangent=std::vector< Real >()) const
 Creates nodes for the ring-geometry region of a single slice.
 
void backgroundNodes (ReplicatedMesh &mesh, const unsigned int num_sectors_per_side, const unsigned int background_intervals, const std::vector< Real > biased_terms, const Real background_corner_distance, const Real background_corner_radial_interval_length, const Real corner_p[2][2], const Real corner_to_corner, const Real background_in, const std::vector< Real > azimuthal_tangent=std::vector< Real >()) const
 Creates nodes for the ring-to-polygon transition region (i.e., background) of a single slice.
 
void ductNodes (ReplicatedMesh &mesh, std::vector< Real > *const ducts_center_dist, const std::vector< unsigned int > ducts_layers, const std::vector< std::vector< Real > > biased_terms, const unsigned int num_sectors_per_side, const Real corner_p[2][2], const Real corner_to_corner, const std::vector< Real > azimuthal_tangent=std::vector< Real >()) const
 Creates nodes for the duct-geometry region of a single slice.
 
void cenQuadElemDef (ReplicatedMesh &mesh, const unsigned int div_num, const subdomain_id_type block_id_shift, const bool create_outward_interface_boundaries, const boundary_id_type boundary_id_shift, std::vector< std::vector< Node * > > &nodes, const bool assign_external_boundary=false, const unsigned int side_index=0, const bool generate_side_specific_boundaries=true, const QUAD_ELEM_TYPE quad_elem_type=QUAD_ELEM_TYPE::QUAD4) const
 Defines quad elements in the very central region of the polygon.
 
void cenTriElemDef (ReplicatedMesh &mesh, const unsigned int num_sectors_per_side, const std::vector< Real > azimuthal_tangent=std::vector< Real >(), const subdomain_id_type block_id_shift=0, const bool create_outward_interface_boundaries=true, const boundary_id_type boundary_id_shift=0, const bool assign_external_boundary=false, const unsigned int side_index=0, const bool generate_side_specific_boundaries=true, const TRI_ELEM_TYPE tri_elem_type=TRI_ELEM_TYPE::TRI3) const
 Defines triangular elements in the very central region of the polygon.
 
void quadElemDef (ReplicatedMesh &mesh, const unsigned int num_sectors_per_side, const std::vector< unsigned int > subdomain_rings, const unsigned int side_index, const std::vector< Real > azimuthal_tangent=std::vector< Real >(), const subdomain_id_type block_id_shift=0, const dof_id_type nodeid_shift=0, const bool create_inward_interface_boundaries=false, const bool create_outward_interface_boundaries=true, const boundary_id_type boundary_id_shift=0, const bool generate_side_specific_boundaries=true, const QUAD_ELEM_TYPE quad_elem_type=QUAD_ELEM_TYPE::QUAD4) const
 Defines general quad elements for the polygon.
 
std::unique_ptr< ReplicatedMesh > buildSimplePeripheral (const unsigned int num_sectors_per_side, const unsigned int peripheral_invervals, const std::vector< std::pair< Real, Real > > &position_inner, const std::vector< std::pair< Real, Real > > &d_position_outer, const subdomain_id_type id_shift, const QUAD_ELEM_TYPE quad_elem_type, const bool create_inward_interface_boundaries=false, const bool create_outward_interface_boundaries=true)
 Creates peripheral area mesh for the patterned hexagon mesh.
 
void adjustPeripheralQuadraticElements (MeshBase &out_mesh, const QUAD_ELEM_TYPE boundary_quad_elem_type) const
 Adjusts the mid-edge node locations in boundary regions when using quadratic elements with uniform boundary node spacing enabled.
 
std::pair< Real, Real > pointInterpolate (const Real pi_1_x, const Real pi_1_y, const Real po_1_x, const Real po_1_y, const Real pi_2_x, const Real pi_2_y, const Real po_2_x, const Real po_2_y, const unsigned int i, const unsigned int j, const unsigned int num_sectors_per_side, const unsigned int peripheral_intervals) const
 Calculates the point coordinates of within a parallelogram region using linear interpolation.
 
void nodeCoordRotate (Real &x, Real &y, const Real theta) const
 Calculates x and y coordinates after rotating by theta angle.
 
void cutOffPolyDeform (MeshBase &mesh, const Real orientation, const Real y_max_0, const Real y_max_n, const Real y_min, const unsigned int mesh_type, const Real unit_angle=60.0, const Real tols=1E-5) const
 Deforms peripheral region when the external side of a polygon assembly of stitched meshes cuts off the stitched meshes.
 
std::pair< Real, Real > fourPointIntercept (const std::pair< Real, Real > &p1, const std::pair< Real, Real > &p2, const std::pair< Real, Real > &p3, const std::pair< Real, Real > &p4) const
 Finds the center of a quadrilateral based on four vertices.
 
std::vector< Real > azimuthalAnglesCollector (ReplicatedMesh &mesh, std::vector< Point > &boundary_points, const Real lower_azi=-30.0, const Real upper_azi=30.0, const unsigned int return_type=ANGLE_TANGENT, const unsigned int num_sides=6, const boundary_id_type bid=OUTER_SIDESET_ID, const bool calculate_origin=true, const Real input_origin_x=0.0, const Real input_origin_y=0.0, const Real tol=1.0E-10) const
 Collects sorted azimuthal angles of the external boundary.
 
std::vector< Real > azimuthalAnglesCollector (ReplicatedMesh &mesh, const Real lower_azi=-30.0, const Real upper_azi=30.0, const unsigned int return_type=ANGLE_TANGENT, const unsigned int num_sides=6, const boundary_id_type bid=OUTER_SIDESET_ID, const bool calculate_origin=true, const Real input_origin_x=0.0, const Real input_origin_y=0.0, const Real tol=1.0E-10) const
 Collects sorted azimuthal angles of the external boundary.
 
std::vector< std::vector< Real > > biasTermsCalculator (const std::vector< Real > radial_biases, const std::vector< unsigned int > intervals, const multiBdryLayerParams inner_boundary_layer_params, const multiBdryLayerParams outer_boundary_layer_params) const
 Creates bias terms for multiple blocks.
 
std::vector< Real > biasTermsCalculator (const Real radial_bias, const unsigned int intervals, const singleBdryLayerParams inner_boundary_layer_params={0.0, 0.0, 0, 1.0}, const singleBdryLayerParams outer_boundary_layer_params={0.0, 0.0, 0, 1.0}) const
 Creates bias terms for a single block.
 
void setSectorExtraIDs (MeshBase &mesh, const std::string id_name, const unsigned int num_sides, const std::vector< unsigned int > num_sectors_per_side)
 assign sector extra ids to polygon mesh
 
void setRingExtraIDs (MeshBase &mesh, const std::string id_name, const unsigned int num_sides, const std::vector< unsigned int > num_sectors_per_side, const std::vector< unsigned int > ring_intervals, const bool ring_wise_id, const bool quad_center_elements)
 assign ring extra ids to polygon mesh
 
void reassignBoundaryIDs (MeshBase &mesh, const boundary_id_type id_shift, const std::set< boundary_id_type > &boundary_ids, const bool reverse=false)
 reassign interface boundary IDs on the input mesh by applying the boundary ID shift
 
std::set< boundary_id_type > getInterfaceBoundaryIDs (const std::vector< std::vector< unsigned int > > &pattern, const std::vector< std::vector< boundary_id_type > > &interface_boundary_id_shift_pattern, const std::set< boundary_id_type > &boundary_ids, const std::vector< std::set< boundary_id_type > > &input_interface_boundary_ids, const bool use_interface_boundary_id_shift, const bool create_interface_boundary_id, const unsigned int num_extra_layers) const
 returns a list of interface boundary IDs on the mesh generated by this mesh generator
 
multiBdryLayerParams modifiedMultiBdryLayerParamsCreator (const multiBdryLayerParams &original_multi_bdry_layer_params, const unsigned int order) const
 Modifies the input multi boundary layer parameters for node generation, especially for the quadratic elements.
 
singleBdryLayerParams modifiedSingleBdryLayerParamsCreator (const singleBdryLayerParams &original_single_bdry_layer_params, const unsigned int order) const
 Modifies the input single boundary layer parameters for node generation, especially for the quadratic elements.
 
std::string pitchMetaDataErrorGenerator (const std::vector< MeshGeneratorName > &input_names, const std::vector< Real > &metadata_vals, const std::string &metadata_name) const
 Generate a string that contains the detailed metadata information for inconsistent input mesh metadata error messages.
 
virtual void generateData ()
 
virtual std::unique_ptr< CSG::CSGBasegenerateCSG ()
 
TcopyMeshProperty (const std::string &target_data_name, const std::string &source_data_name, const std::string &source_mesh)
 
TcopyMeshProperty (const std::string &source_data_name, const std::string &source_mesh)
 
std::unique_ptr< MeshBase > & getMesh (const std::string &param_name, const bool allow_invalid=false)
 
std::vector< std::unique_ptr< MeshBase > * > getMeshes (const std::string &param_name)
 
std::unique_ptr< MeshBase > & getMeshByName (const MeshGeneratorName &mesh_generator_name)
 
std::vector< std::unique_ptr< MeshBase > * > getMeshesByName (const std::vector< MeshGeneratorName > &mesh_generator_names)
 
std::unique_ptr< CSG::CSGBase > & getCSGBase (const std::string &param_name)
 
std::unique_ptr< CSG::CSGBase > & getCSGBaseByName (const MeshGeneratorName &mesh_generator_name)
 
std::vector< std::unique_ptr< CSG::CSGBase > * > getCSGBases (const std::string &param_name)
 
std::vector< std::unique_ptr< CSG::CSGBase > * > getCSGBasesByName (const std::vector< MeshGeneratorName > &mesh_generator_names)
 
void declareMeshForSub (const std::string &param_name)
 
void declareMeshesForSub (const std::string &param_name)
 
void declareMeshForSubByName (const MeshGeneratorName &mesh_generator_name)
 
void declareMeshesForSubByName (const std::vector< MeshGeneratorName > &mesh_generator_names)
 
std::unique_ptr< MeshBase > buildMeshBaseObject (unsigned int dim=libMesh::invalid_uint)
 
std::unique_ptr< ReplicatedMesh > buildReplicatedMesh (unsigned int dim=libMesh::invalid_uint)
 
std::unique_ptr< DistributedMesh > buildDistributedMesh (unsigned int dim=libMesh::invalid_uint)
 
void addMeshSubgenerator (const std::string &type, const std::string &name, Ts... extra_input_parameters)
 
void addMeshSubgenerator (const std::string &type, const std::string &name, InputParameters params)
 
void declareNullMeshName (const MeshGeneratorName &name)
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
const TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
TdeclareMeshProperty (const std::string &data_name, Args &&... args)
 
TdeclareMeshProperty (const std::string &data_name, const T &data_value)
 
TdeclareMeshProperty (const std::string &data_name, Args &&... args)
 
TdeclareMeshProperty (const std::string &data_name, const T &data_value)
 
TsetMeshProperty (const std::string &data_name, Args &&... args)
 
TsetMeshProperty (const std::string &data_name, const T &data_value)
 
TsetMeshProperty (const std::string &data_name, Args &&... args)
 
TsetMeshProperty (const std::string &data_name, const T &data_value)
 

Static Protected Member Functions

static void addRingAndSectorIDParams (InputParameters &params)
 Add InputParameters which are used by ring and sector IDs.
 
static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

const std::vector< std::unique_ptr< MeshBase > * > _mesh_ptrs
 The input meshes.
 
const std::vector< MeshGeneratorName > & _input_names
 Names of input meshes.
 
const std::vector< std::vector< unsigned int > > & _pattern
 2D vector of the square pattern
 
const MooseEnum _pattern_boundary
 Type of the external boundary shape.
 
const bool _generate_core_metadata
 Whether a reactor core mesh with core metadata is generated.
 
const unsigned int _background_intervals
 Number of radial intervals in the background region.
 
const bool _has_assembly_duct
 Whether the square pattern has external duct(s)
 
std::vector< Real > _duct_sizes
 Size parameter(s) of duct(s)
 
const PolygonSizeStyle _duct_sizes_style
 Style of the duct size parameter(s)
 
const std::vector< unsigned int_duct_intervals
 Number(s) of radial intervals of duct layer(s)
 
const bool _uniform_mesh_on_sides
 Whether the nodes on the external boundary are uniformly distributed.
 
const bool _generate_control_drum_positions_file
 Whether a text file containing control drum positions is generated.
 
const bool _assign_control_drum_id
 Wheter control drum IDs are assigned as an extra element integer.
 
const Real _rotate_angle
 The mesh rotation angle after mesh generation.
 
const std::vector< subdomain_id_type > _duct_block_ids
 Subdomain IDs of the duct layers.
 
const std::vector< SubdomainName > _duct_block_names
 Subdomain Names of the duct layers.
 
const BoundaryName _stitching_boundary_name
 Name of the boundary used for stitching.
 
const boundary_id_type _external_boundary_id
 Boundary ID of mesh's external boundary.
 
const BoundaryName _external_boundary_name
 Boundary name of mesh's external boundary.
 
const bool _create_inward_interface_boundaries
 Whether inward interface boundaries are created.
 
const bool _create_outward_interface_boundaries
 Whether outward interface boundaries are created.
 
const bool _deform_non_circular_region
 Whether the non-circular region (outside the rings) can be deformed.
 
Real _pattern_pitch
 Pitch size of the input assembly mesh.
 
std::vector< subdomain_id_type > _peripheral_block_ids
 Subdomain IDs of the peripheral regions.
 
std::vector< SubdomainName > _peripheral_block_names
 Subdomain Names of the peripheral regions.
 
const bool _use_reporting_id
 Whether reporting ID is added to mesh.
 
std::vector< std::string > _reporting_id_names
 names of reporting ID
 
std::vector< ReportingIDGeneratorUtils::AssignType_assign_types
 reporting ID assignment type
 
const bool _use_exclude_id
 flag to indicate if exclude_id is defined
 
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 pattern cell.
 
const bool _use_interface_boundary_id_shift
 whether the interface boundary ids from input meshes are shifted, using a user-defined pattern of values for each pattern cell
 
std::vector< std::vector< boundary_id_type > > _interface_boundary_id_shift_pattern
 hold user-defined shift values for each pattern cell
 
QUAD_ELEM_TYPE _boundary_quad_elem_type
 Type of quadrilateral elements to be generated in the periphery region.
 
const bool _allow_unused_inputs
 Whether to allow additional assembly types to be passed to "inputs" parameter without being used in lattice.
 
const bool _verbose_stitching
 Whether the mesh stitching should be verbose.
 
MooseMesh *const _mesh
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
const Parallel::Communicator & _communicator
 

Private Member Functions

virtual std::string meshPropertyPrefix (const std::string &) const override final
 
void checkGetMesh (const MeshGeneratorName &mesh_generator_name, const std::string &param_name) const
 
const MeshGeneratorName * getMeshGeneratorNameFromParam (const std::string &param_name, const bool allow_invalid) const
 
const std::vector< MeshGeneratorName > & getMeshGeneratorNamesFromParam (const std::string &param_name) const
 
RestartableDataValuesetMeshPropertyHelper (const std::string &data_name)
 
const RestartableDataValuegetMeshPropertyInternal (const std::string &data_name, const std::string &prefix) const
 
void mooseErrorInternal (Args &&... args) const
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

std::set< MeshGeneratorName > _requested_mesh_generators
 
std::set< MeshGeneratorName > _requested_mesh_generators_for_sub
 
std::vector< std::pair< std::string, std::unique_ptr< MeshBase > * > > _requested_meshes
 
std::vector< std::pair< std::string, std::unique_ptr< CSG::CSGBase > * > > _requested_csg_bases
 
std::unique_ptr< MeshBase > _null_mesh
 
std::unique_ptr< CSG::CSGBase_null_csg_base
 
std::set< const MeshGenerator *, Comparator > _parent_mesh_generators
 
std::set< const MeshGenerator *, Comparator > _child_mesh_generators
 
std::set< const MeshGenerator *, Comparator > _sub_mesh_generators
 
std::set< std::string > _null_mesh_names
 
const std::string & _save_with_name
 
const bool _data_only
 
const ParallelParamObject_parent
 
const MooseBase_si_moose_base
 
const FEProblemBase_si_problem
 
MooseApp_meta_data_app
 
const MooseObject *const _meta_data_object
 

Detailed Description

This PatternedCartesianMeshGenerator source code assembles square meshes into a rectangular grid and optionally adds a duct around the grid.

Definition at line 22 of file PatternedCartesianMeshGenerator.h.

Member Enumeration Documentation

◆ INTRINSIC_NUM_SIDES

Enumerator
HEXAGON_NUM_SIDES 
SQUARE_NUM_SIDES 

Definition at line 75 of file PolygonMeshGeneratorBase.h.

◆ INTRINSIC_SIDESET_ID

enum PolygonMeshGeneratorBase::INTRINSIC_SIDESET_ID : boundary_id_type
inherited
Enumerator
OUTER_SIDESET_ID 
OUTER_SIDESET_ID_ALT 
SLICE_BEGIN 
SLICE_END 
SLICE_ALT 

Definition at line 66 of file PolygonMeshGeneratorBase.h.

◆ INTRISIC_SUBDOMAIN_ID

enum PolygonMeshGeneratorBase::INTRISIC_SUBDOMAIN_ID : subdomain_id_type
inherited
Enumerator
PERIPHERAL_ID_SHIFT 
TRANSITION_LAYER_DEFAULT 

Definition at line 60 of file PolygonMeshGeneratorBase.h.

◆ MESH_TYPE

Enumerator
CORNER_MESH 
BOUNDARY_MESH 
INNER_MESH 

Definition at line 47 of file PolygonMeshGeneratorBase.h.

◆ PolygonSizeStyle

enum class PolygonMeshGeneratorBase::PolygonSizeStyle
stronginherited

An enum class for style of input polygon size.

Enumerator
apothem 
radius 

Definition at line 41 of file PolygonMeshGeneratorBase.h.

◆ QUAD_ELEM_TYPE

enum class PolygonMeshGeneratorBase::QUAD_ELEM_TYPE
stronginherited

◆ RETURN_TYPE

Enumerator
ANGLE_DEGREE 
ANGLE_TANGENT 

Definition at line 54 of file PolygonMeshGeneratorBase.h.

◆ TRI_ELEM_TYPE

enum class PolygonMeshGeneratorBase::TRI_ELEM_TYPE
stronginherited

Constructor & Destructor Documentation

◆ PatternedCartesianMeshGenerator()

PatternedCartesianMeshGenerator::PatternedCartesianMeshGenerator ( const InputParameters parameters)

Definition at line 158 of file PatternedCartesianMeshGenerator.C.

160 _mesh_ptrs(getMeshes("inputs")),
161 _input_names(getParam<std::vector<MeshGeneratorName>>("inputs")),
162 _pattern(getParam<std::vector<std::vector<unsigned int>>>("pattern")),
163 _pattern_boundary(getParam<MooseEnum>("pattern_boundary")),
164 _generate_core_metadata(getParam<bool>("generate_core_metadata")),
165 _background_intervals(getParam<unsigned int>("background_intervals")),
166 _has_assembly_duct(isParamValid("duct_sizes")),
167 _duct_sizes(isParamValid("duct_sizes") ? getParam<std::vector<Real>>("duct_sizes")
168 : std::vector<Real>()),
169 _duct_sizes_style(getParam<MooseEnum>("duct_sizes_style").template getEnum<PolygonSizeStyle>()),
170 _duct_intervals(isParamValid("duct_intervals")
171 ? getParam<std::vector<unsigned int>>("duct_intervals")
172 : std::vector<unsigned int>()),
173 _uniform_mesh_on_sides(getParam<bool>("uniform_mesh_on_sides")),
174 _generate_control_drum_positions_file(getParam<bool>("generate_control_drum_positions_file")),
175 _assign_control_drum_id(getParam<bool>("assign_control_drum_id")),
176 _rotate_angle(getParam<Real>("rotate_angle")),
177 _duct_block_ids(isParamValid("duct_block_ids")
178 ? getParam<std::vector<subdomain_id_type>>("duct_block_ids")
179 : std::vector<subdomain_id_type>()),
180 _duct_block_names(getParam<std::vector<SubdomainName>>("duct_block_names")),
181 _stitching_boundary_name(getParam<BoundaryName>("stitching_boundary_name")),
182 _external_boundary_id(isParamValid("external_boundary_id")
183 ? getParam<boundary_id_type>("external_boundary_id")
184 : 0),
185 _external_boundary_name(getParam<BoundaryName>("external_boundary_name")),
186 _create_inward_interface_boundaries(getParam<bool>("create_inward_interface_boundaries")),
187 _create_outward_interface_boundaries(getParam<bool>("create_outward_interface_boundaries")),
188 _deform_non_circular_region(getParam<bool>("deform_non_circular_region")),
190 _use_exclude_id(isParamValid("exclude_id")),
191 _use_interface_boundary_id_shift(isParamValid("interface_boundary_id_shift_pattern")),
193 getParam<MooseEnum>("boundary_region_element_type").template getEnum<QUAD_ELEM_TYPE>()),
194 _allow_unused_inputs(getParam<bool>("allow_unused_inputs")),
195 _verbose_stitching(getParam<bool>("verbose_stitching"))
196{
197 declareMeshProperty("pattern_pitch_meta", 0.0);
198 declareMeshProperty("input_pitch_meta", 0.0);
199 declareMeshProperty<bool>("is_control_drum_meta", false);
200 declareMeshProperty<std::vector<Point>>("control_drum_positions", std::vector<Point>());
201 declareMeshProperty<std::vector<Real>>("control_drum_angles", std::vector<Real>());
202 declareMeshProperty<std::vector<std::vector<Real>>>("control_drums_azimuthal_meta",
203 std::vector<std::vector<Real>>());
204 declareMeshProperty<std::string>("position_file_name", getParam<std::string>("position_file"));
205 declareMeshProperty<bool>("square_peripheral_trimmability", !_generate_core_metadata);
206 declareMeshProperty<bool>("square_center_trimmability", true);
207 declareMeshProperty<bool>("peripheral_modifier_compatible", _pattern_boundary == "expanded");
208
209 const unsigned int n_pattern_layers = _pattern.size();
210 declareMeshProperty("pattern_size", n_pattern_layers);
211 if (n_pattern_layers == 1)
212 paramError("pattern", "The length (layer number) of this parameter must be larger than unity.");
213 // Examine pattern for consistency
214 std::vector<unsigned int> pattern_max_array;
215 std::vector<unsigned int> pattern_1d;
216 std::set<unsigned int> pattern_elem_size;
217 for (const auto & pattern_elem : _pattern)
218 {
219 if (pattern_elem.empty())
220 paramError("pattern",
221 "The element of the two-dimensional array parameter pattern must not be empty.");
222 pattern_elem_size.emplace(pattern_elem.size());
223 pattern_max_array.push_back(*std::max_element(pattern_elem.begin(), pattern_elem.end()));
224 pattern_1d.insert(pattern_1d.end(), pattern_elem.begin(), pattern_elem.end());
225 }
226 if (pattern_elem_size.size() > 1 || *pattern_elem_size.begin() != _pattern.size())
227 paramError("pattern",
228 "The two-dimensional array parameter pattern must have a correct square shape.");
229
230 if (*std::max_element(pattern_max_array.begin(), pattern_max_array.end()) >= _input_names.size())
232 "pattern",
233 "Elements of this parameter must be smaller than the length of inputs (0-indexing).");
234 if (std::set<unsigned int>(pattern_1d.begin(), pattern_1d.end()).size() < _input_names.size() &&
236 paramError("pattern",
237 "All the meshes provided in inputs must be used in the lattice pattern. To bypass "
238 "this requirement, set 'allow_unused_inputs = true'");
239
240 if (isParamValid("background_block_id"))
241 {
242 _peripheral_block_ids.push_back(getParam<subdomain_id_type>("background_block_id"));
245 }
246 else if (!_duct_block_ids.empty())
247 paramError("background_block_id",
248 "This parameter and duct_block_ids must be "
249 "provided simultaneously.");
250 if (isParamValid("background_block_name"))
251 {
252 _peripheral_block_names.push_back(getParam<SubdomainName>("background_block_name"));
255 }
256 else if (!_duct_block_names.empty())
257 paramError("background_block_name",
258 "This parameter and duct_block_names must be provided simultaneously.");
259
260 if (_pattern_boundary == "expanded")
261 {
262 for (unsigned int i = 1; i < _duct_sizes.size(); i++)
263 if (_duct_sizes[i] <= _duct_sizes[i - 1])
264 paramError("duct_sizes", "This parameter must be strictly ascending.");
265 if (!_peripheral_block_ids.empty() && _peripheral_block_ids.size() != _duct_sizes.size() + 1)
266 paramError("duct_block_ids",
267 "This parameter, if provided, must have a length equal to length of duct_sizes.");
268 if (!_peripheral_block_names.empty() &&
269 _peripheral_block_names.size() != _duct_sizes.size() + 1)
270 paramError("duct_block_names",
271 "This parameter, if provided, must have a length equal to length of duct_sizes.");
272 if (!isParamValid("square_size"))
273 paramError("square_size",
274 "This parameter must be provided when pattern_boundary is expanded.");
275 }
276 else
277 {
278 if (!_peripheral_block_ids.empty() || !_peripheral_block_names.empty())
279 paramError("background_block_id",
280 "This parameter and background_block_name must not be set when the "
281 "pattern_boundary is none.");
282 if (isParamValid("square_size"))
283 paramError("square_size",
284 "This parameter must not be provided when pattern_boundary is none.");
285 }
286
288 {
289 // check "interface_boundary_id_shift_pattern" parameter
291 getParam<std::vector<std::vector<boundary_id_type>>>("interface_boundary_id_shift_pattern");
293 {
294 std::string shape_pattern =
295 "(" + std::to_string(_pattern.size()) + ", " + std::to_string(_pattern[0].size()) + ") ";
296 paramError("interface_boundary_id_shift_pattern",
297 "This parameter, if provided, should have the same two-dimensional array shape " +
298 shape_pattern +
299 "as "
300 "the 'pattern' parameter. First dimension '" +
301 std::to_string(_interface_boundary_id_shift_pattern.size()) +
302 "' does not match.");
303 }
304 for (const auto i : make_range(_pattern.size()))
305 if (_interface_boundary_id_shift_pattern[i].size() != _pattern[i].size())
306 {
307 std::string shape_pattern = "(" + std::to_string(_pattern.size()) + ", " +
308 std::to_string(_pattern[0].size()) + ") ";
310 "interface_boundary_id_shift_pattern",
311 "This parameter, if provided, should have the same two-dimensional array shape " +
312 shape_pattern +
313 "as "
314 "the 'pattern' parameter. Second dimension '" +
315 std::to_string(_interface_boundary_id_shift_pattern[i].size()) +
316 "' does not match.");
317 }
318 }
319 // declare metadata for internal interface boundaries
320 declareMeshProperty<bool>("interface_boundaries", false);
321 declareMeshProperty<std::set<boundary_id_type>>("interface_boundary_ids", {});
322
324 {
325 // get reporting id name input
326 _reporting_id_names = getParam<std::vector<std::string>>("id_name");
327 const unsigned int num_reporting_ids = _reporting_id_names.size();
328 // get reporting id assign type input
329 const auto input_assign_types = getParam<std::vector<MooseEnum>>("assign_type");
330 if (input_assign_types.size() != num_reporting_ids)
331 paramError("assign_type", "This parameter must have a length equal to length of id_name.");
332 // list of reporting id names using manual id patterns;
333 std::vector<std::string> manual_ids;
334 for (const auto i : make_range(num_reporting_ids))
335 {
336 _assign_types.push_back(
337 input_assign_types[i].getEnum<ReportingIDGeneratorUtils::AssignType>());
339 manual_ids.push_back(_reporting_id_names[i]);
340 }
341 // processing "id_pattern" input parameter
342 if (manual_ids.size() > 0 && !isParamValid("id_pattern"))
343 paramError("id_pattern", "required when 'manual' is defined in \"assign_type\"");
344 if (isParamValid("id_pattern"))
345 {
346 const auto input_id_patterns =
347 getParam<std::vector<std::vector<std::vector<dof_id_type>>>>("id_pattern");
348 if (input_id_patterns.size() != manual_ids.size())
349 paramError("id_pattern",
350 "The number of patterns must be equal to the number of 'manual' types defined "
351 "in \"assign_type\".");
352 for (unsigned int i = 0; i < manual_ids.size(); ++i)
353 _id_patterns[manual_ids[i]] = input_id_patterns[i];
354 }
355 // processing exlude id
356 _exclude_ids.resize(_input_names.size());
357 // in case of using 'exclude_id', create a vector containg flag for each input tile to indicate
358 // whether it is excluded from reporting id assignment
359 if (_use_exclude_id)
360 {
361 std::vector<MeshGeneratorName> exclude_id_name =
362 getParam<std::vector<MeshGeneratorName>>("exclude_id");
363 for (unsigned int i = 0; i < _input_names.size(); ++i)
364 {
365 _exclude_ids[i] = false;
366 for (auto input_name : exclude_id_name)
367 if (_input_names[i] == input_name)
368 {
369 _exclude_ids[i] = true;
370 break;
371 }
372 }
373 }
374 else
375 for (unsigned int i = 0; i < _input_names.size(); ++i)
376 _exclude_ids[i] = false;
377 }
378}
void ErrorVector unsigned int
std::vector< std::unique_ptr< MeshBase > * > getMeshes(const std::string &param_name)
T & declareMeshProperty(const std::string &data_name, Args &&... args)
const InputParameters & parameters() const
void paramError(const std::string &param, Args... args) const
const T & getParam(const std::string &name) const
bool isParamValid(const std::string &name) const
const bool _verbose_stitching
Whether the mesh stitching should be verbose.
const unsigned int _background_intervals
Number of radial intervals in the background region.
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's external boundary.
const std::vector< std::unique_ptr< MeshBase > * > _mesh_ptrs
The input meshes.
std::vector< std::vector< boundary_id_type > > _interface_boundary_id_shift_pattern
hold user-defined shift values for each pattern cell
const bool _use_reporting_id
Whether reporting ID is added to mesh.
const bool _create_inward_interface_boundaries
Whether inward interface boundaries are created.
std::vector< std::string > _reporting_id_names
names of reporting ID
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 square pattern
const bool _uniform_mesh_on_sides
Whether the nodes on the external boundary are uniformly distributed.
std::vector< ReportingIDGeneratorUtils::AssignType > _assign_types
reporting ID assignment type
QUAD_ELEM_TYPE _boundary_quad_elem_type
Type of quadrilateral elements to be generated in the periphery region.
const bool _use_exclude_id
flag to indicate if exclude_id is defined
const bool _has_assembly_duct
Whether the square pattern has external duct(s)
const bool _create_outward_interface_boundaries
Whether outward interface boundaries are created.
std::vector< bool > _exclude_ids
vector indicating which ids in the pattern to exclude (true at pattern positions to exclude)
const BoundaryName _stitching_boundary_name
Name of the boundary used for stitching.
const BoundaryName _external_boundary_name
Boundary name of mesh's external boundary.
const PolygonSizeStyle _duct_sizes_style
Style of the duct size parameter(s)
const bool _allow_unused_inputs
Whether to allow additional assembly types to be passed to "inputs" parameter without being used in l...
const std::vector< unsigned int > _duct_intervals
Number(s) of radial intervals of duct layer(s)
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 std::vector< SubdomainName > _duct_block_names
Subdomain Names of the duct layers.
const MooseEnum _pattern_boundary
Type of the external boundary shape.
const std::vector< MeshGeneratorName > & _input_names
Names of input meshes.
std::vector< Real > _duct_sizes
Size parameter(s) of duct(s)
const bool _generate_core_metadata
Whether a reactor core mesh with core metadata is generated.
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::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 Real _rotate_angle
The mesh rotation angle after mesh generation.
std::vector< subdomain_id_type > _peripheral_block_ids
Subdomain IDs of the peripheral regions.
A base class that contains common members for Reactor module mesh generators.
PolygonSizeStyle
An enum class for style of input polygon size.
@ manual
assign IDs based on user-defined mapping
int8_t boundary_id_type
if(subdm)
TestClass subdomain_id_type
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)

Member Function Documentation

◆ addPeripheralMesh()

void PatternedCartesianMeshGenerator::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 
)
protected

Adds background and duct region mesh to each part outer part of stitched square meshes.

Note that the function works for single unit square mesh (corner or edge) separately before stitching.

Parameters
meshinput mesh to add the peripheral region onto
patternindex of the input mesh for patterning
pitchpitch size of the input mesh
extra_distextra distances from inner boundary to define background and ducts layer locations that are needed to create the peripheral region
num_sectors_per_side_arraynumbers of azimuthal intervals of all input unit meshes
peripheral_duct_intervalsnumbers of radial intervals of the duct regions
rotation_angleangle that the generated mesh will be rotated by
mesh_typewhether the peripheral region is for a corner or a side of a patterned mesh
Returns
a mesh of the cartesian pattern mesh with peripheral region added.

Definition at line 1032 of file PatternedCartesianMeshGenerator.C.

1041{
1042 std::vector<std::pair<Real, Real>> positions_inner;
1043 std::vector<std::pair<Real, Real>> d_positions_outer;
1044
1045 std::vector<std::vector<unsigned int>> peripheral_point_index;
1046 std::vector<std::pair<Real, Real>> sub_positions_inner;
1047 std::vector<std::pair<Real, Real>> sub_d_positions_outer;
1048
1049 const auto stitching_boundary_id = MooseMeshUtils::getBoundaryID(_stitching_boundary_name, mesh);
1050
1051 if (mesh_type == CORNER_MESH)
1052 // corner mesh has two sides that need peripheral meshes.
1053 // each element has three sub-elements, representing beginning, middle, and ending azimuthal
1054 // points
1055 peripheral_point_index = {{0, 1, 2}, {2, 3, 4}};
1056 else
1057 // side mesh has one side that needs a peripheral mesh.
1058 peripheral_point_index = {{0, 1, 5}};
1059
1060 // extra_dist includes background and ducts.
1061 // Loop to calculate the positions of the boundaries.
1062 for (unsigned int i = 0; i < extra_dist.size(); i++)
1063 {
1064 // Generate the node positions for the peripheral meshes
1065 // The node positions are generated for the two possible cases: the edge and the corner
1067 positions_inner, d_positions_outer, i == 0 ? 0.0 : extra_dist[i - 1], extra_dist[i], pitch);
1068
1069 // Loop for all applicable sides that need peripheral mesh (2 for corner and 1 for edge)
1070 for (unsigned int peripheral_index = 0; peripheral_index < peripheral_point_index.size();
1071 peripheral_index++)
1072 {
1073 // Loop for beginning, middle and ending positions of a side
1074 for (unsigned int vector_index = 0; vector_index < 3; vector_index++)
1075 {
1076 sub_positions_inner.push_back(
1077 positions_inner[peripheral_point_index[peripheral_index][vector_index]]);
1078 sub_d_positions_outer.push_back(
1079 d_positions_outer[peripheral_point_index[peripheral_index][vector_index]]);
1080 }
1081 auto meshp0 = buildSimplePeripheral(num_sectors_per_side_array[pattern],
1082 peripheral_duct_intervals[i],
1083 sub_positions_inner,
1084 sub_d_positions_outer,
1085 i,
1088 (i != extra_dist.size() - 1) &&
1090
1091 // The other_mesh must be prepared before stitching
1092 meshp0->prepare_for_use();
1093
1094 // rotate the peripheral mesh to the desired side of the hexagon.
1095 MeshTools::Modification::rotate(*meshp0, rotation_angle, 0, 0);
1096 mesh.stitch_meshes(
1097 *meshp0, stitching_boundary_id, OUTER_SIDESET_ID, TOLERANCE, true, _verbose_stitching);
1098 sub_positions_inner.resize(0);
1099 sub_d_positions_outer.resize(0);
1100 }
1101 }
1102}
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.
std::unique_ptr< ReplicatedMesh > buildSimplePeripheral(const unsigned int num_sectors_per_side, const unsigned int peripheral_invervals, const std::vector< std::pair< Real, Real > > &position_inner, const std::vector< std::pair< Real, Real > > &d_position_outer, const subdomain_id_type id_shift, const QUAD_ELEM_TYPE quad_elem_type, const bool create_inward_interface_boundaries=false, const bool create_outward_interface_boundaries=true)
Creates peripheral area mesh for the patterned hexagon mesh.
MeshBase & mesh
BoundaryID getBoundaryID(const BoundaryName &boundary_name, const MeshBase &mesh)

Referenced by generate().

◆ addReportingIDs()

void PatternedCartesianMeshGenerator::addReportingIDs ( MeshBase &  mesh,
const std::vector< std::unique_ptr< ReplicatedMesh > > &  from_meshes 
) const
protected

Adds the reporting IDs onto the input mesh.

Parameters
meshinput mesh to add the reporting IDs onto
from_meshesmeshes to take reporting IDs from

Definition at line 1158 of file PatternedCartesianMeshGenerator.C.

1160{
1161 const unsigned int num_reporting_ids = _reporting_id_names.size();
1162 for (unsigned int i = 0; i < num_reporting_ids; ++i)
1163 {
1164 const std::string element_id_name = _reporting_id_names[i];
1165 unsigned int extra_id_index;
1166 if (!mesh.has_elem_integer(element_id_name))
1167 extra_id_index = mesh.add_elem_integer(element_id_name);
1168 else
1169 {
1170 extra_id_index = mesh.get_elem_integer_index(element_id_name);
1172 "id_name", "An element integer with the name '", element_id_name, "' already exists");
1173 }
1174
1175 // assign reporting IDs to individual elements
1176 // NOTE: background block id should be set "PERIPHERAL_ID_SHIFT" because this function is called
1177 // before assigning the user-defined background block id
1178 std::set<subdomain_id_type> background_block_ids =
1179 (isParamValid("background_block_id")) ? std::set<subdomain_id_type>({PERIPHERAL_ID_SHIFT})
1180 : std::set<subdomain_id_type>();
1181
1182 const bool using_manual_id =
1185 extra_id_index,
1186 _assign_types[i],
1189 _pattern_boundary == "expanded",
1190 background_block_ids,
1191 from_meshes,
1192 _pattern,
1193 (using_manual_id)
1194 ? _id_patterns.at(element_id_name)
1195 : std::vector<std::vector<dof_id_type>>());
1196 }
1197}
void paramWarning(const std::string &param, Args... args) const
void assignReportingIDs(MeshBase &mesh, const unsigned int extra_id_index, const ReportingIDGeneratorUtils::AssignType assign_type, const bool use_exclude_id, const std::vector< bool > &exclude_ids, const bool has_assembly_boundary, const std::set< subdomain_id_type > background_block_ids, const std::vector< std::unique_ptr< libMesh::ReplicatedMesh > > &input_meshes, const std::vector< std::vector< unsigned int > > &pattern, const std::vector< std::vector< dof_id_type > > &id_pattern)
assign the reporting IDs to the output mesh from the cartesian or hexagonal patterned mesh generator
uint8_t dof_id_type

Referenced by generate().

◆ addRingAndSectorIDParams()

void PolygonMeshGeneratorBase::addRingAndSectorIDParams ( InputParameters params)
staticprotectedinherited

Add InputParameters which are used by ring and sector IDs.

Parameters
paramsInputParameters to be modified with the added params

Definition at line 1596 of file PolygonMeshGeneratorBase.C.

1597{
1598 params.addParam<std::string>("sector_id_name",
1599 "Name of integer (reporting) ID for sector regions to use the "
1600 "reporting ID for azimuthal sector regions of ring geometry block.");
1601 params.addParam<std::string>("ring_id_name",
1602 "Name of integer (reporting) ID for ring regions to use the "
1603 "reporting ID for annular regions of ring geometry block.");
1604 MooseEnum ring_id_option("block_wise ring_wise", "block_wise");
1605 params.addParam<MooseEnum>(
1606 "ring_id_assign_type", ring_id_option, "Type of ring ID assignment: block_wise or ring_wise");
1607 params.addParamNamesToGroup("sector_id_name ring_id_name ring_id_assign_type", "Ring/Sector IDs");
1608}
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)

Referenced by PolygonConcentricCircleMeshGeneratorBase::validParams(), and TriPinHexAssemblyGenerator::validParams().

◆ adjustPeripheralQuadraticElements()

void PolygonMeshGeneratorBase::adjustPeripheralQuadraticElements ( MeshBase &  out_mesh,
const QUAD_ELEM_TYPE  boundary_quad_elem_type 
) const
protectedinherited

Adjusts the mid-edge node locations in boundary regions when using quadratic elements with uniform boundary node spacing enabled.

Parameters
out_meshmesh to be adjusted.
boundary_quad_elem_typeboundary quad element type.

Definition at line 1251 of file PolygonMeshGeneratorBase.C.

1253{
1254 const auto side_list = out_mesh.get_boundary_info().build_side_list();
1255
1256 // select out elements on outer boundary
1257 // std::set used to filter duplicate elem_ids
1258 std::set<dof_id_type> elem_set;
1259 for (auto side_item : side_list)
1260 {
1261 boundary_id_type boundary_id = std::get<2>(side_item);
1262 dof_id_type elem_id = std::get<0>(side_item);
1263
1264 if (boundary_id == OUTER_SIDESET_ID)
1265 elem_set.insert(elem_id);
1266 }
1267
1268 // adjust nodes for outer boundary elements
1269 for (const auto elem_id : elem_set)
1270 {
1271 Elem * elem = out_mesh.elem_ptr(elem_id);
1272
1273 // adjust right side mid-edge node
1274 Point pt_5 = (elem->point(1) + elem->point(2)) / 2.0;
1275 out_mesh.add_point(pt_5, elem->node_ptr(5)->id());
1276
1277 // adjust left side mid-edge node
1278 Point pt_7 = (elem->point(0) + elem->point(3)) / 2.0;
1279 out_mesh.add_point(pt_7, elem->node_ptr(7)->id());
1280
1281 // adjust central node when using QUAD9
1282 if (boundary_quad_elem_type == QUAD_ELEM_TYPE::QUAD9)
1283 {
1284 Point pt_8 = elem->true_centroid();
1285 out_mesh.add_point(pt_8, elem->node_ptr(8)->id());
1286 }
1287 }
1288}

Referenced by generate(), and PatternedHexMeshGenerator::generate().

◆ azimuthalAnglesCollector() [1/2]

std::vector< Real > PolygonMeshGeneratorBase::azimuthalAnglesCollector ( ReplicatedMesh &  mesh,
const Real  lower_azi = -30.0,
const Real  upper_azi = 30.0,
const unsigned int  return_type = ANGLE_TANGENT,
const unsigned int  num_sides = 6,
const boundary_id_type  bid = OUTER_SIDESET_ID,
const bool  calculate_origin = true,
const Real  input_origin_x = 0.0,
const Real  input_origin_y = 0.0,
const Real  tol = 1.0E-10 
) const
protectedinherited

Collects sorted azimuthal angles of the external boundary.

Parameters
meshinput mesh whose boundary node azimuthal angles need to be collected
lower_azilower boundary of the azimuthal angles to be collected
upper_aziupper boundary of the azimuthal angles to be collected
return_typewhether angle values or tangent values are returned
num_sidesnumber of sides of the input mesh (only used if return type is ANGLE_TANGENT)
bidid of the boundary of which the nodes' azimuthal angles are collected
calculate_originwhether the mesh origin is calculated based on the centroid position
input_origin_xprecalculated mesh origin coordinate x
input_origin_yprecalculated mesh origin coordinate y
toltolerence that the minimum azimuthal angle is
Returns
the list of azimuthal angles of all the nodes on the external grain boundary within the given range

Definition at line 1495 of file PolygonMeshGeneratorBase.C.

1505{
1506 std::vector<Point> boundary_points;
1507 return azimuthalAnglesCollector(mesh,
1508 boundary_points,
1509 lower_azi,
1510 upper_azi,
1511 return_type,
1512 num_sides,
1513 bid,
1514 calculate_origin,
1515 input_origin_x,
1516 input_origin_y,
1517 tol);
1518}
const double tol
std::vector< Real > azimuthalAnglesCollector(ReplicatedMesh &mesh, std::vector< Point > &boundary_points, const Real lower_azi=-30.0, const Real upper_azi=30.0, const unsigned int return_type=ANGLE_TANGENT, const unsigned int num_sides=6, const boundary_id_type bid=OUTER_SIDESET_ID, const bool calculate_origin=true, const Real input_origin_x=0.0, const Real input_origin_y=0.0, const Real tol=1.0E-10) const
Collects sorted azimuthal angles of the external boundary.

◆ azimuthalAnglesCollector() [2/2]

std::vector< Real > PolygonMeshGeneratorBase::azimuthalAnglesCollector ( ReplicatedMesh &  mesh,
std::vector< Point > &  boundary_points,
const Real  lower_azi = -30.0,
const Real  upper_azi = 30.0,
const unsigned int  return_type = ANGLE_TANGENT,
const unsigned int  num_sides = 6,
const boundary_id_type  bid = OUTER_SIDESET_ID,
const bool  calculate_origin = true,
const Real  input_origin_x = 0.0,
const Real  input_origin_y = 0.0,
const Real  tol = 1.0E-10 
) const
protectedinherited

Collects sorted azimuthal angles of the external boundary.

Parameters
meshinput mesh whose boundary node azimuthal angles need to be collected
boundary_pointsreference vector to contain the Points corresponding to the collected azimuthal angles
lower_azilower boundary of the azimuthal angles to be collected
upper_aziupper boundary of the azimuthal angles to be collected
return_typewhether angle values or tangent values are returned
num_sidesnumber of sides of the input mesh (only used if return type is ANGLE_TANGENT)
bidid of the boundary of which the nodes' azimuthal angles are collected
calculate_originwhether the mesh origin is calculated based on the centroid position
input_origin_xprecalculated mesh origin coordinate x
input_origin_yprecalculated mesh origin coordinate y
toltolerance that the minimum azimuthal angle is
Returns
the list of azimuthal angles of all the nodes on the external grain boundary within the given range

Definition at line 1417 of file PolygonMeshGeneratorBase.C.

1428{
1429 std::vector<std::tuple<dof_id_type, unsigned short int, boundary_id_type>> side_list =
1430 mesh.get_boundary_info().build_side_list();
1431 mesh.get_boundary_info().build_node_list_from_side_list();
1432 std::vector<std::tuple<dof_id_type, boundary_id_type>> node_list =
1433 mesh.get_boundary_info().build_node_list();
1434
1435 std::vector<Real> bd_x_list;
1436 std::vector<Real> bd_y_list;
1437 std::vector<Point> bd_p_list;
1438 Real origin_x = 0.0;
1439 Real origin_y = 0.0;
1440 Real tmp_azi;
1441 const Real mid_azi = lower_azi <= upper_azi ? (lower_azi + upper_azi) / 2.0
1442 : (lower_azi + upper_azi + 360.0) / 2.0;
1443 for (unsigned int i = 0; i < node_list.size(); ++i)
1444 if (std::get<1>(node_list[i]) == bid)
1445 {
1446 bd_x_list.push_back((mesh.node_ref(std::get<0>(node_list[i])))(0));
1447 bd_y_list.push_back((mesh.node_ref(std::get<0>(node_list[i])))(1));
1448 bd_p_list.push_back((mesh.node_ref(std::get<0>(node_list[i]))));
1449 }
1450
1451 if (calculate_origin)
1452 {
1453 const Point origin_pt = MooseMeshUtils::meshCentroidCalculator(mesh);
1454 origin_x = origin_pt(0);
1455 origin_y = origin_pt(1);
1456 }
1457 else
1458 {
1459 origin_x = input_origin_x;
1460 origin_y = input_origin_y;
1461 }
1462
1463 std::vector<std::pair<Real, Point>> azi_point_pairs;
1464
1465 for (unsigned int i = 0; i < bd_x_list.size(); ++i)
1466 {
1467 tmp_azi = atan2(bd_y_list[i] - origin_y, bd_x_list[i] - origin_x) * 180.0 / M_PI;
1468 if ((lower_azi <= upper_azi && (tmp_azi >= lower_azi - tol && tmp_azi <= upper_azi + tol)) ||
1469 (lower_azi > upper_azi && (tmp_azi >= lower_azi - tol || tmp_azi <= upper_azi + tol)))
1470 {
1471 azi_point_pairs.push_back(
1472 std::make_pair(return_type == ANGLE_DEGREE
1473 ? (tmp_azi - mid_azi)
1474 : (1.0 + std::cos(M_PI / num_sides) / std::sin(M_PI / num_sides) *
1475 std::tan((tmp_azi - mid_azi) / 180.0 * M_PI)),
1476 bd_p_list[i]));
1477 }
1478 }
1479 std::sort(azi_point_pairs.begin(), azi_point_pairs.end());
1480
1481 std::vector<Real> azimuthal_output;
1482 for (auto it = std::make_move_iterator(azi_point_pairs.begin()),
1483 end = std::make_move_iterator(azi_point_pairs.end());
1484 it != end;
1485 it++)
1486 {
1487 azimuthal_output.push_back(std::move(it->first));
1488 boundary_points.push_back(std::move(it->second));
1489 }
1490
1491 return azimuthal_output;
1492}
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sin(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tan
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template cos(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(cos
Point meshCentroidCalculator(const MeshBase &mesh)

Referenced by PolygonMeshGeneratorBase::azimuthalAnglesCollector(), AzimuthalBlockSplitGenerator::generate(), PatternedPolygonPeripheralModifierBase::generate(), and PolygonConcentricCircleMeshGeneratorBase::generate().

◆ backgroundNodes()

void PolygonMeshGeneratorBase::backgroundNodes ( ReplicatedMesh &  mesh,
const unsigned int  num_sectors_per_side,
const unsigned int  background_intervals,
const std::vector< Real >  biased_terms,
const Real  background_corner_distance,
const Real  background_corner_radial_interval_length,
const Real  corner_p[2][2],
const Real  corner_to_corner,
const Real  background_in,
const std::vector< Real >  azimuthal_tangent = std::vector<Real>() 
) const
protectedinherited

Creates nodes for the ring-to-polygon transition region (i.e., background) of a single slice.

Parameters
meshinput mesh to add the nodes onto
num_sectors_per_sidenumber of azimuthal intervals
background_intervalsnumber of radial intervals of the background region
biased_termsnormalized spacing values used for radial meshing biasing in background region
background_corner_distancecenter to duct (innermost duct) corner distance
background_corner_radial_interval_lengthradial interval distance
corner_p[2][2]array contains the coordinates of the corner positions
corner_to_cornerdiameter of the circumscribed circle of the polygon
background_inradius of the inner boundary of the background region
azimuthal_tangentvector of tangent values of the azimuthal angles as reference for adaptive boundary matching
Returns
a mesh with background region nodes created

Definition at line 718 of file PolygonMeshGeneratorBase.C.

728{
729 unsigned int angle_number =
730 azimuthal_tangent.size() == 0 ? num_sectors_per_side : (azimuthal_tangent.size() - 1);
731 for (unsigned int k = 0; k < (background_intervals); k++)
732 {
733 const Real background_corner_p_x =
734 background_corner_distance / (0.5 * corner_to_corner) * corner_p[0][0] *
735 (background_in +
736 biased_terms[k] * background_intervals * background_corner_radial_interval_length) /
737 background_corner_distance;
738 const Real background_corner_p_y =
739 background_corner_distance / (0.5 * corner_to_corner) * corner_p[0][1] *
740 (background_in +
741 biased_terms[k] * background_intervals * background_corner_radial_interval_length) /
742 background_corner_distance;
743
744 // background_corner_p(s) are the points in the background region, on the bins towards the six
745 // corners, at different intervals
746 mesh.add_point(Point(background_corner_p_x, background_corner_p_y, 0.0));
747
748 for (unsigned int j = 1; j <= angle_number; j++)
749 {
750 const Real cell_boundary_p_x =
751 background_corner_distance / (0.5 * corner_to_corner) *
752 (corner_p[0][0] + (corner_p[1][0] - corner_p[0][0]) *
753 (azimuthal_tangent.size() == 0 ? ((Real)j / (Real)angle_number)
754 : (azimuthal_tangent[j] / 2.0)));
755 const Real cell_boundary_p_y =
756 background_corner_distance / (0.5 * corner_to_corner) *
757 (corner_p[0][1] + (corner_p[1][1] - corner_p[0][1]) *
758 (azimuthal_tangent.size() == 0 ? ((Real)j / (Real)angle_number)
759 : (azimuthal_tangent[j] / 2.0)));
760 // cell_boundary_p(s) are the points on the cell's six boundaries (flat sides) at different
761 // azimuthal angles
762 const Real pin_boundary_p_x =
763 cell_boundary_p_x * background_in /
764 std::sqrt(Utility::pow<2>(cell_boundary_p_x) + Utility::pow<2>(cell_boundary_p_y));
765 const Real pin_boundary_p_y =
766 cell_boundary_p_y * background_in /
767 std::sqrt(Utility::pow<2>(cell_boundary_p_x) + Utility::pow<2>(cell_boundary_p_y));
768 // pin_boundary_p(s) are the points on pin boundary (outside ring) at different azimuthal
769 // angles
770 const Real background_radial_interval =
771 std::sqrt(Utility::pow<2>(cell_boundary_p_x - pin_boundary_p_x) +
772 Utility::pow<2>(cell_boundary_p_y - pin_boundary_p_y)) /
773 background_intervals;
774 const Real background_azimuthal_p_x =
775 cell_boundary_p_x *
776 (background_in + biased_terms[k] * background_intervals * background_radial_interval) /
777 std::sqrt(Utility::pow<2>(cell_boundary_p_x) + Utility::pow<2>(cell_boundary_p_y));
778 const Real background_azimuthal_p_y =
779 cell_boundary_p_y *
780 (background_in + biased_terms[k] * background_intervals * background_radial_interval) /
781 std::sqrt(Utility::pow<2>(cell_boundary_p_x) + Utility::pow<2>(cell_boundary_p_y));
782 // background_azimuthal_p are the points on the bins towards different azimuthal angles, at
783 // different intervals; excluding the ones produced by background_corner_p
784 mesh.add_point(Point(background_azimuthal_p_x, background_azimuthal_p_y, 0.0));
785 }
786 }
787}

Referenced by PolygonMeshGeneratorBase::buildSlice().

◆ biasTermsCalculator() [1/2]

std::vector< Real > PolygonMeshGeneratorBase::biasTermsCalculator ( const Real  radial_bias,
const unsigned int  intervals,
const singleBdryLayerParams  inner_boundary_layer_params = {0.0, 0.0, 0, 1.0},
const singleBdryLayerParams  outer_boundary_layer_params = {0.0, 0.0, 0, 1.0} 
) const
protectedinherited

Creates bias terms for a single block.

Parameters
radial_biasbias growth factor of the elements within the main region of the block
intervalsradial interval number of the main region of the block
inner_boundary_layer_paramswidth, radial fraction, radial sector, and growth factor of the inner boundary layer
outer_boundary_layer_paramswidth, radial fraction, radial sector, and growth factor of the outer boundary layer
Returns
bias terms describing the cumulative radial fractions of the nodes within a single block

Definition at line 1543 of file PolygonMeshGeneratorBase.C.

1548{
1549 // To get biased indices:
1550 // If no bias is involved, namely bias factor = 1.0, the increment in indices is uniform.
1551 // Thus, (i + 1) is used to get such linearly increasing indices.
1552 // If a non-trivial bias factor q is used, the increment in the indices is geometric
1553 // progression. So, if first (i = 0) increment is 1.0, second (i = 1) is q, third (i = 2) is
1554 // q^2,..., last or n_interval'th is q^(n_interval - 1). Then, the summation of the first (i +
1555 // 1) increments over the summation of all n_interval increments is the (i + 1)th index The
1556 // summation of the first (i + 1) increments is (1.0 - q^(i + 1)) / (1 - q); The summation of
1557 // all n_interval increments is (1.0 - q^n_interval) / (1 - q); Thus, the index is (1.0 - q^(i +
1558 // 1)) / (1.0 - q^n_interval)
1559 // This approach is used by inner boundary layer, main region, outer boundary layer separately.
1560
1561 std::vector<Real> biased_terms;
1562 for (unsigned int i = 0; i < inner_boundary_layer_params.intervals; i++)
1563 biased_terms.push_back(
1564 MooseUtils::absoluteFuzzyEqual(inner_boundary_layer_params.bias, 1.0)
1565 ? ((Real)(i + 1) * inner_boundary_layer_params.fraction /
1566 (Real)inner_boundary_layer_params.intervals)
1567 : ((1.0 - std::pow(inner_boundary_layer_params.bias, (Real)(i + 1))) /
1568 (1.0 - std::pow(inner_boundary_layer_params.bias,
1569 (Real)(inner_boundary_layer_params.intervals))) *
1570 inner_boundary_layer_params.fraction));
1571 for (unsigned int i = 0; i < intervals; i++)
1572 biased_terms.push_back(inner_boundary_layer_params.fraction +
1573 (MooseUtils::absoluteFuzzyEqual(radial_bias, 1.0)
1574 ? ((Real)(i + 1) *
1575 (1.0 - inner_boundary_layer_params.fraction -
1576 outer_boundary_layer_params.fraction) /
1577 (Real)intervals)
1578 : ((1.0 - std::pow(radial_bias, (Real)(i + 1))) /
1579 (1.0 - std::pow(radial_bias, (Real)(intervals))) *
1580 (1.0 - inner_boundary_layer_params.fraction -
1581 outer_boundary_layer_params.fraction))));
1582 for (unsigned int i = 0; i < outer_boundary_layer_params.intervals; i++)
1583 biased_terms.push_back(
1584 1.0 - outer_boundary_layer_params.fraction +
1585 (MooseUtils::absoluteFuzzyEqual(outer_boundary_layer_params.bias, 1.0)
1586 ? ((Real)(i + 1) * outer_boundary_layer_params.fraction /
1587 (Real)outer_boundary_layer_params.intervals)
1588 : ((1.0 - std::pow(outer_boundary_layer_params.bias, (Real)(i + 1))) /
1589 (1.0 - std::pow(outer_boundary_layer_params.bias,
1590 (Real)(outer_boundary_layer_params.intervals))) *
1591 outer_boundary_layer_params.fraction)));
1592 return biased_terms;
1593}
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ biasTermsCalculator() [2/2]

std::vector< std::vector< Real > > PolygonMeshGeneratorBase::biasTermsCalculator ( const std::vector< Real >  radial_biases,
const std::vector< unsigned int intervals,
const multiBdryLayerParams  inner_boundary_layer_params,
const multiBdryLayerParams  outer_boundary_layer_params 
) const
protectedinherited

Creates bias terms for multiple blocks.

Parameters
radial_biasesbias growth factors of the elements within the main regions of the blocks
intervalsradial interval numbers of the main regions of the blocks
inner_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the inner boundary layers
outer_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the outer boundary layers
Returns
bias list of terms describing the cumulative radial fractions of the nodes within multiple blocks

Definition at line 1521 of file PolygonMeshGeneratorBase.C.

1526{
1527 std::vector<std::vector<Real>> bias_terms_vec;
1528 for (unsigned int i = 0; i < radial_biases.size(); i++)
1529 bias_terms_vec.push_back(biasTermsCalculator(radial_biases[i],
1530 intervals[i],
1531 {0.0,
1532 inner_boundary_layer_params.fractions[i],
1533 inner_boundary_layer_params.intervals[i],
1534 inner_boundary_layer_params.biases[i]},
1535 {0.0,
1536 outer_boundary_layer_params.fractions[i],
1537 outer_boundary_layer_params.intervals[i],
1538 outer_boundary_layer_params.biases[i]}));
1539 return bias_terms_vec;
1540}
std::vector< std::vector< Real > > biasTermsCalculator(const std::vector< Real > radial_biases, const std::vector< unsigned int > intervals, const multiBdryLayerParams inner_boundary_layer_params, const multiBdryLayerParams outer_boundary_layer_params) const
Creates bias terms for multiple blocks.

Referenced by PolygonMeshGeneratorBase::biasTermsCalculator(), PolygonMeshGeneratorBase::buildSlice(), and PeripheralRingMeshGenerator::generate().

◆ buildGeneralSlice()

std::unique_ptr< ReplicatedMesh > PolygonMeshGeneratorBase::buildGeneralSlice ( std::vector< Real >  ring_radii,
const std::vector< unsigned int ring_layers,
const std::vector< Real >  ring_radial_biases,
const multiBdryLayerParams ring_inner_boundary_layer_params,
const multiBdryLayerParams ring_outer_boundary_layer_params,
std::vector< Real >  ducts_center_dist,
const std::vector< unsigned int ducts_layers,
const std::vector< Real >  duct_radial_biases,
const multiBdryLayerParams duct_inner_boundary_layer_params,
const multiBdryLayerParams duct_outer_boundary_layer_params,
const Real  primary_side_length,
const Real  secondary_side_length,
const unsigned int  num_sectors_per_side,
const unsigned int  background_intervals,
const Real  background_radial_bias,
const singleBdryLayerParams background_inner_boundary_layer_params,
const singleBdryLayerParams background_outer_boundary_layer_params,
dof_id_type &  node_id_background_meta,
const Real  azimuthal_angle,
const std::vector< Real >  azimuthal_tangent,
const unsigned int  side_index,
const bool  quad_center_elements,
const Real  center_quad_factor,
const Real  rotation_angle,
const bool  generate_side_specific_boundaries = true 
)
protectedinherited

Creates a mesh of a general polygon slice with a triangular shape and circular regions on one of its vertex.

Parameters
ring_radiiradii of the ring regions
ring_layersnumbers of radial intervals of the ring regions
ring_radial_biasesvalues used for radial meshing biasing in ring regions
ring_inner_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the inner boundary layer of the ring regions
ring_outer_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the outer boundary layer of the ring regions
ducts_center_distdistance parameters of the duct regions
ducts_layersnumbers of radial intervals of the duct regions
duct_radial_biasesvalues used for radial meshing biasing in duct regions
duct_inner_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the inner boundary layer of the duct regions
duct_outer_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the outer boundary layer of the duct regions
primary_side_lengthlength of the first side (i.e., the side that is parallel to y-axis when rotation_angle is zero) that involves the ring center vertex
secondary_side_lengthlength of the second side (obtained by clockwise rotating the fist side by azimuthal_angle) that involves the ring center vertex
num_sectors_per_sidenumber of azimuthal intervals
background_intervalsnumber of radial intervals of the background region
background_radial_biasvalue used for radial meshing biasing in background region
background_inner_boundary_layer_paramswidth, radial sectors, and growth factor of the inner boundary layer of the background region
background_outer_boundary_layer_paramswidth, radial sectors, and growth factor of the outer boundary layer of the background region
node_id_background_metapointer to the first node's id of the background region
azimuthal_anglethe angle defined by the primary and secondary sides
azimuthal_tangentvector of tangent values of the azimuthal angles as reference for adaptive boundary matching
side_indexindex of the polygon side
quad_center_elementswhether the central region contains quad elements or not
center_quad_factorA fractional radius factor used to determine the radial positions of transition nodes in the center region meshed by quad elements (default is 1.0 - 1.0/div_num)
rotation_angleazimuthal angle of the primary side
generate_side_specific_boundarieswhether the side-specific external boundaries are generated or not
Returns
a mesh of a general slice

Definition at line 40 of file PolygonMeshGeneratorBase.C.

66{
67 const Real virtual_pitch = 2.0 * primary_side_length * cos(azimuthal_angle / 360.0 * M_PI);
68 const Real virtual_side_number = 360.0 / azimuthal_angle;
69 const Real pitch_scale_factor = secondary_side_length / primary_side_length;
70
71 auto mesh = buildSlice(ring_radii,
72 ring_layers,
73 ring_radial_biases,
74 ring_inner_boundary_layer_params,
75 ring_outer_boundary_layer_params,
76 ducts_center_dist,
77 ducts_layers,
78 duct_radial_biases,
79 duct_inner_boundary_layer_params,
80 duct_outer_boundary_layer_params,
81 virtual_pitch,
82 num_sectors_per_side,
83 background_intervals,
84 background_radial_bias,
85 background_inner_boundary_layer_params,
86 background_outer_boundary_layer_params,
87 node_id_background_meta,
88 virtual_side_number,
89 side_index,
90 azimuthal_tangent,
91 0,
92 quad_center_elements,
93 center_quad_factor,
94 false,
95 true,
96 0,
97 pitch_scale_factor,
98 generate_side_specific_boundaries);
99 MeshTools::Modification::rotate(*mesh, rotation_angle, 0, 0);
100 return mesh;
101}
std::unique_ptr< ReplicatedMesh > buildSlice(std::vector< Real > ring_radii, const std::vector< unsigned int > ring_layers, const std::vector< Real > ring_radial_biases, const multiBdryLayerParams &ring_inner_boundary_layer_params, const multiBdryLayerParams &ring_outer_boundary_layer_params, std::vector< Real > ducts_center_dist, const std::vector< unsigned int > ducts_layers, const std::vector< Real > duct_radial_biases, const multiBdryLayerParams &duct_inner_boundary_layer_params, const multiBdryLayerParams &duct_outer_boundary_layer_params, const Real pitch, const unsigned int num_sectors_per_side, const unsigned int background_intervals, const Real background_radial_bias, const singleBdryLayerParams &background_inner_boundary_layer_params, const singleBdryLayerParams &background_outer_boundary_layer_params, dof_id_type &node_id_background_meta, const Real virtual_side_number, const unsigned int side_index, const std::vector< Real > azimuthal_tangent=std::vector< Real >(), const subdomain_id_type block_id_shift=0, const bool quad_center_elements=false, const Real center_quad_factor=0.0, const bool create_inward_interface_boundaries=false, const bool create_outward_interface_boundaries=true, const boundary_id_type boundary_id_shift=0, const Real pitch_scale_factor=1.0, const bool generate_side_specific_boundaries=true, const TRI_ELEM_TYPE tri_elem_type=TRI_ELEM_TYPE::TRI3, const QUAD_ELEM_TYPE quad_elem_type=QUAD_ELEM_TYPE::QUAD4)
Generates a mesh of a polygon slice, which is the foundation of both buildGeneralSlice and buildSimpl...

Referenced by TriPinHexAssemblyGenerator::buildSinglePinSection().

◆ buildSimplePeripheral()

std::unique_ptr< ReplicatedMesh > PolygonMeshGeneratorBase::buildSimplePeripheral ( const unsigned int  num_sectors_per_side,
const unsigned int  peripheral_invervals,
const std::vector< std::pair< Real, Real > > &  position_inner,
const std::vector< std::pair< Real, Real > > &  d_position_outer,
const subdomain_id_type  id_shift,
const QUAD_ELEM_TYPE  quad_elem_type,
const bool  create_inward_interface_boundaries = false,
const bool  create_outward_interface_boundaries = true 
)
protectedinherited

Creates peripheral area mesh for the patterned hexagon mesh.

Note that the function create the peripheral area for each side of the unit hexagon mesh before stitching. An edge unit hexagon has two sides that need peripheral areas, whereas a corner unit hexagon has three such sides. The positions of the inner and outer boundary nodes are pre-calculated as positions_inner and d_positions_outer; This function performs interpolation to generate the mesh grid.

Parameters
meshinput mesh to create the peripheral area mesh onto
num_sectors_per_sidenumber of azimuthal intervals
peripheral_invervalsnumber of radial intervals of the peripheral region
position_innerkey positions of the inner side of the peripheral region
d_position_outerkey inremental positions of the outer side of the peripheral region
id_shiftshift of subdomain id of the peripheral region
create_inward_interface_boundarieswhether inward interface boundary sidesets are created
create_outward_interface_boundarieswhether outward interface boundary sidesets are created
quad_elem_typetype of quad element to be created
Returns
a mesh with the peripheral region added to a hexagon input mesh

Definition at line 1151 of file PolygonMeshGeneratorBase.C.

1160{
1161 auto mesh = buildReplicatedMesh(2);
1162 std::pair<Real, Real> positions_p;
1163
1164 // generate node positions
1165 for (unsigned int i = 0; i <= peripheral_invervals; i++)
1166 {
1167 for (unsigned int j = 0; j <= num_sectors_per_side / 2; j++)
1168 {
1169 positions_p = pointInterpolate(positions_inner[0].first,
1170 positions_inner[0].second,
1171 d_positions_outer[0].first,
1172 d_positions_outer[0].second,
1173 positions_inner[1].first,
1174 positions_inner[1].second,
1175 d_positions_outer[1].first,
1176 d_positions_outer[1].second,
1177 i,
1178 j,
1179 num_sectors_per_side,
1180 peripheral_invervals);
1181 mesh->add_point(Point(positions_p.first, positions_p.second, 0.0));
1182 }
1183 for (unsigned int j = 1; j <= num_sectors_per_side / 2; j++)
1184 {
1185 positions_p = pointInterpolate(positions_inner[1].first,
1186 positions_inner[1].second,
1187 d_positions_outer[1].first,
1188 d_positions_outer[1].second,
1189 positions_inner[2].first,
1190 positions_inner[2].second,
1191 d_positions_outer[2].first,
1192 d_positions_outer[2].second,
1193 i,
1194 j,
1195 num_sectors_per_side,
1196 peripheral_invervals);
1197 mesh->add_point(Point(positions_p.first, positions_p.second, 0.0));
1198 }
1199 }
1200
1201 // element definition
1202 BoundaryInfo & boundary_info = mesh->get_boundary_info();
1203
1204 for (unsigned int i = 0; i < peripheral_invervals; i++)
1205 {
1206 for (unsigned int j = 0; j < num_sectors_per_side; j++)
1207 {
1208 std::unique_ptr<Elem> new_elem;
1209
1210 new_elem = std::make_unique<Quad4>();
1211 new_elem->set_node(0, mesh->node_ptr(j + (num_sectors_per_side + 1) * (i)));
1212 new_elem->set_node(1, mesh->node_ptr(j + 1 + (num_sectors_per_side + 1) * (i)));
1213 new_elem->set_node(2, mesh->node_ptr(j + 1 + (num_sectors_per_side + 1) * (i + 1)));
1214 new_elem->set_node(3, mesh->node_ptr(j + (num_sectors_per_side + 1) * (i + 1)));
1215
1216 Elem * elem = mesh->add_elem(std::move(new_elem));
1217
1218 // add subdoamin and boundary IDs
1219 elem->subdomain_id() = PERIPHERAL_ID_SHIFT + id_shift;
1220 if (i == 0)
1221 {
1222 boundary_info.add_side(elem, 0, OUTER_SIDESET_ID);
1223 if (create_inward_interface_boundaries)
1224 boundary_info.add_side(elem, 0, SLICE_ALT + id_shift * 2);
1225 }
1226 if (i == peripheral_invervals - 1)
1227 {
1228 boundary_info.add_side(elem, 2, OUTER_SIDESET_ID);
1229 if (create_outward_interface_boundaries)
1230 boundary_info.add_side(elem, 2, SLICE_ALT + id_shift * 2 + 1);
1231 }
1232 if (j == 0)
1233 boundary_info.add_side(elem, 3, OUTER_SIDESET_ID);
1234 if (j == num_sectors_per_side - 1)
1235 boundary_info.add_side(elem, 1, OUTER_SIDESET_ID);
1236 }
1237 }
1238
1239 // convert element to second order if needed
1240 if (quad_elem_type != QUAD_ELEM_TYPE::QUAD4)
1241 {
1242 // full_ordered 2nd order element --> QUAD9, otherwise QUAD8
1243 const bool full_ordered = (quad_elem_type == QUAD_ELEM_TYPE::QUAD9);
1244 mesh->all_second_order(full_ordered);
1245 }
1246
1247 return mesh;
1248}
std::unique_ptr< ReplicatedMesh > buildReplicatedMesh(unsigned int dim=libMesh::invalid_uint)
std::pair< Real, Real > pointInterpolate(const Real pi_1_x, const Real pi_1_y, const Real po_1_x, const Real po_1_y, const Real pi_2_x, const Real pi_2_y, const Real po_2_x, const Real po_2_y, const unsigned int i, const unsigned int j, const unsigned int num_sectors_per_side, const unsigned int peripheral_intervals) const
Calculates the point coordinates of within a parallelogram region using linear interpolation.

Referenced by addPeripheralMesh(), and PatternedHexMeshGenerator::addPeripheralMesh().

◆ buildSimpleSlice()

std::unique_ptr< ReplicatedMesh > PolygonMeshGeneratorBase::buildSimpleSlice ( std::vector< Real >  ring_radii,
const std::vector< unsigned int ring_layers,
const std::vector< Real >  ring_radial_biases,
const multiBdryLayerParams ring_inner_boundary_layer_params,
const multiBdryLayerParams ring_outer_boundary_layer_params,
std::vector< Real >  ducts_center_dist,
const std::vector< unsigned int ducts_layers,
const std::vector< Real >  duct_radial_biases,
const multiBdryLayerParams duct_inner_boundary_layer_params,
const multiBdryLayerParams duct_outer_boundary_layer_params,
const Real  pitch,
const unsigned int  num_sectors_per_side,
const unsigned int  background_intervals,
const Real  background_radial_bias,
const singleBdryLayerParams background_inner_boundary_layer_params,
const singleBdryLayerParams background_outer_boundary_layer_params,
dof_id_type &  node_id_background_meta,
const unsigned int  side_number,
const unsigned int  side_index,
const std::vector< Real >  azimuthal_tangent = std::vector<Real>(),
const subdomain_id_type  block_id_shift = 0,
const bool  quad_center_elements = false,
const Real  center_quad_factor = 0.0,
const bool  create_inward_interface_boundaries = false,
const bool  create_outward_interface_boundaries = true,
const boundary_id_type  boundary_id_shift = 0,
const bool  generate_side_specific_boundaries = true,
const TRI_ELEM_TYPE  tri_elem_type = TRI_ELEM_TYPE::TRI3,
const QUAD_ELEM_TYPE  quad_elem_type = QUAD_ELEM_TYPE::QUAD4 
)
protectedinherited

Creates a mesh of a slice that corresponds to a single side of the polygon to be generated.

Parameters
ring_radiiradii of the ring regions
ring_layersnumbers of radial intervals of the ring regions
ring_radial_biasesvalues used for radial meshing biasing in ring regions
ring_inner_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the inner boundary layer of the ring regions
ring_outer_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the outer boundary layer of the ring regions
ducts_center_distdistance parameters of the duct regions
ducts_layersnumbers of radial intervals of the duct regions
duct_radial_biasesvalues used for radial meshing biasing in duct regions
duct_inner_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the inner boundary layer of the duct regions
duct_outer_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the outer boundary layer of the duct regions
pitchtwice the distance from the ring center vertex to the side defined by the other vertices
num_sectors_per_sidenumber of azimuthal intervals
background_intervalsnumber of radial intervals of the background region
background_radial_biasvalue used for radial meshing biasing in background region
background_inner_boundary_layer_paramswidth, radial sectors, and growth factor of the inner boundary layer of the background region
background_outer_boundary_layer_paramswidth, radial sectors, and growth factor of the outer boundary layer of the background region
node_id_background_metapointer to the first node's id of the background region
side_numbernumber of sides of the polygon
side_indexindex of the polygon side
azimuthal_tangentvector of tangent values of the azimuthal angles as reference for adaptive boundary matching
block_id_shiftshift of the subdomain ids generated by this function
quad_center_elementswhether the central region contrains quad elements or not
center_quad_factorA fractional radius factor used to determine the radial positions of transition nodes in the center region meshed by quad elements (default is 1.0 - 1.0/div_num)
create_inward_interface_boundarieswhether inward interface boundary sidesets are created
create_outward_interface_boundarieswhether outward interface boundary sidesets are created
boundary_id_shiftshift of the interface boundary ids
generate_side_specific_boundarieswhether the side-specific external boundaries are generated or not
tri_elem_typetype of the triangular elements to be generated
quad_elem_typetype of the quadrilateral elements to be generated
Returns
a mesh of a polygon slice

Definition at line 104 of file PolygonMeshGeneratorBase.C.

134{
135 return buildSlice(ring_radii,
136 ring_layers,
137 ring_radial_biases,
138 ring_inner_boundary_layer_params,
139 ring_outer_boundary_layer_params,
140 ducts_center_dist,
141 ducts_layers,
142 duct_radial_biases,
143 duct_inner_boundary_layer_params,
144 duct_outer_boundary_layer_params,
145 pitch,
146 num_sectors_per_side,
147 background_intervals,
148 background_radial_bias,
149 background_inner_boundary_layer_params,
150 background_outer_boundary_layer_params,
151 node_id_background_meta,
152 side_number,
153 side_index,
154 azimuthal_tangent,
155 block_id_shift,
156 quad_center_elements,
157 center_quad_factor,
158 create_inward_interface_boundaries,
159 create_outward_interface_boundaries,
160 boundary_id_shift,
161 1.0,
162 generate_side_specific_boundaries,
163 tri_elem_type,
164 quad_elem_type);
165}

Referenced by PolygonConcentricCircleMeshGeneratorBase::generate().

◆ buildSlice()

std::unique_ptr< ReplicatedMesh > PolygonMeshGeneratorBase::buildSlice ( std::vector< Real >  ring_radii,
const std::vector< unsigned int ring_layers,
const std::vector< Real >  ring_radial_biases,
const multiBdryLayerParams ring_inner_boundary_layer_params,
const multiBdryLayerParams ring_outer_boundary_layer_params,
std::vector< Real >  ducts_center_dist,
const std::vector< unsigned int ducts_layers,
const std::vector< Real >  duct_radial_biases,
const multiBdryLayerParams duct_inner_boundary_layer_params,
const multiBdryLayerParams duct_outer_boundary_layer_params,
const Real  pitch,
const unsigned int  num_sectors_per_side,
const unsigned int  background_intervals,
const Real  background_radial_bias,
const singleBdryLayerParams background_inner_boundary_layer_params,
const singleBdryLayerParams background_outer_boundary_layer_params,
dof_id_type &  node_id_background_meta,
const Real  virtual_side_number,
const unsigned int  side_index,
const std::vector< Real >  azimuthal_tangent = std::vector<Real>(),
const subdomain_id_type  block_id_shift = 0,
const bool  quad_center_elements = false,
const Real  center_quad_factor = 0.0,
const bool  create_inward_interface_boundaries = false,
const bool  create_outward_interface_boundaries = true,
const boundary_id_type  boundary_id_shift = 0,
const Real  pitch_scale_factor = 1.0,
const bool  generate_side_specific_boundaries = true,
const TRI_ELEM_TYPE  tri_elem_type = TRI_ELEM_TYPE::TRI3,
const QUAD_ELEM_TYPE  quad_elem_type = QUAD_ELEM_TYPE::QUAD4 
)
protectedinherited

Generates a mesh of a polygon slice, which is the foundation of both buildGeneralSlice and buildSimpleSlice.

Parameters
ring_radiiradii of the ring regions
ring_layersnumbers of radial intervals of the ring regions
ring_radial_biasesvalues used for radial meshing biasing in ring regions
ring_inner_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the inner boundary layer of the ring regions
ring_outer_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the outer boundary layer of the ring regions
ducts_center_distdistance parameters of the duct regions
ducts_layersnumbers of radial intervals of the duct regions
duct_radial_biasesvalues used for radial meshing biasing in duct regions
duct_inner_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the inner boundary layer of the duct regions
duct_outer_boundary_layer_paramswidths, radial fractions, radial sectors, and growth factors of the outer boundary layer of the duct regions
pitchtwice of the length of the first side times cosine of the azimuthal angle
num_sectors_per_sidenumber of azimuthal intervals
background_intervalsnumber of radial intervals of the background region
background_radial_biasvalue used for radial meshing biasing in background region
background_inner_boundary_layer_paramswidth, radial sectors, and growth factor of the inner boundary layer of the background region
background_outer_boundary_layer_paramswidth, radial sectors, and growth factor of the outer boundary layer of the background region
node_id_background_metapointer to the first node's id of the background region
virtual_side_number360.0 over the azimuthal angle of the slice (happens to be number of sides of the polygon if a regular polygon is to be generated)
side_indexindex of the polygon side
azimuthal_tangentvector of tangent values of the azimuthal angles as reference for adaptive boundary matching
block_id_shiftshift of the subdomain ids generated by this function
quad_center_elementswhether the central region contrains quad elements or not
center_quad_factorA fractional radius factor used to determine the radial positions of transition nodes in the center region meshed by quad elements (default is 1.0 - 1.0/div_num)
create_inward_interface_boundarieswhether inward interface boundary sidesets are created
create_outward_interface_boundarieswhether outward interface boundary sidesets are created
boundary_id_shiftshift of the interface boundary ids
pitch_scale_factorthe ratio between the secondary side length to the primary side length.
generate_side_specific_boundarieswhether the side-specific external boundaries are generated or not
tri_elem_typetype of the triangular elements to be generated
quad_elem_typetype of the quadrilateral elements to be generated
Returns
a mesh of a slice

Definition at line 168 of file PolygonMeshGeneratorBase.C.

199{
200 const unsigned short order = quad_elem_type == QUAD_ELEM_TYPE::QUAD4 ? 1 : 2;
201 if (order != (tri_elem_type == TRI_ELEM_TYPE::TRI3 ? 1 : 2))
202 mooseError("In mesh generator ",
203 this->name(),
204 ", an incompatible elements type combination is used when calling "
205 "PolygonMeshGeneratorBase::buildSlice().");
206 // In order to create quadratic elements (i.e., order = 2), we creates nodes with double mesh
207 // density. Thus, the related parameters need to be modified accordingly. A prefix "mod_" is used
208 // to indicate the modified parameters.
209
210 // For ring_layers, modification is to double the number of layers for order = 2
211 std::vector<unsigned int> mod_ring_layers(ring_layers);
212 std::for_each(
213 mod_ring_layers.begin(), mod_ring_layers.end(), [&order](unsigned int & n) { n *= order; });
214 // For ring_radial_biases, modification is to take the square root of the original biases for
215 // order = 2
216 std::vector<Real> mod_ring_radial_biases(ring_radial_biases);
217 std::for_each(mod_ring_radial_biases.begin(),
218 mod_ring_radial_biases.end(),
219 [&order](Real & n) { n = std::pow(n, 1.0 / order); });
220 // ducts_layers is similar to ring_layers
221 std::vector<unsigned int> mod_ducts_layers(ducts_layers);
222 std::for_each(
223 mod_ducts_layers.begin(), mod_ducts_layers.end(), [&order](unsigned int & n) { n *= order; });
224 // duct_radial_biases is similar to ring_radial_biases
225 std::vector<Real> mod_duct_radial_biases(duct_radial_biases);
226 std::for_each(mod_duct_radial_biases.begin(),
227 mod_duct_radial_biases.end(),
228 [&order](Real & n) { n = std::pow(n, 1.0 / order); });
229 // Azimuthal mesh density is also doubled for order = 2
230 const unsigned int mod_num_sectors_per_side = num_sectors_per_side * order;
231 const unsigned int mod_background_intervals = background_intervals * order;
232 // background_radial_bias is similar to ring_radial_biases
233 const Real mod_background_radial_bias = std::pow(background_radial_bias, 1.0 / order);
234 // Perform similar modifications for boundary layer parameters
235 const auto mod_ring_inner_boundary_layer_params =
236 modifiedMultiBdryLayerParamsCreator(ring_inner_boundary_layer_params, order);
237 const auto mod_ring_outer_boundary_layer_params =
238 modifiedMultiBdryLayerParamsCreator(ring_outer_boundary_layer_params, order);
239 const auto mod_duct_inner_boundary_layer_params =
240 modifiedMultiBdryLayerParamsCreator(duct_inner_boundary_layer_params, order);
241 const auto mod_duct_outer_boundary_layer_params =
242 modifiedMultiBdryLayerParamsCreator(duct_outer_boundary_layer_params, order);
243
244 const auto mod_background_inner_boundary_layer_params =
245 modifiedSingleBdryLayerParamsCreator(background_inner_boundary_layer_params, order);
246 const auto mod_background_outer_boundary_layer_params =
247 modifiedSingleBdryLayerParamsCreator(background_outer_boundary_layer_params, order);
248
249 // The distance parameters of the rings and duct need to be modified too as they may be involved
250 // in the boundary layer cases.
251 std::vector<Real> mod_ducts_center_dist(ducts_center_dist);
252 std::vector<Real> mod_ring_radii(ring_radii);
253 bool has_rings(ring_radii.size());
254 bool has_ducts(ducts_center_dist.size());
255 bool has_background(background_intervals);
256 auto mesh = buildReplicatedMesh(2);
257
258 // Calculate biasing terms
259 // background region needs to be split into three parts
260 const auto main_background_bias_terms =
261 biasTermsCalculator(background_radial_bias, background_intervals);
262 const auto inner_background_bias_terms =
263 biasTermsCalculator(background_inner_boundary_layer_params.bias,
264 background_inner_boundary_layer_params.intervals);
265 const auto outer_background_bias_terms =
266 biasTermsCalculator(background_outer_boundary_layer_params.bias,
267 background_outer_boundary_layer_params.intervals);
268 auto rings_bias_terms = biasTermsCalculator(ring_radial_biases,
269 ring_layers,
270 ring_inner_boundary_layer_params,
271 ring_outer_boundary_layer_params);
272 auto duct_bias_terms = biasTermsCalculator(duct_radial_biases,
273 ducts_layers,
274 duct_inner_boundary_layer_params,
275 duct_outer_boundary_layer_params);
276 // Equivalent "mod_" parts
277 const auto mod_main_background_bias_terms =
278 biasTermsCalculator(mod_background_radial_bias, mod_background_intervals);
279 const auto mod_inner_background_bias_terms =
280 biasTermsCalculator(mod_background_inner_boundary_layer_params.bias,
281 mod_background_inner_boundary_layer_params.intervals);
282 const auto mod_outer_background_bias_terms =
283 biasTermsCalculator(mod_background_outer_boundary_layer_params.bias,
284 mod_background_outer_boundary_layer_params.intervals);
285 auto mod_rings_bias_terms = biasTermsCalculator(mod_ring_radial_biases,
286 mod_ring_layers,
287 mod_ring_inner_boundary_layer_params,
288 mod_ring_outer_boundary_layer_params);
289 auto mod_duct_bias_terms = biasTermsCalculator(mod_duct_radial_biases,
290 mod_ducts_layers,
291 mod_duct_inner_boundary_layer_params,
292 mod_duct_outer_boundary_layer_params);
293
294 std::vector<unsigned int> total_ring_layers;
295 for (unsigned int i = 0; i < ring_layers.size(); i++)
296 total_ring_layers.push_back(ring_layers[i] + ring_inner_boundary_layer_params.intervals[i] +
297 ring_outer_boundary_layer_params.intervals[i]);
298
299 if (background_inner_boundary_layer_params.intervals)
300 {
301 total_ring_layers.push_back(background_inner_boundary_layer_params.intervals);
302 rings_bias_terms.push_back(inner_background_bias_terms);
303 ring_radii.push_back((ring_radii.empty() ? 0.0 : ring_radii.back()) +
304 background_inner_boundary_layer_params.width);
305 has_rings = true;
306 }
307 std::vector<unsigned int> mod_total_ring_layers;
308 for (unsigned int i = 0; i < mod_ring_layers.size(); i++)
309 mod_total_ring_layers.push_back(mod_ring_layers[i] +
310 mod_ring_inner_boundary_layer_params.intervals[i] +
311 mod_ring_outer_boundary_layer_params.intervals[i]);
312
313 if (mod_background_inner_boundary_layer_params.intervals)
314 {
315 mod_total_ring_layers.push_back(mod_background_inner_boundary_layer_params.intervals);
316 mod_rings_bias_terms.push_back(mod_inner_background_bias_terms);
317 mod_ring_radii.push_back((mod_ring_radii.empty() ? 0.0 : mod_ring_radii.back()) +
318 mod_background_inner_boundary_layer_params.width);
319 // has_rings should be modified before in the none "mod_" part
320 }
321
322 std::vector<unsigned int> total_ducts_layers;
323 if (background_outer_boundary_layer_params.intervals)
324 {
325 total_ducts_layers.push_back(background_outer_boundary_layer_params.intervals);
326 duct_bias_terms.insert(duct_bias_terms.begin(), outer_background_bias_terms);
327 ducts_center_dist.insert(ducts_center_dist.begin(),
328 (ducts_center_dist.empty()
329 ? pitch / 2.0 / std::cos(M_PI / virtual_side_number)
330 : ducts_center_dist.front()) -
331 background_outer_boundary_layer_params.width);
332 has_ducts = true;
333 }
334 for (unsigned int i = 0; i < ducts_layers.size(); i++)
335 total_ducts_layers.push_back(ducts_layers[i] + duct_inner_boundary_layer_params.intervals[i] +
336 duct_outer_boundary_layer_params.intervals[i]);
337
338 std::vector<unsigned int> mod_total_ducts_layers;
339 if (mod_background_outer_boundary_layer_params.intervals)
340 {
341 mod_total_ducts_layers.push_back(mod_background_outer_boundary_layer_params.intervals);
342 mod_duct_bias_terms.insert(mod_duct_bias_terms.begin(), mod_outer_background_bias_terms);
343 mod_ducts_center_dist.insert(mod_ducts_center_dist.begin(),
344 (mod_ducts_center_dist.empty()
345 ? pitch / 2.0 / std::cos(M_PI / virtual_side_number)
346 : mod_ducts_center_dist.front()) -
347 mod_background_outer_boundary_layer_params.width);
348 // has_ducts should be modified before in the none "mod_" part
349 }
350 for (unsigned int i = 0; i < mod_ducts_layers.size(); i++)
351 mod_total_ducts_layers.push_back(mod_ducts_layers[i] +
352 mod_duct_inner_boundary_layer_params.intervals[i] +
353 mod_duct_outer_boundary_layer_params.intervals[i]);
354
355 unsigned int angle_number = azimuthal_tangent.size() == 0
356 ? num_sectors_per_side
357 : ((azimuthal_tangent.size() - 1) / order);
358 unsigned int mod_angle_number =
359 azimuthal_tangent.size() == 0 ? mod_num_sectors_per_side : (azimuthal_tangent.size() - 1);
360
361 // Geometries
362 const Real corner_to_corner =
363 pitch / std::cos(M_PI / virtual_side_number); // distance of bin center to cell corner
364 const Real corner_p[2][2] = {
365 {0.0, 0.5 * corner_to_corner},
366 {0.5 * corner_to_corner * pitch_scale_factor * std::sin(2.0 * M_PI / virtual_side_number),
367 0.5 * corner_to_corner * pitch_scale_factor * std::cos(2.0 * M_PI / virtual_side_number)}};
368 const unsigned int div_num = angle_number / 2 + 1;
369 const unsigned int mod_div_num = mod_angle_number / 2 + 1;
370
371 // From now on, we work on the nodes, which need the "mod_" parameters
372 std::vector<std::vector<Node *>> nodes(mod_div_num, std::vector<Node *>(mod_div_num));
373 if (quad_center_elements)
374 {
375 Real ring_radii_0;
376
377 if (has_rings)
378 ring_radii_0 = ring_radii.front() * mod_rings_bias_terms.front()[order - 1];
379 else if (has_ducts)
380 ring_radii_0 = mod_ducts_center_dist.front() * std::cos(M_PI / virtual_side_number) *
381 mod_main_background_bias_terms[order - 1];
382 else
383 ring_radii_0 = pitch / 2.0 * mod_main_background_bias_terms[order - 1];
384 // If center_quad_factor is zero, default value (div_num - 1)/div_num is used.
385 // We use div_num instead of mod_div_num because we are dealing wth elements here
386 // This approach ensures that the order = 2 mesh elements are consistent with the order = 1
387 ring_radii_0 *=
388 center_quad_factor == 0.0 ? (((Real)div_num - 1.0) / (Real)div_num) : center_quad_factor;
389
390 centerNodes(*mesh, virtual_side_number, mod_div_num, ring_radii_0, nodes);
391 }
392 else // pin-cell center
393 mesh->add_point(Point(0.0, 0.0, 0.0));
394
395 // create nodes for the ring regions
396 if (has_rings)
397 ringNodes(*mesh,
398 ring_radii,
399 mod_total_ring_layers,
400 mod_rings_bias_terms,
401 mod_num_sectors_per_side,
402 corner_p,
403 corner_to_corner,
404 azimuthal_tangent);
405
406 if (has_background)
407 {
408 // add nodes in background region; the background region is defined as the area between the
409 // outermost pin (if there is a pin; if no pin, the center) and the innermost hex/duct; if
410 // _has_ducts is false, the background region is the area between the pin and enclosing hexagon
411 Real background_corner_radial_interval_length;
412 Real background_corner_distance;
413 Real background_in;
414 Real background_out; // background outer frontier
415 if (has_rings)
416 background_in = ring_radii.back();
417 else
418 background_in = 0;
419
420 if (has_ducts)
421 {
422 background_out = mod_ducts_center_dist.front();
423 background_corner_distance =
424 mod_ducts_center_dist
425 .front(); // it is the center to duct (innermost duct) corner distance
426 }
427 else
428 {
429 background_out = 0.5 * corner_to_corner;
430 background_corner_distance =
431 0.5 * corner_to_corner; // it is the center to hex corner distance
432 }
433
434 background_corner_radial_interval_length =
435 (background_out - background_in) / mod_background_intervals;
436
437 node_id_background_meta = mesh->n_nodes();
438
439 // create nodes for background region
440 backgroundNodes(*mesh,
441 mod_num_sectors_per_side,
442 mod_background_intervals,
443 mod_main_background_bias_terms,
444 background_corner_distance,
445 background_corner_radial_interval_length,
446 corner_p,
447 corner_to_corner,
448 background_in,
449 azimuthal_tangent);
450 }
451
452 // create nodes for duct regions
453 if (has_ducts)
454 ductNodes(*mesh,
455 &mod_ducts_center_dist,
456 mod_total_ducts_layers,
457 mod_duct_bias_terms,
458 mod_num_sectors_per_side,
459 corner_p,
460 corner_to_corner,
461 azimuthal_tangent);
462
463 // See if the central region is the only part of the innermost part
464 // The central region of the slice is special.
465 // Unlike the outer regions, which are layered quad elements,
466 // the central region is either a layer of tri elements or a specially-patterned quad elements.
467 // If there is at least one `ring` defined in the slice,
468 // the central region must belong to the innermost (first) ring.
469 // Otherwise the central region belongs to the `background`
470 // In either case, if the innermost ring or background has only one radial interval,
471 // the central region is an independent ring or background
472 // Otherwise, the central region and one or several quad element layers together form the
473 // innermost ring or background
474 bool is_central_region_independent;
475 if (ring_layers.empty())
476 is_central_region_independent = mod_background_inner_boundary_layer_params.intervals +
477 mod_background_intervals +
478 mod_background_outer_boundary_layer_params.intervals ==
479 1;
480 else
481 is_central_region_independent = mod_ring_layers[0] +
482 mod_ring_inner_boundary_layer_params.intervals[0] +
483 mod_ring_outer_boundary_layer_params.intervals[0] ==
484 1;
485
486 // From now on, we work on the elements, which need the none "mod_" parameters
487 // Assign elements, boundaries, and subdomains;
488 // Add Tri3/Tri6/Tri7 or Quad4/Quad8/Quad9 mesh into innermost (central) region
489 if (quad_center_elements)
490 cenQuadElemDef(*mesh,
491 div_num,
492 block_id_shift,
493 create_outward_interface_boundaries && is_central_region_independent,
494 boundary_id_shift,
495 nodes,
496 (!has_rings) && (!has_ducts) && (background_intervals == 1),
497 // Note here, has_ring means either there are ring regions or background inner
498 // boundary layer; has_ducts means either there are duct regions or background
499 // outer boundary layer. Same in cenTriElemDef()
500 side_index,
501 generate_side_specific_boundaries,
502 quad_elem_type);
503 else
505 *mesh,
506 num_sectors_per_side,
507 azimuthal_tangent,
508 block_id_shift,
509 create_outward_interface_boundaries && is_central_region_independent,
510 boundary_id_shift,
511 ((!has_rings) && (!has_ducts) && (background_intervals == 1)) ||
512 ((!has_background) &&
513 (std::accumulate(total_ring_layers.begin(), total_ring_layers.end(), 0) == 1)),
514 // Only for ACCG, it is possible that the entire mesh is a single-layer ring.
515 // cenQuadElemDef() does not need this as it does not work for ACCG.
516 side_index,
517 generate_side_specific_boundaries,
518 tri_elem_type);
519
520 // Add Quad4 mesh into outer circle
521 // total number of mesh should be all the rings for pin regions + background regions;
522 // total number of quad mesh should be total number of mesh -1 (-1 is because the inner circle for
523 // tri/quad mesh has been added above)
524
525 std::vector<unsigned int> subdomain_rings;
526 if (has_rings) // define the rings in each subdomain
527 {
528 subdomain_rings = total_ring_layers;
529 subdomain_rings.front() -= 1; // remove the inner TRI mesh subdomain
530 if (background_inner_boundary_layer_params.intervals)
531 {
532 subdomain_rings.back() =
533 background_inner_boundary_layer_params.intervals + background_intervals +
534 background_outer_boundary_layer_params.intervals; // add the background region
535 if (ring_radii.size() == 1)
536 subdomain_rings.back() -= 1; // remove the inner TRI mesh subdomain
537 }
538 else if (has_background)
539 subdomain_rings.push_back(background_inner_boundary_layer_params.intervals +
540 background_intervals +
541 background_outer_boundary_layer_params.intervals);
542 }
543 else
544 {
545 subdomain_rings.push_back(
546 background_inner_boundary_layer_params.intervals + background_intervals +
547 background_outer_boundary_layer_params.intervals); // add the background region
548 subdomain_rings[0] -= 1; // remove the inner TRI mesh subdomain
549 }
550
551 if (has_ducts)
552 for (unsigned int i = (background_outer_boundary_layer_params.intervals > 0);
553 i < total_ducts_layers.size();
554 i++)
555 subdomain_rings.push_back(total_ducts_layers[i]);
556
557 quadElemDef(*mesh,
558 num_sectors_per_side,
559 subdomain_rings,
560 side_index,
561 azimuthal_tangent,
562 block_id_shift,
563 quad_center_elements ? (mod_div_num * mod_div_num - 1) : 0,
564 create_inward_interface_boundaries,
565 create_outward_interface_boundaries,
566 boundary_id_shift,
567 generate_side_specific_boundaries,
568 quad_elem_type);
569 if (tri_elem_type == TRI_ELEM_TYPE::TRI6 || quad_elem_type == QUAD_ELEM_TYPE::QUAD8)
570 mesh->remove_orphaned_nodes();
571 return mesh;
572}
const std::string & name() const
void mooseError(Args &&... args) const
void cenTriElemDef(ReplicatedMesh &mesh, const unsigned int num_sectors_per_side, const std::vector< Real > azimuthal_tangent=std::vector< Real >(), const subdomain_id_type block_id_shift=0, const bool create_outward_interface_boundaries=true, const boundary_id_type boundary_id_shift=0, const bool assign_external_boundary=false, const unsigned int side_index=0, const bool generate_side_specific_boundaries=true, const TRI_ELEM_TYPE tri_elem_type=TRI_ELEM_TYPE::TRI3) const
Defines triangular elements in the very central region of the polygon.
void backgroundNodes(ReplicatedMesh &mesh, const unsigned int num_sectors_per_side, const unsigned int background_intervals, const std::vector< Real > biased_terms, const Real background_corner_distance, const Real background_corner_radial_interval_length, const Real corner_p[2][2], const Real corner_to_corner, const Real background_in, const std::vector< Real > azimuthal_tangent=std::vector< Real >()) const
Creates nodes for the ring-to-polygon transition region (i.e., background) of a single slice.
singleBdryLayerParams modifiedSingleBdryLayerParamsCreator(const singleBdryLayerParams &original_single_bdry_layer_params, const unsigned int order) const
Modifies the input single boundary layer parameters for node generation, especially for the quadratic...
multiBdryLayerParams modifiedMultiBdryLayerParamsCreator(const multiBdryLayerParams &original_multi_bdry_layer_params, const unsigned int order) const
Modifies the input multi boundary layer parameters for node generation, especially for the quadratic ...
void ringNodes(ReplicatedMesh &mesh, const std::vector< Real > ring_radii, const std::vector< unsigned int > ring_layers, const std::vector< std::vector< Real > > biased_terms, const unsigned int num_sectors_per_side, const Real corner_p[2][2], const Real corner_to_corner, const std::vector< Real > azimuthal_tangent=std::vector< Real >()) const
Creates nodes for the ring-geometry region of a single slice.
void quadElemDef(ReplicatedMesh &mesh, const unsigned int num_sectors_per_side, const std::vector< unsigned int > subdomain_rings, const unsigned int side_index, const std::vector< Real > azimuthal_tangent=std::vector< Real >(), const subdomain_id_type block_id_shift=0, const dof_id_type nodeid_shift=0, const bool create_inward_interface_boundaries=false, const bool create_outward_interface_boundaries=true, const boundary_id_type boundary_id_shift=0, const bool generate_side_specific_boundaries=true, const QUAD_ELEM_TYPE quad_elem_type=QUAD_ELEM_TYPE::QUAD4) const
Defines general quad elements for the polygon.
void centerNodes(ReplicatedMesh &mesh, const Real virtual_side_number, const unsigned int div_num, const Real ring_radii_0, std::vector< std::vector< Node * > > &nodes) const
Creates nodes of the very central mesh layer of the polygon for quad central elements.
void ductNodes(ReplicatedMesh &mesh, std::vector< Real > *const ducts_center_dist, const std::vector< unsigned int > ducts_layers, const std::vector< std::vector< Real > > biased_terms, const unsigned int num_sectors_per_side, const Real corner_p[2][2], const Real corner_to_corner, const std::vector< Real > azimuthal_tangent=std::vector< Real >()) const
Creates nodes for the duct-geometry region of a single slice.
void cenQuadElemDef(ReplicatedMesh &mesh, const unsigned int div_num, const subdomain_id_type block_id_shift, const bool create_outward_interface_boundaries, const boundary_id_type boundary_id_shift, std::vector< std::vector< Node * > > &nodes, const bool assign_external_boundary=false, const unsigned int side_index=0, const bool generate_side_specific_boundaries=true, const QUAD_ELEM_TYPE quad_elem_type=QUAD_ELEM_TYPE::QUAD4) const
Defines quad elements in the very central region of the polygon.

Referenced by PolygonMeshGeneratorBase::buildGeneralSlice(), PolygonMeshGeneratorBase::buildSimpleSlice(), and AdvancedConcentricCircleGenerator::generate().

◆ cenQuadElemDef()

void PolygonMeshGeneratorBase::cenQuadElemDef ( ReplicatedMesh &  mesh,
const unsigned int  div_num,
const subdomain_id_type  block_id_shift,
const bool  create_outward_interface_boundaries,
const boundary_id_type  boundary_id_shift,
std::vector< std::vector< Node * > > &  nodes,
const bool  assign_external_boundary = false,
const unsigned int  side_index = 0,
const bool  generate_side_specific_boundaries = true,
const QUAD_ELEM_TYPE  quad_elem_type = QUAD_ELEM_TYPE::QUAD4 
) const
protectedinherited

Defines quad elements in the very central region of the polygon.

Parameters
meshinput mesh to create the elements onto
div_numdivision number of the central mesh layer
block_id_shiftshift of the subdomain ids generated by this function
create_outward_interface_boundarieswhether outward interface boundary sidesets are created
boundary_id_shiftshift of the interface boundary ids
id_arraypointer to a vector that contains the node_ids with basic geometry information
assign_external_boundarywhether the external boundary ids are assigned
side_indexindex of the polygon side (only used if external boundary ids are assigned)
generate_side_specific_boundarieswhether the side-specific external boundaries are generated or not
quad_elem_typetype of the quadrilateral elements to be generated

Definition at line 851 of file PolygonMeshGeneratorBase.C.

861{
862
863 BoundaryInfo & boundary_info = mesh.get_boundary_info();
864
865 // This loop defines quad elements for the central regions except for the outermost layer
866 for (unsigned int i = 0; i < div_num - 1; i++)
867 {
868 unsigned int id_x = 0;
869 unsigned int id_y = i;
870 for (unsigned int j = 0; j < 2 * i + 1; j++)
871 {
872 std::unique_ptr<Elem> new_elem;
873 if (quad_elem_type == QUAD_ELEM_TYPE::QUAD4)
874 {
875 new_elem = std::make_unique<Quad4>();
876 new_elem->set_node(0, nodes[id_x][id_y]);
877 new_elem->set_node(3, nodes[id_x][id_y + 1]);
878 new_elem->set_node(2, nodes[id_x + 1][id_y + 1]);
879 new_elem->set_node(1, nodes[id_x + 1][id_y]);
880 new_elem->subdomain_id() = 1 + block_id_shift;
881 }
882 else // QUAD8/QUAD9
883 {
884 new_elem = std::make_unique<Quad8>();
885 if (quad_elem_type == QUAD_ELEM_TYPE::QUAD9)
886 {
887 new_elem = std::make_unique<Quad9>();
888 new_elem->set_node(8, nodes[id_x * 2 + 1][id_y * 2 + 1]);
889 }
890 new_elem->set_node(0, nodes[id_x * 2][id_y * 2]);
891 new_elem->set_node(3, nodes[id_x * 2][id_y * 2 + 2]);
892 new_elem->set_node(2, nodes[id_x * 2 + 2][id_y * 2 + 2]);
893 new_elem->set_node(1, nodes[id_x * 2 + 2][id_y * 2]);
894 new_elem->set_node(4, nodes[id_x * 2 + 1][id_y * 2]);
895 new_elem->set_node(5, nodes[id_x * 2 + 2][id_y * 2 + 1]);
896 new_elem->set_node(6, nodes[id_x * 2 + 1][id_y * 2 + 2]);
897 new_elem->set_node(7, nodes[id_x * 2][id_y * 2 + 1]);
898 new_elem->subdomain_id() = 1 + block_id_shift;
899 }
900 Elem * elem_Quad = mesh.add_elem(std::move(new_elem));
901
902 if (id_x == 0)
903 boundary_info.add_side(elem_Quad, 3, SLICE_BEGIN);
904 if (id_y == 0)
905 boundary_info.add_side(elem_Quad, 0, SLICE_END);
906 if (j < i)
907 id_x++;
908 if (j >= i)
909 id_y--;
910 }
911 }
912 // This loop defines the outermost layer quad elements of the central region
913 for (unsigned int i = (div_num - 1) * (div_num - 1); i < div_num * div_num - 1; i++)
914 {
915 std::unique_ptr<Elem> new_elem;
916 if (quad_elem_type == QUAD_ELEM_TYPE::QUAD4)
917 {
918 new_elem = std::make_unique<Quad4>();
919 new_elem->set_node(0, mesh.node_ptr(i));
920 new_elem->set_node(3, mesh.node_ptr(i + 2 * div_num - 1));
921 new_elem->set_node(2, mesh.node_ptr(i + 2 * div_num));
922 new_elem->set_node(1, mesh.node_ptr(i + 1));
923 }
924 else // QUAD8/QUAD9
925 {
926 new_elem = std::make_unique<Quad8>();
927 if (quad_elem_type == QUAD_ELEM_TYPE::QUAD9)
928 {
929 new_elem = std::make_unique<Quad9>();
930 new_elem->set_node(8,
931 mesh.node_ptr((div_num - 1) * (div_num - 1) * 4 +
932 (i - (div_num - 1) * (div_num - 1)) * 2 + 1 +
933 ((div_num - 1) * 4 + 1)));
934 }
935 new_elem->set_node(0,
936 mesh.node_ptr((div_num - 1) * (div_num - 1) * 4 +
937 (i - (div_num - 1) * (div_num - 1)) * 2));
938 new_elem->set_node(3,
939 mesh.node_ptr((div_num - 1) * (div_num - 1) * 4 +
940 (i - (div_num - 1) * (div_num - 1)) * 2 +
941 ((div_num - 1) * 4 + 1) * 2));
942 new_elem->set_node(2,
943 mesh.node_ptr((div_num - 1) * (div_num - 1) * 4 +
944 (i - (div_num - 1) * (div_num - 1)) * 2 + 2 +
945 ((div_num - 1) * 4 + 1) * 2));
946 new_elem->set_node(1,
947 mesh.node_ptr((div_num - 1) * (div_num - 1) * 4 +
948 (i - (div_num - 1) * (div_num - 1)) * 2 + 2));
949 new_elem->set_node(4,
950 mesh.node_ptr((div_num - 1) * (div_num - 1) * 4 +
951 (i - (div_num - 1) * (div_num - 1)) * 2 + 1));
952 new_elem->set_node(5,
953 mesh.node_ptr((div_num - 1) * (div_num - 1) * 4 +
954 (i - (div_num - 1) * (div_num - 1)) * 2 + 2 +
955 ((div_num - 1) * 4 + 1)));
956 new_elem->set_node(6,
957 mesh.node_ptr((div_num - 1) * (div_num - 1) * 4 +
958 (i - (div_num - 1) * (div_num - 1)) * 2 + 1 +
959 ((div_num - 1) * 4 + 1) * 2));
960 new_elem->set_node(7,
961 mesh.node_ptr((div_num - 1) * (div_num - 1) * 4 +
962 (i - (div_num - 1) * (div_num - 1)) * 2 +
963 ((div_num - 1) * 4 + 1)));
964 }
965
966 Elem * elem_Quad = mesh.add_elem(std::move(new_elem));
967 elem_Quad->subdomain_id() = 1 + block_id_shift;
968 if (create_outward_interface_boundaries)
969 boundary_info.add_side(elem_Quad, 2, 1 + boundary_id_shift);
970 if (i == (div_num - 1) * (div_num - 1))
971 boundary_info.add_side(elem_Quad, 3, SLICE_BEGIN);
972 if (i == div_num * div_num - 2)
973 boundary_info.add_side(elem_Quad, 1, SLICE_END);
974 if (assign_external_boundary)
975 {
976 boundary_info.add_side(elem_Quad, 2, OUTER_SIDESET_ID);
977 if (generate_side_specific_boundaries)
978 boundary_info.add_side(
979 elem_Quad,
980 2,
981 (i < div_num * (div_num - 1) ? OUTER_SIDESET_ID : OUTER_SIDESET_ID_ALT) + side_index);
982 }
983 }
984}

Referenced by PolygonMeshGeneratorBase::buildSlice().

◆ centerNodes()

void PolygonMeshGeneratorBase::centerNodes ( ReplicatedMesh &  mesh,
const Real  virtual_side_number,
const unsigned int  div_num,
const Real  ring_radii_0,
std::vector< std::vector< Node * > > &  nodes 
) const
protectedinherited

Creates nodes of the very central mesh layer of the polygon for quad central elements.

Parameters
meshinput mesh to add the nodes onto
virtual_side_numbervirtual number of sides of the polygon (360/slice_azimuthal)
div_numdivision number of the central mesh layer
ring_radii_0radius of the central mesh layer
nodespointer to the mesh's nodes
nodesvector that contains the nodes with basic geometry information

Definition at line 575 of file PolygonMeshGeneratorBase.C.

580{
581 const std::pair<Real, Real> p_origin = std::make_pair(0.0, 0.0);
582 const std::pair<Real, Real> p_bottom =
583 std::make_pair(0.0, ring_radii_0 * std::cos(M_PI / virtual_side_number));
584 const std::pair<Real, Real> p_top =
585 std::make_pair(p_bottom.second * std::sin(2.0 * M_PI / virtual_side_number),
586 p_bottom.second * std::cos(2.0 * M_PI / virtual_side_number));
587 const std::pair<Real, Real> p_diag =
588 std::make_pair(ring_radii_0 * std::sin(M_PI / virtual_side_number),
589 ring_radii_0 * std::cos(M_PI / virtual_side_number));
590
591 // The four vertices of the central quad region are defined above.
592 // The following loops transverse all the nodes within this central quad region by moving p1 thru
593 // p4 and calculate the four-point intercept (pc).
594 // p_top------o-------p4--------o-----p_diag
595 // | | | | |
596 // | | | | |
597 // o--------o--------o--------o--------o
598 // | | | | |
599 // | | | | |
600 // p1--------o-------pc--------o-------p2
601 // | | | | |
602 // | | | | |
603 // o--------o--------o--------o--------o
604 // | | | | |
605 // | | | | |
606 // p_origin-----o-------p3--------o----p_bottom
607 //
608 // The loops are designed to transverse the nodes as shown below to facilitate elements
609 // and sides creation.
610 //
611 // 25-------24-------23-------22-------21
612 // | | | | |
613 // | | | | |
614 // 16-------15-------14-------13-------20
615 // | | | | |
616 // | | | | |
617 // 9--------8------- 7-------12-------19
618 // | | | | |
619 // | | | | |
620 // 4--------3--------6-------11-------18
621 // | | | | |
622 // | | | | |
623 // 1--------2--------5-------10-------17
624
625 for (unsigned int i = 0; i < div_num; i++)
626 {
627 unsigned int id_x = 0;
628 unsigned int id_y = i;
629 for (unsigned int j = 0; j < 2 * i + 1; j++)
630 {
631 std::pair<Real, Real> p1 = std::make_pair(
632 (p_origin.first * (div_num - 1 - id_x) + p_top.first * id_x) / (div_num - 1),
633 (p_origin.second * (div_num - 1 - id_x) + p_top.second * id_x) / (div_num - 1));
634 std::pair<Real, Real> p2 = std::make_pair(
635 (p_bottom.first * (div_num - 1 - id_x) + p_diag.first * id_x) / (div_num - 1),
636 (p_bottom.second * (div_num - 1 - id_x) + p_diag.second * id_x) / (div_num - 1));
637 std::pair<Real, Real> p3 = std::make_pair(
638 (p_origin.first * (div_num - 1 - id_y) + p_bottom.first * id_y) / (div_num - 1),
639 (p_origin.second * (div_num - 1 - id_y) + p_bottom.second * id_y) / (div_num - 1));
640 std::pair<Real, Real> p4 = std::make_pair(
641 (p_top.first * (div_num - 1 - id_y) + p_diag.first * id_y) / (div_num - 1),
642 (p_top.second * (div_num - 1 - id_y) + p_diag.second * id_y) / (div_num - 1));
643 std::pair<Real, Real> pc = fourPointIntercept(p1, p2, p3, p4);
644 nodes[id_x][id_y] = mesh.add_point(Point(pc.first, pc.second, 0.0));
645 if (j < i)
646 id_x++;
647 if (j >= i)
648 id_y--;
649 }
650 }
651}
std::pair< Real, Real > fourPointIntercept(const std::pair< Real, Real > &p1, const std::pair< Real, Real > &p2, const std::pair< Real, Real > &p3, const std::pair< Real, Real > &p4) const
Finds the center of a quadrilateral based on four vertices.

Referenced by PolygonMeshGeneratorBase::buildSlice().

◆ cenTriElemDef()

void PolygonMeshGeneratorBase::cenTriElemDef ( ReplicatedMesh &  mesh,
const unsigned int  num_sectors_per_side,
const std::vector< Real >  azimuthal_tangent = std::vector<Real>(),
const subdomain_id_type  block_id_shift = 0,
const bool  create_outward_interface_boundaries = true,
const boundary_id_type  boundary_id_shift = 0,
const bool  assign_external_boundary = false,
const unsigned int  side_index = 0,
const bool  generate_side_specific_boundaries = true,
const TRI_ELEM_TYPE  tri_elem_type = TRI_ELEM_TYPE::TRI3 
) const
protectedinherited

Defines triangular elements in the very central region of the polygon.

Parameters
meshinput mesh to create the elements onto
num_sectors_per_sidenumber of azimuthal intervals
azimuthal_tangentvector of tangent values of the azimuthal angles as reference for adaptive boundary matching
block_id_shiftshift of the subdomain ids generated by this function
create_outward_interface_boundarieswhether outward interface boundary sidesets are created
boundary_id_shiftshift of the interface boundary ids
assign_external_boundarywhether the external boundary ids are assigned
side_indexindex of the polygon side (only used if external boundary ids are assigned)
generate_side_specific_boundarieswhether the side-specific external boundaries are generated or not
tri_elem_typetype of the triangular elements to be generated

Definition at line 987 of file PolygonMeshGeneratorBase.C.

997{
998 const unsigned short order = tri_elem_type == TRI_ELEM_TYPE::TRI3 ? 1 : 2;
999 unsigned int angle_number = azimuthal_tangent.size() == 0
1000 ? num_sectors_per_side
1001 : ((azimuthal_tangent.size() - 1) / order);
1002
1003 BoundaryInfo & boundary_info = mesh.get_boundary_info();
1004 for (unsigned int i = 1; i <= angle_number; i++)
1005 {
1006 std::unique_ptr<Elem> new_elem;
1007 if (tri_elem_type == TRI_ELEM_TYPE::TRI3)
1008 {
1009 new_elem = std::make_unique<Tri3>();
1010 new_elem->set_node(0, mesh.node_ptr(0));
1011 new_elem->set_node(2, mesh.node_ptr(i));
1012 new_elem->set_node(1, mesh.node_ptr(i + 1));
1013 }
1014 else // TRI6/TRI7
1015 {
1016 new_elem = std::make_unique<Tri6>();
1017 if (tri_elem_type == TRI_ELEM_TYPE::TRI7)
1018 {
1019 new_elem = std::make_unique<Tri7>();
1020 new_elem->set_node(6, mesh.node_ptr(i * 2));
1021 }
1022 new_elem->set_node(0, mesh.node_ptr(0));
1023 new_elem->set_node(2, mesh.node_ptr(i * 2 + angle_number * order));
1024 new_elem->set_node(1, mesh.node_ptr((i + 1) * 2 + angle_number * order));
1025 new_elem->set_node(3, mesh.node_ptr(i * 2 + 1));
1026 new_elem->set_node(5, mesh.node_ptr(i * 2 - 1));
1027 new_elem->set_node(4, mesh.node_ptr(i * 2 + 1 + angle_number * order));
1028 }
1029
1030 Elem * elem = mesh.add_elem(std::move(new_elem));
1031 if (create_outward_interface_boundaries)
1032 boundary_info.add_side(elem, 1, 1 + boundary_id_shift);
1033 elem->subdomain_id() = 1 + block_id_shift;
1034 if (i == 1)
1035 boundary_info.add_side(elem, 2, SLICE_BEGIN);
1036 if (i == angle_number)
1037 boundary_info.add_side(elem, 0, SLICE_END);
1038 if (assign_external_boundary)
1039 {
1040 boundary_info.add_side(elem, 1, OUTER_SIDESET_ID);
1041 if (generate_side_specific_boundaries)
1042 boundary_info.add_side(elem,
1043 1,
1044 (i <= angle_number / 2 ? OUTER_SIDESET_ID : OUTER_SIDESET_ID_ALT) +
1045 side_index);
1046 }
1047 }
1048}

Referenced by PolygonMeshGeneratorBase::buildSlice().

◆ cutOffPolyDeform()

void PolygonMeshGeneratorBase::cutOffPolyDeform ( MeshBase &  mesh,
const Real  orientation,
const Real  y_max_0,
const Real  y_max_n,
const Real  y_min,
const unsigned int  mesh_type,
const Real  unit_angle = 60.0,
const Real  tols = 1E-5 
) const
protectedinherited

Deforms peripheral region when the external side of a polygon assembly of stitched meshes cuts off the stitched meshes.

Parameters
meshinput mesh to be deformed
orientationorientation angle of the input mesh (move the deformation direction to y)
y_max_0original maximum y position
y_max_nmaximum y position after deformation
y_minminimum y position that is affected by the deformation
mesh_typewhether the peripheral region is for a corner or a side hexagon mesh.
tolstolerance used to determine the boundary of deformation region
unit_angleunit angle of the geometry, which is 60.0 for hexagonal and 90.0 for square
Returns
n/a (input mesh is directly altered)

Definition at line 1327 of file PolygonMeshGeneratorBase.C.

1335{
1336 for (auto & node_ptr : as_range(mesh.nodes_begin(), mesh.nodes_end()))
1337 {
1338 // This function can definitely be optimized in future for better efficiency.
1339 Real & x = (*node_ptr)(0);
1340 Real & y = (*node_ptr)(1);
1341 if (mesh_type == CORNER_MESH)
1342 {
1343 nodeCoordRotate(x, y, orientation);
1344 if (x >= 0.0 && y > y_max_0)
1345 y = y - y_max_0 + y_max_n;
1346 else if (x >= 0.0 && y >= y_min)
1347 y = (y - y_min) / (y_max_0 - y_min) * (y_max_n - y_min) + y_min;
1348 else if (y > -x / std::tan(unit_angle / 360.0 * M_PI) + tols && y > y_max_0)
1349 {
1350 x /= y;
1351 y = y - y_max_0 + y_max_n;
1352 x *= y;
1353 }
1354 else if (y > -x / std::tan(unit_angle / 360.0 * M_PI) + tols && y >= y_min)
1355 {
1356 x /= y;
1357 y = (y - y_min) / (y_max_0 - y_min) * (y_max_n - y_min) + y_min;
1358 x *= y;
1359 }
1360 nodeCoordRotate(x, y, -orientation);
1361
1362 nodeCoordRotate(x, y, orientation - unit_angle);
1363 if (x <= 0 && y > y_max_0)
1364 y = y - y_max_0 + y_max_n;
1365 else if (x <= 0 && y >= y_min)
1366 y = (y - y_min) / (y_max_0 - y_min) * (y_max_n - y_min) + y_min;
1367 else if (y >= x / std::tan(unit_angle / 360.0 * M_PI) - tols && y > y_max_0)
1368 {
1369 x /= y;
1370 y = y - y_max_0 + y_max_n;
1371 x *= y;
1372 }
1373 else if (y >= x / std::tan(unit_angle / 360.0 * M_PI) - tols && y >= y_min)
1374 {
1375 x /= y;
1376 y = (y - y_min) / (y_max_0 - y_min) * (y_max_n - y_min) + y_min;
1377 x *= y;
1378 }
1379 nodeCoordRotate(x, y, unit_angle - orientation);
1380 }
1381 else
1382 {
1383 nodeCoordRotate(x, y, orientation);
1384 if (y > y_max_0)
1385 y = y - y_max_0 + y_max_n;
1386 else if (y >= y_min)
1387 y = (y - y_min) / (y_max_0 - y_min) * (y_max_n - y_min) + y_min;
1388 nodeCoordRotate(x, y, -orientation);
1389 }
1390 }
1391}
const std::vector< double > y
const std::vector< double > x
void nodeCoordRotate(Real &x, Real &y, const Real theta) const
Calculates x and y coordinates after rotating by theta angle.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)

Referenced by generate(), and PatternedHexMeshGenerator::generate().

◆ ductNodes()

void PolygonMeshGeneratorBase::ductNodes ( ReplicatedMesh &  mesh,
std::vector< Real > *const  ducts_center_dist,
const std::vector< unsigned int ducts_layers,
const std::vector< std::vector< Real > >  biased_terms,
const unsigned int  num_sectors_per_side,
const Real  corner_p[2][2],
const Real  corner_to_corner,
const std::vector< Real >  azimuthal_tangent = std::vector<Real>() 
) const
protectedinherited

Creates nodes for the duct-geometry region of a single slice.

Parameters
meshinput mesh to add the nodes onto
ducts_center_distdistance parameters of the duct regions
ducts_layersnumbers of radial intervals of the duct regions
biased_termsnormalized spacing values used for radial meshing biasing in duct region
num_sectors_per_sidenumber of azimuthal intervals
corner_p[2][2]array contains the coordinates of the corner positions
corner_to_cornerdiameter of the circumscribed circle of the polygon
azimuthal_tangentvector of tangent values of the azimuthal angles as reference for adaptive boundary matching

Definition at line 790 of file PolygonMeshGeneratorBase.C.

798{
799 unsigned int angle_number =
800 azimuthal_tangent.size() == 0 ? num_sectors_per_side : (azimuthal_tangent.size() - 1);
801 // Add nodes in ducts regions
802 (*ducts_center_dist)
803 .push_back(0.5 * corner_to_corner); // add hex boundary as the last element in this vector
804 std::vector<Real> duct_radius_interval_length(ducts_layers.size());
805
806 Real bin_radial_distance;
807 for (unsigned int l = 0; l < ducts_layers.size(); l++)
808 {
809 duct_radius_interval_length[l] =
810 ((*ducts_center_dist)[l + 1] - (*ducts_center_dist)[l]) /
811 ducts_layers[l]; // the pin radius interval for each ring_radii/subdomain
812
813 // add rings in each pin subdomain
814 for (unsigned int k = 0; k < ducts_layers[l]; k++)
815 {
816 bin_radial_distance = ((*ducts_center_dist)[l] +
817 biased_terms[l][k] * ducts_layers[l] * duct_radius_interval_length[l]);
818 const Real pin_corner_p_x = corner_p[0][0] * bin_radial_distance / (0.5 * corner_to_corner);
819 const Real pin_corner_p_y = corner_p[0][1] * bin_radial_distance / (0.5 * corner_to_corner);
820
821 // pin_corner_p(s) are the points in the pin region, on the bins towards the six corners,
822 // at different intervals
823 mesh.add_point(Point(pin_corner_p_x, pin_corner_p_y, 0.0));
824
825 for (unsigned int j = 1; j <= angle_number; j++)
826 {
827 const Real cell_boundary_p_x =
828 corner_p[0][0] + (corner_p[1][0] - corner_p[0][0]) *
829 (azimuthal_tangent.size() == 0 ? ((Real)j / (Real)angle_number)
830 : (azimuthal_tangent[j] / 2.0));
831 const Real cell_boundary_p_y =
832 corner_p[0][1] + (corner_p[1][1] - corner_p[0][1]) *
833 (azimuthal_tangent.size() == 0 ? ((Real)j / (Real)angle_number)
834 : (azimuthal_tangent[j] / 2.0));
835 // cell_boundary_p(s) are the points on the cell's six boundaries (flat sides) at
836 // different azimuthal angles
837 const Real pin_azimuthal_p_x =
838 cell_boundary_p_x * bin_radial_distance / (0.5 * corner_to_corner);
839 const Real pin_azimuthal_p_y =
840 cell_boundary_p_y * bin_radial_distance / (0.5 * corner_to_corner);
841
842 // pin_azimuthal_p are the points on the bins towards different azimuthal angles, at
843 // different intervals; excluding the ones produced by pin_corner_p
844 mesh.add_point(Point(pin_azimuthal_p_x, pin_azimuthal_p_y, 0.0));
845 }
846 }
847 }
848}

Referenced by PolygonMeshGeneratorBase::buildSlice().

◆ fourPointIntercept()

std::pair< Real, Real > PolygonMeshGeneratorBase::fourPointIntercept ( const std::pair< Real, Real > &  p1,
const std::pair< Real, Real > &  p2,
const std::pair< Real, Real > &  p3,
const std::pair< Real, Real > &  p4 
) const
protectedinherited

Finds the center of a quadrilateral based on four vertices.

Parameters
p1vertex 1
p2vertex 2
p3vertex 3
p4vertex 4
Returns
the intecept point coordinate x and y

Definition at line 1394 of file PolygonMeshGeneratorBase.C.

1398{
1399 const Real x1 = p1.first;
1400 const Real y1 = p1.second;
1401 const Real x2 = p2.first;
1402 const Real y2 = p2.second;
1403 const Real x3 = p3.first;
1404 const Real y3 = p3.second;
1405 const Real x4 = p4.first;
1406 const Real y4 = p4.second;
1407
1408 Real x = -((x1 - x2) * (y3 * x4 - x3 * y4) - (x3 - x4) * (y1 * x2 - x1 * y2)) /
1409 ((y1 - y2) * (x3 - x4) - (y3 - y4) * (x1 - x2));
1410 Real y = -((y1 - y2) * (y3 * x4 - x3 * y4) - (y3 - y4) * (y1 * x2 - x1 * y2)) /
1411 ((y1 - y2) * (x3 - x4) - (y3 - y4) * (x1 - x2));
1412
1413 return std::make_pair(x, y);
1414}

Referenced by PolygonMeshGeneratorBase::centerNodes(), and AzimuthalBlockSplitGenerator::nodeModifier().

◆ generate()

std::unique_ptr< MeshBase > PatternedCartesianMeshGenerator::generate ( )
overridevirtual

As square geometry is used here, size of patterned mesh can be straightforwardly calculated.

Reimplemented from PolygonMeshGeneratorBase.

Definition at line 381 of file PatternedCartesianMeshGenerator.C.

382{
383 std::vector<std::unique_ptr<ReplicatedMesh>> meshes(_input_names.size());
384 for (const auto i : index_range(_input_names))
385 {
386 mooseAssert(_mesh_ptrs[i] && (*_mesh_ptrs[i]).get(), "nullptr mesh");
387 meshes[i] = dynamic_pointer_cast<ReplicatedMesh>(std::move(*_mesh_ptrs[i]));
388 if (!meshes[i])
389 paramError("inputs", "Mesh '", _input_names[i], "' is not a replicated mesh but it must be");
390 // throw an error message if the input mesh does not have a flat side up
391 if (hasMeshProperty<bool>("flat_side_up", _input_names[i]))
392 if (!getMeshProperty<bool>("flat_side_up", _input_names[i]))
393 paramError("inputs",
394 "Mesh '",
395 _input_names[i],
396 "' does not have a flat side facing up, which is not supported.");
397 }
398
399 std::vector<Real> pitch_array;
400 std::vector<unsigned int> num_sectors_per_side_array;
401 std::vector<unsigned int> num_sectors_per_side_array_tmp;
402 std::vector<std::vector<Real>> control_drum_azimuthal_array;
403 std::vector<unsigned int> background_intervals_array;
404 std::vector<dof_id_type> node_id_background_array;
405 std::vector<Real> max_radius_array;
406 std::vector<bool> is_control_drum_array;
407 Real max_radius_global(0.0);
408 std::vector<Real> pattern_pitch_array;
409
411 {
412 // Extract & check pitch and drum metadata
413 for (MooseIndex(_input_names) i = 0; i < _input_names.size(); ++i)
414 {
415 // throw an error message if the input mesh does not contain the required meta data
416 if (!hasMeshProperty<Real>("pattern_pitch_meta", _input_names[i]))
418 "In PatternedCartesianMeshGenerator ",
419 _name,
420 ": the unit square input mesh does not contain appropriate meta data "
421 "required for generating a core mesh. Involved input mesh: ",
422 _input_names[i],
423 "; metadata issue: 'pattern_pitch_meta' is missing. Note that "
424 "'generate_core_metadata' is set to true, which"
425 "means that the mesh generator is producing a core mesh by stitching the input "
426 "assembly meshes together. Therefore,"
427 "the input meshes must contain the metadata of assembly meshes, which can "
428 "usually be either automatically assigned "
429 "by using another PatternedCartesianMeshGenerator with 'generate_core_metadata' set as "
430 "false or manually assigned by AddMetaDataGenerator.");
431 pattern_pitch_array.push_back(getMeshProperty<Real>("pattern_pitch_meta", _input_names[i]));
432 // throw an error message if the input mesh contains non-sense meta data
433 if (pattern_pitch_array.back() == 0.0)
435 "In PatternedCartesianMeshGenerator ",
436 _name,
437 ": the unit square input mesh does not contain appropriate meta data "
438 "required for generating a core mesh. Involved input mesh: ",
439 _input_names[i],
440 "; metadata issue: 'pattern_pitch_meta' is zero. Note that "
441 "'generate_core_metadata' is set to true, which"
442 "means that the mesh generator is producing a core mesh by stitching the input "
443 "assembly meshes together. Therefore,"
444 "the input meshes must contain the metadata of assembly meshes, which can "
445 "usually be either automatically assigned "
446 "by using another PatternedCartesianMeshGenerator with 'generate_core_metadata' set as "
447 "false or manually assigned by AddMetaDataGenerator.");
448 is_control_drum_array.push_back(
449 getMeshProperty<bool>("is_control_drum_meta", _input_names[i]));
450 control_drum_azimuthal_array.push_back(
451 getMeshProperty<bool>("is_control_drum_meta", _input_names[i])
452 ? getMeshProperty<std::vector<Real>>("azimuthal_angle_meta", _input_names[i])
453 : std::vector<Real>());
454 }
455 if (!MooseUtils::absoluteFuzzyEqual(
456 *std::max_element(pattern_pitch_array.begin(), pattern_pitch_array.end()),
457 *std::min_element(pattern_pitch_array.begin(), pattern_pitch_array.end())))
459 "In PatternedCartesianMeshGenerator ",
460 _name,
461 ": pattern_pitch metadata values of all input mesh generators must be identical when "
462 "pattern_boundary is 'none' and generate_core_metadata is true. Please check the "
463 "parameters of the mesh generators that produce the input meshes. "
464 "Note that some of these mesh generator, such as "
465 "CartesianConcentricCircleAdaptiveBoundaryMeshGenerator and FlexiblePatternGenerator,"
466 "may have different definitions of square size in their input parameters. Please refer "
467 "to the documentation of these mesh generators.",
468 pitchMetaDataErrorGenerator(_input_names, pattern_pitch_array, "pattern_pitch_meta"));
469 else
470 {
471 _pattern_pitch = pattern_pitch_array.front();
472 setMeshProperty("input_pitch_meta", _pattern_pitch);
473 }
474 }
475 else
476 {
477 if (_pattern_boundary == "expanded")
478 _pattern_pitch = getParam<Real>("square_size");
479
480 for (MooseIndex(_input_names) i = 0; i < _input_names.size(); ++i)
481 {
482 // throw an error message if the input mesh does not contain the required meta data
483 if (!hasMeshProperty<Real>("pitch_meta", _input_names[i]))
484 mooseError("In PatternedCartesianMeshGenerator ",
485 _name,
486 ": the unit square input mesh does not contain appropriate meta data "
487 "required for generating an assembly. Involved input mesh: ",
488 _input_names[i],
489 "; metadata issue: 'pitch_meta' is missing");
490 pitch_array.push_back(getMeshProperty<Real>("pitch_meta", _input_names[i]));
491
492 num_sectors_per_side_array_tmp =
493 getMeshProperty<std::vector<unsigned int>>("num_sectors_per_side_meta", _input_names[i]);
494 if (*std::max_element(num_sectors_per_side_array_tmp.begin(),
495 num_sectors_per_side_array_tmp.end()) !=
496 *std::min_element(num_sectors_per_side_array_tmp.begin(),
497 num_sectors_per_side_array_tmp.end()))
498 mooseError("In PatternedCartesianMeshGenerator ",
499 _name,
500 ": num_sectors_per_side metadata values of all four sides of each input mesh "
501 "generator must be identical.");
502 num_sectors_per_side_array.push_back(*num_sectors_per_side_array_tmp.begin());
503 background_intervals_array.push_back(
504 getMeshProperty<unsigned int>("background_intervals_meta", _input_names[i]));
505 node_id_background_array.push_back(
506 getMeshProperty<dof_id_type>("node_id_background_meta", _input_names[i]));
507 max_radius_array.push_back(getMeshProperty<Real>("max_radius_meta", _input_names[i]));
508 }
509 max_radius_global = *max_element(max_radius_array.begin(), max_radius_array.end());
510 if (!MooseUtils::absoluteFuzzyEqual(*std::max_element(pitch_array.begin(), pitch_array.end()),
511 *std::min_element(pitch_array.begin(), pitch_array.end())))
512 mooseError("In PatternedCartesianMeshGenerator ",
513 _name,
514 ": pitch metadata values of all input mesh generators must be identical. Please "
515 "check the parameters of the mesh generators that produce the input meshes.",
516 pitchMetaDataErrorGenerator(_input_names, pitch_array, "pitch_meta"));
517 setMeshProperty("input_pitch_meta", pitch_array.front());
518 if (*std::max_element(num_sectors_per_side_array.begin(), num_sectors_per_side_array.end()) !=
519 *std::min_element(num_sectors_per_side_array.begin(), num_sectors_per_side_array.end()))
521 "In PatternedCartesianMeshGenerator ",
522 _name,
523 ": num_sectors_per_side metadata values of all input mesh generators must be identical.");
524
525 if (_pattern_boundary != "expanded")
526 _pattern_pitch = pitch_array.front() * (Real)_pattern.size();
527 }
528
529 std::vector<Real> extra_dist;
530 Real extra_dist_shift(0.0);
531 Real y_min(0.0);
532 Real y_max_0(0.0);
533 Real y_max_n(0.0);
534 const Real extra_dist_tol = _pattern_boundary == "expanded" ? pitch_array.front() / 10.0 : 0.0;
535 const Real extra_dist_shift_0 = _pattern_boundary == "expanded" ? pitch_array.front() / 5.0 : 0.0;
536 std::vector<unsigned int> peripheral_duct_intervals;
537 if (_pattern_boundary == "expanded")
538 {
540 {
541 for (unsigned int i = 0; i < _duct_sizes.size(); i++)
542 {
544 _duct_sizes[i] *= std::cos(M_PI / 4.0);
546 extra_dist.push_back(0.5 * (_duct_sizes[i] * 2.0 - pitch_array.front() * _pattern.size()));
547 peripheral_duct_intervals.push_back(_duct_intervals[i]);
548 }
549 if (_duct_sizes.back() >= _pattern_pitch / 2.0)
550 paramError("duct_sizes",
551 "The duct sizes should not exceed the size of the square boundary.");
552 }
553 // calculate the distance between the larger square boundary and the boundary of stitched unit
554 // squares this is used to decide whether deformation is needed when cut-off happens or when
555 // the distance is small.
556 extra_dist.push_back(0.5 * (_pattern_pitch - pitch_array.front() * _pattern.size()));
557 peripheral_duct_intervals.insert(peripheral_duct_intervals.begin(), _background_intervals);
558
559 // In some cases, when the external square size is small enough, the external square boundary
560 // may either be very close to the input square meshes that are near the boundary or even cut
561 // off by these squares. As long as the ring regions are not cut off, the input squares can
562 // be deformed to accomodate the external square shape. This block sets up the range of mesh
563 // region that needs to be deformed.
564 if (extra_dist.front() <= extra_dist_tol)
565 {
566 extra_dist_shift = extra_dist_shift_0 - extra_dist.front();
567 for (Real & d : extra_dist)
568 d += extra_dist_shift;
570 ? max_radius_global // Currently use this, ideally this should be the max of the
571 // outer layer radii
572 : (pitch_array.front() / 2.0);
573 y_max_0 = pitch_array.front() / 2.0 + extra_dist.front();
574 y_max_n = y_max_0 - extra_dist_shift;
575 if (y_max_n <= y_min)
576 mooseError("In PatternedCartesianMeshGenerator ",
577 _name,
578 ": the assembly is cut off so much that the internal structure that should not "
579 "be altered is compromised.");
580 }
581 }
582
583 setMeshProperty("pattern_pitch_meta", _pattern_pitch);
584
585 // create a list of interface boundary ids for each input mesh
586 // NOTE: list of interface boundary ids is stored in mesh metadata
587 std::vector<std::set<boundary_id_type>> input_interface_boundary_ids;
588 input_interface_boundary_ids.resize(_input_names.size());
590 {
591 for (const auto i : make_range(_input_names.size()))
592 {
593 if (!hasMeshProperty<bool>("interface_boundaries", _input_names[i]))
594 mooseError("Metadata 'interface_boundaries' could not be found on the input mesh: ",
595 _input_names[i]);
596 if (!getMeshProperty<bool>("interface_boundaries", _input_names[i]))
597 mooseError("Interface boundary ids were not constructed in the input mesh",
598 _input_names[i]);
599 if (!hasMeshProperty<std::set<boundary_id_type>>("interface_boundary_ids", _input_names[i]))
600 mooseError("Metadata 'interface_boundary_ids' could not be found on the input mesh: ",
601 _input_names[i]);
602 }
603 }
604 for (const auto i : make_range(_input_names.size()))
605 if (hasMeshProperty<std::set<boundary_id_type>>("interface_boundary_ids", _input_names[i]))
606 input_interface_boundary_ids[i] =
607 getMeshProperty<std::set<boundary_id_type>>("interface_boundary_ids", _input_names[i]);
608
609 const Real input_pitch((_pattern_boundary == "expanded" || !_generate_core_metadata)
610 ? pitch_array.front()
612 std::vector<Real> control_drum_positions_x;
613 std::vector<Real> control_drum_positions_y;
614 std::vector<std::vector<Real>> control_drum_azimuthals;
615
616 std::unique_ptr<ReplicatedMesh> out_mesh;
617
618 for (unsigned i = 0; i < _pattern.size(); i++)
619 {
620 const Real deltax = 0.0;
621 Real deltay = -(Real)(i)*input_pitch;
622
623 for (unsigned int j = 0; j < _pattern[i].size(); j++)
624 {
625 const auto pattern = _pattern[i][j];
626 ReplicatedMesh & pattern_mesh = *meshes[pattern];
627
628 // No pattern boundary, so no need to wrap with a peripheral mesh
629 // Use the inputs as they stand and translate accordingly later
630 if (_pattern_boundary == "none")
631 {
632 if (_generate_core_metadata && is_control_drum_array[pattern] == 1)
633 {
634 control_drum_positions_x.push_back(deltax + j * input_pitch);
635 control_drum_positions_y.push_back(deltay);
636 control_drum_azimuthals.push_back(control_drum_azimuthal_array[pattern]);
637 }
638
639 if (j == 0 && i == 0)
640 {
641 out_mesh = dynamic_pointer_cast<ReplicatedMesh>(pattern_mesh.clone());
643 out_mesh->add_elem_integer(
644 "control_drum_id",
645 true,
646 is_control_drum_array[pattern] ? control_drum_azimuthals.size() : 0);
647 // shift interface boundary ids
649 reassignBoundaryIDs(*out_mesh,
651 input_interface_boundary_ids[pattern]);
652 continue;
653 }
654 }
655 // Has a pattern boundary so we need to wrap with a peripheral mesh
656 else // has a pattern boundary
657 {
658 Real rotation_angle = std::numeric_limits<Real>::max();
659 Real orientation = std::numeric_limits<Real>::max();
660 unsigned int mesh_type = std::numeric_limits<unsigned int>::max();
661 bool on_periphery = true;
662
663 if (j == 0 && i == 0)
664 {
665 rotation_angle = 90.;
666 mesh_type = CORNER_MESH;
667 orientation = 0.;
668 }
669 else if (j == 0 && i == _pattern.size() - 1)
670 {
671 rotation_angle = 180.;
672 mesh_type = CORNER_MESH;
673 orientation = -90.;
674 }
675 else if (j == _pattern[i].size() - 1 && i == 0)
676 {
677 rotation_angle = 0.;
678 mesh_type = CORNER_MESH;
679 orientation = 90.;
680 }
681 else if (j == _pattern[i].size() - 1 && i == _pattern.size() - 1)
682 {
683 rotation_angle = -90.;
684 mesh_type = CORNER_MESH;
685 orientation = 180.;
686 }
687 else if (i == 0)
688 {
689 rotation_angle = 0.;
690 mesh_type = BOUNDARY_MESH;
691 orientation = 0.;
692 }
693 else if (i == _pattern.size() - 1)
694 {
695 rotation_angle = 180.;
696 mesh_type = BOUNDARY_MESH;
697 orientation = -180.;
698 }
699 else if (j == 0)
700 {
701 rotation_angle = 90.;
702 mesh_type = BOUNDARY_MESH;
703 orientation = -90.;
704 }
705 else if (j == _pattern[i].size() - 1)
706 {
707 rotation_angle = -90.;
708 mesh_type = BOUNDARY_MESH;
709 orientation = 90;
710 }
711 else
712 on_periphery = false;
713
714 if (on_periphery)
715 {
716 auto tmp_peripheral_mesh = dynamic_pointer_cast<ReplicatedMesh>(pattern_mesh.clone());
717 addPeripheralMesh(*tmp_peripheral_mesh,
718 pattern,
719 pitch_array.front(),
720 extra_dist,
721 num_sectors_per_side_array,
722 peripheral_duct_intervals,
723 rotation_angle,
724 mesh_type);
725
726 if (extra_dist_shift != 0)
728 *tmp_peripheral_mesh, orientation, y_max_0, y_max_n, y_min, mesh_type, 90.0);
729
730 // Reassign interface boundary ids
732 reassignBoundaryIDs(*tmp_peripheral_mesh,
734 input_interface_boundary_ids[pattern]);
735
736 if (i == 0 && j == 0)
737 out_mesh = std::move(tmp_peripheral_mesh);
738 else
739 {
740 // Retrieve subdomain name map from the mesh to be stitched and insert it to the main
741 // subdomain map
742 const auto & increment_subdomain_map = tmp_peripheral_mesh->get_subdomain_name_map();
743 out_mesh->set_subdomain_name_map().insert(increment_subdomain_map.begin(),
744 increment_subdomain_map.end());
745
746 const auto stitching_boundary_id_base =
748 const auto stitching_boundary_id_periph =
750
751 MeshTools::Modification::translate(
752 *tmp_peripheral_mesh, deltax + j * input_pitch, deltay, 0);
753 out_mesh->stitch_meshes(*tmp_peripheral_mesh,
754 stitching_boundary_id_base,
755 stitching_boundary_id_periph,
756 TOLERANCE,
757 /*clear_stitched_boundary_ids=*/true,
759 }
760
761 continue;
762 }
763 }
764
766 pattern_mesh.add_elem_integer(
767 "control_drum_id",
768 true,
769 is_control_drum_array[pattern] ? control_drum_azimuthals.size() : 0);
770
771 // Translate to correct position
772 MeshTools::Modification::translate(pattern_mesh, deltax + j * input_pitch, deltay, 0);
773
774 // Define a reference map variable for subdomain map
775 auto & main_subdomain_map = out_mesh->set_subdomain_name_map();
776 // Retrieve subdomain name map from the mesh to be stitched and insert it to the main
777 // subdomain map
778 const auto & increment_subdomain_map = pattern_mesh.get_subdomain_name_map();
779 main_subdomain_map.insert(increment_subdomain_map.begin(), increment_subdomain_map.end());
780 // Check if one SubdomainName is shared by more than one subdomain ids
781 std::set<SubdomainName> main_subdomain_map_name_list;
782 for (auto const & id_name_pair : main_subdomain_map)
783 main_subdomain_map_name_list.emplace(id_name_pair.second);
784 if (main_subdomain_map.size() != main_subdomain_map_name_list.size())
785 paramError("inputs", "The input meshes contain subdomain name maps with conflicts.");
786 // Reassign interface boundary ids
788 reassignBoundaryIDs(pattern_mesh,
790 input_interface_boundary_ids[pattern]);
791
792 const auto stitching_boundary_id_1 =
794 const auto stitching_boundary_id_2 =
796 out_mesh->stitch_meshes(pattern_mesh,
797 stitching_boundary_id_1,
798 stitching_boundary_id_2,
799 TOLERANCE,
800 /*clear_stitched_boundary_ids=*/false,
802
803 // Translate back now that we've stitched so that anyone else that uses this mesh has it at
804 // the origin
805 MeshTools::Modification::translate(pattern_mesh, -(deltax + j * input_pitch), -deltay, 0);
806 // Roll back the changes in interface boundary ids for the same reason
808 reassignBoundaryIDs(pattern_mesh,
810 input_interface_boundary_ids[pattern],
811 true);
812 }
813 }
814
815 // Check if stitching_boundary_id is really the external boundary. Correct if needed.
816 auto side_list = out_mesh->get_boundary_info().build_side_list();
817 const auto stitching_boundary_id =
819 for (auto & sl : side_list)
820 {
821 // Remove it as an internal boundary
822 if (std::get<2>(sl) == stitching_boundary_id)
823 if (out_mesh->elem_ptr(std::get<0>(sl))->neighbor_ptr(std::get<1>(sl)) != nullptr)
824 out_mesh->get_boundary_info().remove_side(
825 out_mesh->elem_ptr(std::get<0>(sl)), std::get<1>(sl), std::get<2>(sl));
826 }
827
828 out_mesh->get_boundary_info().clear_boundary_node_ids();
829
830 out_mesh->get_boundary_info().build_node_list_from_side_list();
831 const auto node_list = out_mesh->get_boundary_info().build_node_list();
832
833 std::vector<Real> bd_x_list;
834 std::vector<Real> bd_y_list;
835 std::vector<std::pair<Real, dof_id_type>> node_azi_list;
836 const Point origin_pt = MooseMeshUtils::meshCentroidCalculator(*out_mesh);
837 const Real origin_x = origin_pt(0);
838 const Real origin_y = origin_pt(1);
839
840 MeshTools::Modification::translate(*out_mesh, -origin_x, -origin_y, 0);
841
843 {
844 MeshTools::Modification::rotate(*out_mesh, -45.0, 0.0, 0.0);
845 const Real azi_tol = 1E-8;
846 for (unsigned int i = 0; i < node_list.size(); ++i)
847 {
848 if (std::get<1>(node_list[i]) == stitching_boundary_id)
849 {
850 node_azi_list.push_back(
851 std::make_pair(atan2(out_mesh->node_ref(std::get<0>(node_list[i]))(1),
852 out_mesh->node_ref(std::get<0>(node_list[i]))(0)) *
853 180.0 / M_PI,
854 std::get<0>(node_list[i])));
855 // correct the last node's angle value (180.0) if it becomes a negative value.
856 if (node_azi_list.back().first + 180.0 <= azi_tol)
857 node_azi_list.back().first = 180;
858 }
859 }
860 std::sort(node_azi_list.begin(), node_azi_list.end());
861 const unsigned int side_intervals = node_azi_list.size() / SQUARE_NUM_SIDES;
862 for (unsigned int i = 0; i < SQUARE_NUM_SIDES; i++)
863 {
864 for (unsigned int j = 1; j <= side_intervals; j++)
865 {
866 Real azi_corr_tmp = atan2((Real)j * 2.0 / (Real)side_intervals - 1.0, 1.0);
867 Real x_tmp = _pattern_pitch / 2.0;
868 Real y_tmp = x_tmp * std::tan(azi_corr_tmp);
869 nodeCoordRotate(x_tmp, y_tmp, (Real)i * 90.0 - 135.0);
870 Point p_tmp = Point(x_tmp, y_tmp, 0.0);
871 out_mesh->add_point(p_tmp, node_azi_list[i * side_intervals + j - 1].second);
872 }
873 }
874
875 // if quadratic elements are used, additional nodes need to be adjusted based on the new
876 // boundary node locations. adjust side mid-edge nodes to the midpoints of the corner
877 // points, and if QUAD9, adjust center point to new centroid.
880
881 MeshTools::Modification::rotate(*out_mesh, 45.0, 0.0, 0.0);
882 }
883
884 MeshTools::Modification::rotate(*out_mesh, _rotate_angle, 0.0, 0.0);
885
886 // This combination of input parameters is usually used for core mesh generation by stitching
887 // assembly meshes together.
889 {
890 const Real azi_tol = 1E-8;
891 std::vector<std::tuple<Real, Point, std::vector<Real>, dof_id_type>> control_drum_tmp;
892 std::vector<dof_id_type> control_drum_id_sorted;
893 for (unsigned int i = 0; i < control_drum_positions_x.size(); ++i)
894 {
895 control_drum_positions_x[i] -= origin_x;
896 control_drum_positions_y[i] -= origin_y;
897 nodeCoordRotate(control_drum_positions_x[i], control_drum_positions_y[i], _rotate_angle);
898 Real cd_angle = atan2(control_drum_positions_y[i], control_drum_positions_x[i]);
899
900 for (unsigned int j = 0; j < control_drum_azimuthals[i].size(); j++)
901 {
902 control_drum_azimuthals[i][j] += _rotate_angle;
903 control_drum_azimuthals[i][j] =
904 atan2(std::sin(control_drum_azimuthals[i][j] / 180.0 * M_PI),
905 std::cos(control_drum_azimuthals[i][j] / 180.0 * M_PI)) /
906 M_PI * 180.0; // quick way to move from -M_PI to M_PI
907 }
908 std::sort(control_drum_azimuthals[i].begin(), control_drum_azimuthals[i].end());
909
910 if (std::abs(cd_angle) < azi_tol)
911 cd_angle = 0;
912 else if (cd_angle < 0.0)
913 cd_angle += 2 * M_PI;
914 control_drum_tmp.push_back(
915 std::make_tuple(cd_angle,
916 Point(control_drum_positions_x[i], control_drum_positions_y[i], 0.0),
917 control_drum_azimuthals[i],
918 i + 1)); // control drum index to help sort control_drum_id
919 }
920 std::sort(control_drum_tmp.begin(), control_drum_tmp.end());
921 std::vector<Point> control_drum_positions;
922 std::vector<Real> control_drum_angles;
923 std::vector<std::vector<Real>> control_drums_azimuthal_meta;
924 for (unsigned int i = 0; i < control_drum_tmp.size(); ++i)
925 {
926 control_drum_positions.push_back(std::get<1>(control_drum_tmp[i]));
927 control_drum_angles.push_back(std::get<0>(control_drum_tmp[i]));
928 control_drums_azimuthal_meta.push_back(std::get<2>(control_drum_tmp[i]));
929 control_drum_id_sorted.push_back(std::get<3>(control_drum_tmp[i]));
930 }
931 setMeshProperty("control_drum_positions", control_drum_positions);
932 setMeshProperty("control_drum_angles", control_drum_angles);
933 setMeshProperty("control_drums_azimuthal_meta", control_drums_azimuthal_meta);
934
936 {
937 unsigned int drum_integer_index = out_mesh->get_elem_integer_index("control_drum_id");
938 for (const auto & elem : out_mesh->element_ptr_range())
939 {
940 dof_id_type unsorted_control_drum_id = elem->get_extra_integer(drum_integer_index);
941 if (unsorted_control_drum_id != 0)
942 {
943 auto sorted_iter = std::find(control_drum_id_sorted.begin(),
944 control_drum_id_sorted.end(),
945 unsorted_control_drum_id);
946 elem->set_extra_integer(drum_integer_index,
947 std::distance(control_drum_id_sorted.begin(), sorted_iter) + 1);
948 }
949 }
950 }
951
953 {
954 std::string position_file_name = getMeshProperty<std::string>("position_file_name", name());
955 std::ofstream pos_file(position_file_name);
956 for (unsigned int i = 0; i < control_drum_positions.size(); ++i)
957 pos_file << control_drum_positions[i](0) << " " << control_drum_positions[i](1) << " 0.0\n";
958 pos_file.close();
959 }
960 }
961
962 // add reporting IDs if _use_reporting_id is set true
963 // NOTE: addReportingIDs should be called before applying customized peripheral block ids
965 addReportingIDs(*out_mesh, meshes);
966
967 // Assign customized peripheral block ids and names
968 if (!_peripheral_block_ids.empty())
969 for (const auto & elem : out_mesh->active_element_ptr_range())
971 i++)
972 if (elem->subdomain_id() == i)
973 {
974 elem->subdomain_id() = _peripheral_block_ids[i - PERIPHERAL_ID_SHIFT];
975 break;
976 }
977 if (!_peripheral_block_names.empty())
978 {
979 for (unsigned i = 0; i < _peripheral_block_names.size(); i++)
980 out_mesh->set_subdomain_name(_peripheral_block_ids.empty() ? (PERIPHERAL_ID_SHIFT + i)
983 }
984 // Assign customized outer surface boundary id and name
985 if (_external_boundary_id > 0)
986 MooseMesh::changeBoundaryId(*out_mesh, stitching_boundary_id, _external_boundary_id, false);
987 if (!_external_boundary_name.empty())
988 {
989 out_mesh->get_boundary_info().sideset_name(_external_boundary_id > 0
991 : (boundary_id_type)stitching_boundary_id) =
993 out_mesh->get_boundary_info().nodeset_name(_external_boundary_id > 0
995 : (boundary_id_type)stitching_boundary_id) =
997 }
998 // Merge the boundary name maps of all the input meshed to generate the output mesh's boundary
999 // name maps
1000 auto & new_sideset_map = out_mesh->get_boundary_info().set_sideset_name_map();
1001 auto & new_nodeset_map = out_mesh->get_boundary_info().set_nodeset_name_map();
1002 for (unsigned int i = 0; i < meshes.size(); i++)
1003 {
1004 const auto input_sideset_map = meshes[i]->get_boundary_info().get_sideset_name_map();
1005 new_sideset_map.insert(input_sideset_map.begin(), input_sideset_map.end());
1006 const auto input_nodeset_map = meshes[i]->get_boundary_info().get_nodeset_name_map();
1007 new_nodeset_map.insert(input_nodeset_map.begin(), input_nodeset_map.end());
1008 }
1009
1010 // set mesh metadata related with interface boundary ids
1011 const std::set<boundary_id_type> boundary_ids = out_mesh->get_boundary_info().get_boundary_ids();
1012 const std::set<boundary_id_type> interface_boundary_ids = getInterfaceBoundaryIDs(
1013 _pattern,
1015 boundary_ids,
1016 input_interface_boundary_ids,
1019 extra_dist.size());
1020 if (interface_boundary_ids.size() > 0)
1021 {
1022 setMeshProperty("interface_boundaries", true);
1023 setMeshProperty("interface_boundary_ids", interface_boundary_ids);
1024 }
1025
1026 out_mesh->unset_is_prepared();
1027 auto mesh = dynamic_pointer_cast<MeshBase>(out_mesh);
1028 return mesh;
1029}
for(PetscInt i=0;i< nvars;++i)
T & setMeshProperty(const std::string &data_name, Args &&... args)
bool hasMeshProperty(const std::string &data_name, const std::string &prefix) const
const T & getMeshProperty(const std::string &data_name, const std::string &prefix)
const std::string & _name
void changeBoundaryId(const boundary_id_type old_id, const boundary_id_type new_id, bool delete_prev)
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.
Real _pattern_pitch
Pitch size of the input assembly mesh.
void addReportingIDs(MeshBase &mesh, const std::vector< std::unique_ptr< ReplicatedMesh > > &from_meshes) const
Adds the reporting IDs onto the input mesh.
std::set< boundary_id_type > getInterfaceBoundaryIDs(const std::vector< std::vector< unsigned int > > &pattern, const std::vector< std::vector< boundary_id_type > > &interface_boundary_id_shift_pattern, const std::set< boundary_id_type > &boundary_ids, const std::vector< std::set< boundary_id_type > > &input_interface_boundary_ids, const bool use_interface_boundary_id_shift, const bool create_interface_boundary_id, const unsigned int num_extra_layers) const
returns a list of interface boundary IDs on the mesh generated by this mesh generator
void cutOffPolyDeform(MeshBase &mesh, const Real orientation, const Real y_max_0, const Real y_max_n, const Real y_min, const unsigned int mesh_type, const Real unit_angle=60.0, const Real tols=1E-5) const
Deforms peripheral region when the external side of a polygon assembly of stitched meshes cuts off th...
void reassignBoundaryIDs(MeshBase &mesh, const boundary_id_type id_shift, const std::set< boundary_id_type > &boundary_ids, const bool reverse=false)
reassign interface boundary IDs on the input mesh by applying the boundary ID shift
void adjustPeripheralQuadraticElements(MeshBase &out_mesh, const QUAD_ELEM_TYPE boundary_quad_elem_type) const
Adjusts the mid-edge node locations in boundary regions when using quadratic elements with uniform bo...
std::string pitchMetaDataErrorGenerator(const std::vector< MeshGeneratorName > &input_names, const std::vector< Real > &metadata_vals, const std::string &metadata_name) const
Generate a string that contains the detailed metadata information for inconsistent input mesh metadat...
@ pattern
assign the same reporting IDs for all tiles in the pattern with same input
const Elem & get(const ElemType type_in)
auto index_range(const T &sizable)

◆ getInterfaceBoundaryIDs()

std::set< boundary_id_type > PolygonMeshGeneratorBase::getInterfaceBoundaryIDs ( const std::vector< std::vector< unsigned int > > &  pattern,
const std::vector< std::vector< boundary_id_type > > &  interface_boundary_id_shift_pattern,
const std::set< boundary_id_type > &  boundary_ids,
const std::vector< std::set< boundary_id_type > > &  input_interface_boundary_ids,
const bool  use_interface_boundary_id_shift,
const bool  create_interface_boundary_id,
const unsigned int  num_extra_layers 
) const
protectedinherited

returns a list of interface boundary IDs on the mesh generated by this mesh generator

Parameters
patternpattern of cells used in this mesh generator
interface_boundary_id_shift_pattern2D pattern of shift values applied to the boundary IDs inside each pattern cells
boundary_idslist of boundary IDs on the mesh generated by this mesh generator
input_interface_boundary_idslist of interface boundary IDs of the pattern cells
use_interface_boundary_id_shiftwhether ID shifts are applied to interface boundary IDs of the pattern cells
create_interface_boundary_idwhether interface boundary IDs are generated by this mesh generator
num_extra_layersnumber of extra layers to define background and duct regions on the patterned mesh generated by this mesh generator

Definition at line 1720 of file PolygonMeshGeneratorBase.C.

1728{
1729 std::set<boundary_id_type> interface_boundary_ids;
1730 // add existing interface boundary ids from input meshes
1731 if (use_interface_boundary_id_shift)
1732 {
1733 for (const auto i : make_range(pattern.size()))
1734 for (const auto j : make_range(pattern[i].size()))
1735 {
1736 const auto & ids = input_interface_boundary_ids[pattern[i][j]];
1737 for (const auto & id : ids)
1738 {
1739 const boundary_id_type new_id = id + interface_boundary_id_shift_pattern[i][j];
1740 auto it = boundary_ids.find(new_id);
1741 if (it != boundary_ids.end())
1742 interface_boundary_ids.insert(new_id);
1743 }
1744 }
1745 }
1746 else
1747 {
1748 for (const auto & ids : input_interface_boundary_ids)
1749 for (const auto & id : ids)
1750 {
1751 auto it = boundary_ids.find(id);
1752 if (it != boundary_ids.end())
1753 interface_boundary_ids.insert(id);
1754 }
1755 }
1756 // add unshifted interface boundary ids for the duct & background regions
1757 if (create_interface_boundary_id)
1758 for (const auto i : make_range(num_extra_layers))
1759 {
1760 boundary_id_type id = SLICE_ALT + i * 2 + 1;
1761 auto it = boundary_ids.find(id);
1762 if (it != boundary_ids.end())
1763 interface_boundary_ids.insert(id);
1764 id = SLICE_ALT + i * 2;
1765 it = boundary_ids.find(id);
1766 if (it != boundary_ids.end())
1767 interface_boundary_ids.insert(id);
1768 }
1769 return interface_boundary_ids;
1770}

Referenced by generate(), and PatternedHexMeshGenerator::generate().

◆ modifiedMultiBdryLayerParamsCreator()

PolygonMeshGeneratorBase::multiBdryLayerParams PolygonMeshGeneratorBase::modifiedMultiBdryLayerParamsCreator ( const multiBdryLayerParams original_multi_bdry_layer_params,
const unsigned int  order 
) const
protectedinherited

Modifies the input multi boundary layer parameters for node generation, especially for the quadratic elements.

Parameters
original_multi_bdry_layer_paramsoriginal multi boundary layer parameters
orderorder of the elements
Returns
modified multi boundary layer parameters

Definition at line 1773 of file PolygonMeshGeneratorBase.C.

1775{
1776 multiBdryLayerParams mod_multi_bdry_layer_params(original_multi_bdry_layer_params);
1777 std::for_each(mod_multi_bdry_layer_params.intervals.begin(),
1778 mod_multi_bdry_layer_params.intervals.end(),
1779 [&order](unsigned int & n) { n *= order; });
1780 std::for_each(mod_multi_bdry_layer_params.biases.begin(),
1781 mod_multi_bdry_layer_params.biases.end(),
1782 [&order](Real & n) { n = std::pow(n, 1.0 / order); });
1783 return mod_multi_bdry_layer_params;
1784}

Referenced by PolygonMeshGeneratorBase::buildSlice().

◆ modifiedSingleBdryLayerParamsCreator()

PolygonMeshGeneratorBase::singleBdryLayerParams PolygonMeshGeneratorBase::modifiedSingleBdryLayerParamsCreator ( const singleBdryLayerParams original_single_bdry_layer_params,
const unsigned int  order 
) const
protectedinherited

Modifies the input single boundary layer parameters for node generation, especially for the quadratic elements.

Parameters
original_single_bdry_layer_paramsoriginal single boundary layer parameters
orderorder of the elements
Returns
modified single boundary layer parameters

Definition at line 1787 of file PolygonMeshGeneratorBase.C.

1789{
1790 singleBdryLayerParams mod_single_bdry_layer_params(original_single_bdry_layer_params);
1791 mod_single_bdry_layer_params.intervals *= order;
1792 mod_single_bdry_layer_params.bias = std::pow(mod_single_bdry_layer_params.bias, 1.0 / order);
1793 return mod_single_bdry_layer_params;
1794}

Referenced by PolygonMeshGeneratorBase::buildSlice().

◆ nodeCoordRotate()

void PolygonMeshGeneratorBase::nodeCoordRotate ( Real &  x,
Real &  y,
const Real  theta 
) const
protectedinherited

Calculates x and y coordinates after rotating by theta angle.

Parameters
xx coordinate of the node to be rotated
yy coordinate of the node to be rotated
thetarotation angle
Returns
n/a

Definition at line 1318 of file PolygonMeshGeneratorBase.C.

1319{
1320 const Real x_tmp = x;
1321 const Real y_tmp = y;
1322 x = x_tmp * std::cos(theta * M_PI / 180.0) - y_tmp * std::sin(theta * M_PI / 180.0);
1323 y = x_tmp * std::sin(theta * M_PI / 180.0) + y_tmp * std::cos(theta * M_PI / 180.0);
1324}

Referenced by PolygonMeshGeneratorBase::cutOffPolyDeform(), FlexiblePatternGenerator::FlexiblePatternGenerator(), generate(), PatternedHexMeshGenerator::generate(), and PolygonConcentricCircleMeshGeneratorBase::generate().

◆ pitchMetaDataErrorGenerator()

std::string PolygonMeshGeneratorBase::pitchMetaDataErrorGenerator ( const std::vector< MeshGeneratorName > &  input_names,
const std::vector< Real > &  metadata_vals,
const std::string &  metadata_name 
) const
protectedinherited

Generate a string that contains the detailed metadata information for inconsistent input mesh metadata error messages.

Parameters
input_nameslist of input mesh generator names
metadata_valslist of input mesh metadata values
metadata_namename of the input mesh metadata
Returns
a string that contains the detailed metadata information

Definition at line 1797 of file PolygonMeshGeneratorBase.C.

1801{
1802 FormattedTable table;
1803 for (unsigned int i = 0; i < input_names.size(); i++)
1804 {
1805 table.addRow(i);
1806 table.addData<std::string>("input name", (std::string)input_names[i]);
1807 table.addData<Real>(metadata_name, metadata_vals[i]);
1808 }
1809 table.outputTimeColumn(false);
1810 std::stringstream detailed_error;
1811 table.printTable(detailed_error);
1812 return "\n" + detailed_error.str();
1813}
void printTable(std::ostream &out, unsigned int last_n_entries=0)
void addData(const std::string &name, const T &value)
void addRow(Real time)
void outputTimeColumn(bool output_time)

Referenced by generate(), and PatternedHexMeshGenerator::generate().

◆ pointInterpolate()

std::pair< Real, Real > PolygonMeshGeneratorBase::pointInterpolate ( const Real  pi_1_x,
const Real  pi_1_y,
const Real  po_1_x,
const Real  po_1_y,
const Real  pi_2_x,
const Real  pi_2_y,
const Real  po_2_x,
const Real  po_2_y,
const unsigned int  i,
const unsigned int  j,
const unsigned int  num_sectors_per_side,
const unsigned int  peripheral_intervals 
) const
protectedinherited

Calculates the point coordinates of within a parallelogram region using linear interpolation.

Parameters
pi_1_xx coordinate of the first inner side point (parallelogram vertex)
pi_1_yy coordinate of the first inner side point (parallelogram vertex)
po_1_xx coordinate of the first outer side point (parallelogram vertex)
po_1_yy coordinate of the first outer side point (parallelogram vertex)
pi_2_xx coordinate of the second inner side point (parallelogram vertex)
pi_2_yy coordinate of the second inner side point (parallelogram vertex)
po_2_xx coordinate of the second outer side point (parallelogram vertex)
po_2_yy coordinate of the second outer side point (parallelogram vertex)
ipassed loop index 1
jpassed loop index 2
num_sectors_per_sidenumber of azimuthal intervals
peripheral_invervalsnumber of radial intervals of the peripheral region
Returns
an interpolated position within a parallelogram

Definition at line 1291 of file PolygonMeshGeneratorBase.C.

1303{
1304 auto position_px_inner =
1305 (pi_1_x * (num_sectors_per_side / 2.0 - j) + pi_2_x * j) / (num_sectors_per_side / 2.0);
1306 auto position_py_inner =
1307 (pi_1_y * (num_sectors_per_side / 2.0 - j) + pi_2_y * j) / (num_sectors_per_side / 2.0);
1308 auto position_px_outer =
1309 (d_po_1_x * (num_sectors_per_side / 2.0 - j) + d_po_2_x * j) / (num_sectors_per_side / 2.0);
1310 auto position_py_outer =
1311 (d_po_1_y * (num_sectors_per_side / 2.0 - j) + d_po_2_y * j) / (num_sectors_per_side / 2.0);
1312 auto position_px = position_px_inner + position_px_outer * i / peripheral_intervals;
1313 auto position_py = position_py_inner + position_py_outer * i / peripheral_intervals;
1314 return std::make_pair(position_px, position_py);
1315}

Referenced by PolygonMeshGeneratorBase::buildSimplePeripheral().

◆ positionSetup()

void PatternedCartesianMeshGenerator::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
protected

Computes the inner and outer node positions of the peripheral region for a single layer.

Parameters
positions_innerkey positions (i.e., vertices and mid-points) of the inner side of the peripheral region
d_positions_outerkey incremental positions (i.e., vertices and mid-points) of the outer side of the peripheral region
extra_dist_inextra distance applied to the inner side of the peripheral layer
extra_dist_outextra distance applied to the outer side
pitchpitch size of the involved polygonal mesh

Definition at line 1105 of file PatternedCartesianMeshGenerator.C.

1111{
1112 positions_inner.resize(0);
1113 d_positions_outer.resize(0);
1114 // Nine sets of positions are generated here, as shown below.
1115 // CORNER MESH Peripheral {0 1 2} and {2 3 4}
1116 //
1117 // 0 1 2
1118 // | | /
1119 // | | /
1120 // |____|____/
1121 // | |
1122 // | |____ 3
1123 // | |
1124 // |_________|____ 4
1125 //
1126 // EDGE MESH Peripheral {0 1 5}
1127 //
1128 // 0 1 5
1129 // | | |
1130 // | | |
1131 // |____|____|
1132 // | |
1133 // | |
1134 // | |
1135 // |_________|
1136
1137 // Inner positions defined from index 0 through 5 as shown in the above cartoon
1138 positions_inner.push_back(std::make_pair(-pitch / 2.0, pitch / 2.0 + extra_dist_in));
1139 positions_inner.push_back(std::make_pair(0.0, pitch / 2.0 + extra_dist_in));
1140 positions_inner.push_back(
1141 std::make_pair(pitch / 2.0 + extra_dist_in, pitch / 2.0 + extra_dist_in));
1142 positions_inner.push_back(std::make_pair(pitch / 2.0 + extra_dist_in, 0.0));
1143 positions_inner.push_back(std::make_pair(pitch / 2.0 + extra_dist_in, -pitch / 2.0));
1144 positions_inner.push_back(std::make_pair(pitch / 2.0, pitch / 2.0 + extra_dist_in));
1145
1146 // Outer positions (relative displacement from inner ones) defined from index 0 through 5 as shown
1147 // in the above cartoon
1148 d_positions_outer.push_back(std::make_pair(0.0, extra_dist_out - extra_dist_in));
1149 d_positions_outer.push_back(std::make_pair(0.0, extra_dist_out - extra_dist_in));
1150 d_positions_outer.push_back(
1151 std::make_pair(extra_dist_out - extra_dist_in, extra_dist_out - extra_dist_in));
1152 d_positions_outer.push_back(std::make_pair(extra_dist_out - extra_dist_in, 0.0));
1153 d_positions_outer.push_back(std::make_pair(extra_dist_out - extra_dist_in, 0.0));
1154 d_positions_outer.push_back(std::make_pair(0.0, extra_dist_out - extra_dist_in));
1155}

Referenced by addPeripheralMesh().

◆ quadElemDef()

void PolygonMeshGeneratorBase::quadElemDef ( ReplicatedMesh &  mesh,
const unsigned int  num_sectors_per_side,
const std::vector< unsigned int subdomain_rings,
const unsigned int  side_index,
const std::vector< Real >  azimuthal_tangent = std::vector<Real>(),
const subdomain_id_type  block_id_shift = 0,
const dof_id_type  nodeid_shift = 0,
const bool  create_inward_interface_boundaries = false,
const bool  create_outward_interface_boundaries = true,
const boundary_id_type  boundary_id_shift = 0,
const bool  generate_side_specific_boundaries = true,
const QUAD_ELEM_TYPE  quad_elem_type = QUAD_ELEM_TYPE::QUAD4 
) const
protectedinherited

Defines general quad elements for the polygon.

Parameters
meshinput mesh to create the elements onto
num_sectors_per_sidenumber of azimuthal intervals
subdomain_ringsnumbers of radial intervals of all involved subdomain layers
side_indexindex of the polygon side
azimuthal_tangentvector of tangent values of the azimuthal angles as reference for adaptive boundary matching
block_id_shiftshift of the subdomain ids generated by this function
nodeid_shiftshift of the node_ids of these elements
create_inward_interface_boundarieswhether inward interface boundary sidesets are created
create_outward_interface_boundarieswhether outward interface boundary sidesets are created
boundary_id_shiftshift of the interface boundary ids
generate_side_specific_boundarieswhether the side-specific external boundaries are generated or not
quad_elem_typetype of the quadrilateral elements to be generated

Definition at line 1051 of file PolygonMeshGeneratorBase.C.

1063{
1064 const unsigned short order = quad_elem_type == QUAD_ELEM_TYPE::QUAD4 ? 1 : 2;
1065 unsigned int angle_number = azimuthal_tangent.size() == 0
1066 ? num_sectors_per_side
1067 : ((azimuthal_tangent.size() - 1) / order);
1068
1069 BoundaryInfo & boundary_info = mesh.get_boundary_info();
1070 unsigned int j = 0;
1071 for (unsigned int k = 0; k < (subdomain_rings.size()); k++)
1072 {
1073 for (unsigned int m = 0; m < subdomain_rings[k]; m++)
1074 {
1075 for (unsigned int i = 1; i <= angle_number; i++)
1076 {
1077 std::unique_ptr<Elem> new_elem;
1078 if (quad_elem_type == QUAD_ELEM_TYPE::QUAD4)
1079 {
1080 new_elem = std::make_unique<Quad4>();
1081 new_elem->set_node(0, mesh.node_ptr(nodeid_shift + i + (angle_number + 1) * j));
1082 new_elem->set_node(1, mesh.node_ptr(nodeid_shift + i + 1 + (angle_number + 1) * j));
1083 new_elem->set_node(2, mesh.node_ptr(nodeid_shift + i + (angle_number + 1) * (j + 1) + 1));
1084 new_elem->set_node(3, mesh.node_ptr(nodeid_shift + i + (angle_number + 1) * (j + 1)));
1085 }
1086 else // QUAD8/QUAD9
1087 {
1088 new_elem = std::make_unique<Quad8>();
1089 if (quad_elem_type == QUAD_ELEM_TYPE::QUAD9)
1090 {
1091 new_elem = std::make_unique<Quad9>();
1092 new_elem->set_node(
1093 8, mesh.node_ptr(nodeid_shift + i * 2 + (angle_number * 2 + 1) * (j * 2 + 2)));
1094 }
1095 new_elem->set_node(
1096 0,
1097 mesh.node_ptr(nodeid_shift + (i - 1) * 2 + 1 + (angle_number * 2 + 1) * (j * 2 + 1)));
1098 new_elem->set_node(
1099 1, mesh.node_ptr(nodeid_shift + i * 2 + 1 + (angle_number * 2 + 1) * (j * 2 + 1)));
1100 new_elem->set_node(
1101 2, mesh.node_ptr(nodeid_shift + i * 2 + 1 + (angle_number * 2 + 1) * (j * 2 + 3)));
1102 new_elem->set_node(
1103 3,
1104 mesh.node_ptr(nodeid_shift + (i - 1) * 2 + 1 + (angle_number * 2 + 1) * (j * 2 + 3)));
1105 new_elem->set_node(
1106 4, mesh.node_ptr(nodeid_shift + i * 2 + (angle_number * 2 + 1) * (j * 2 + 1)));
1107 new_elem->set_node(
1108 5, mesh.node_ptr(nodeid_shift + i * 2 + 1 + (angle_number * 2 + 1) * (j * 2 + 2)));
1109 new_elem->set_node(
1110 6, mesh.node_ptr(nodeid_shift + i * 2 + (angle_number * 2 + 1) * (j * 2 + 3)));
1111 new_elem->set_node(
1112 7,
1113 mesh.node_ptr(nodeid_shift + (i - 1) * 2 + 1 + (angle_number * 2 + 1) * (j * 2 + 2)));
1114 }
1115 Elem * elem = mesh.add_elem(std::move(new_elem));
1116 if (i == 1)
1117 boundary_info.add_side(elem, 3, SLICE_BEGIN);
1118 if (i == angle_number)
1119 boundary_info.add_side(elem, 1, SLICE_END);
1120
1121 if (subdomain_rings[0] == 0)
1122 elem->subdomain_id() = k + 1 + block_id_shift;
1123 else
1124 elem->subdomain_id() = k + 2 + block_id_shift;
1125
1126 if (m == 0 && create_inward_interface_boundaries && k > 0)
1127 boundary_info.add_side(elem, 0, k * 2 + boundary_id_shift);
1128 if (m == (subdomain_rings[k] - 1))
1129 {
1130 if (k == (subdomain_rings.size() - 1))
1131 {
1132 boundary_info.add_side(elem, 2, OUTER_SIDESET_ID);
1133 if (generate_side_specific_boundaries)
1134 {
1135 if (i <= angle_number / 2)
1136 boundary_info.add_side(elem, 2, OUTER_SIDESET_ID + side_index);
1137 else
1138 boundary_info.add_side(elem, 2, OUTER_SIDESET_ID_ALT + side_index);
1139 }
1140 }
1141 else if (create_outward_interface_boundaries)
1142 boundary_info.add_side(elem, 2, k * 2 + 1 + boundary_id_shift);
1143 }
1144 }
1145 j++;
1146 }
1147 }
1148}

Referenced by PolygonMeshGeneratorBase::buildSlice().

◆ reassignBoundaryIDs()

void PolygonMeshGeneratorBase::reassignBoundaryIDs ( MeshBase &  mesh,
const boundary_id_type  id_shift,
const std::set< boundary_id_type > &  boundary_ids,
const bool  reverse = false 
)
protectedinherited

reassign interface boundary IDs on the input mesh by applying the boundary ID shift

Parameters
meshinput mesh
id_shiftID shift value to be applied
boundary_idslist of boundary IDs to be reassigned
reverseremove boundary ID shift

Definition at line 1701 of file PolygonMeshGeneratorBase.C.

1705{
1706 const std::set<boundary_id_type> existing_boundary_ids =
1707 mesh.get_boundary_info().get_boundary_ids();
1708 for (const auto id : boundary_ids)
1709 {
1710
1711 const boundary_id_type old_id = (!reverse) ? id : id + id_shift;
1712 const boundary_id_type new_id = (!reverse) ? id + id_shift : id;
1713 auto it = existing_boundary_ids.find(old_id);
1714 if (it != existing_boundary_ids.end())
1715 MooseMesh::changeBoundaryId(mesh, old_id, new_id, true);
1716 }
1717}

Referenced by generate(), and PatternedHexMeshGenerator::generate().

◆ ringNodes()

void PolygonMeshGeneratorBase::ringNodes ( ReplicatedMesh &  mesh,
const std::vector< Real >  ring_radii,
const std::vector< unsigned int ring_layers,
const std::vector< std::vector< Real > >  biased_terms,
const unsigned int  num_sectors_per_side,
const Real  corner_p[2][2],
const Real  corner_to_corner,
const std::vector< Real >  azimuthal_tangent = std::vector<Real>() 
) const
protectedinherited

Creates nodes for the ring-geometry region of a single slice.

Parameters
meshinput mesh to add the nodes onto
ring_radiiradii of the ring regions
ring_layersnumbers of radial intervals of the ring regions
biased_termsnormalized spacing values used for radial meshing biasing in ring regions
num_sectors_per_sidenumber of azimuthal intervals
corner_p[2][2]array contains the coordinates of the corner positions
corner_to_cornerdiameter of the circumscribed circle of the polygon
azimuthal_tangentvector of tangent values of the azimuthal angles as reference for adaptive boundary matching

Definition at line 654 of file PolygonMeshGeneratorBase.C.

662{
663 const unsigned int angle_number =
664 azimuthal_tangent.size() == 0 ? num_sectors_per_side : (azimuthal_tangent.size() - 1);
665
666 // Add nodes in pins regions
667 for (unsigned int l = 0; l < ring_layers.size(); l++)
668 {
669 // the pin radius interval for each ring_radii/subdomain
670 const Real pin_radius_interval_length =
671 l == 0 ? ring_radii[l] / ring_layers[l]
672 : (ring_radii[l] - ring_radii[l - 1]) / ring_layers[l];
673
674 // add rings in each pin subdomain
675 for (unsigned int k = 0; k < ring_layers[l]; k++)
676 {
677 const Real bin_radial_distance =
678 l == 0 ? (biased_terms[l][k] * ring_layers[l] *
679 pin_radius_interval_length) // this is from the cell/pin center to
680 // the first circle
681 : (ring_radii[l - 1] +
682 biased_terms[l][k] * ring_layers[l] * pin_radius_interval_length);
683 const Real pin_corner_p_x = corner_p[0][0] * bin_radial_distance / (0.5 * corner_to_corner);
684 const Real pin_corner_p_y = corner_p[0][1] * bin_radial_distance / (0.5 * corner_to_corner);
685
686 // pin_corner_p(s) are the points in the pin region, on the bins towards the six corners,
687 // at different intervals
688 mesh.add_point(Point(pin_corner_p_x, pin_corner_p_y, 0.0));
689
690 for (unsigned int j = 1; j <= angle_number; j++)
691 {
692 const Real cell_boundary_p_x =
693 corner_p[0][0] + (corner_p[1][0] - corner_p[0][0]) *
694 (azimuthal_tangent.size() == 0 ? ((Real)j / (Real)angle_number)
695 : (azimuthal_tangent[j] / 2.0));
696 const Real cell_boundary_p_y =
697 corner_p[0][1] + (corner_p[1][1] - corner_p[0][1]) *
698 (azimuthal_tangent.size() == 0 ? ((Real)j / (Real)angle_number)
699 : (azimuthal_tangent[j] / 2.0));
700 // cell_boundary_p(s) are the points on the cell's six boundaries (flat sides) at
701 // different azimuthal angles
702 const Real pin_azimuthal_p_x =
703 cell_boundary_p_x * bin_radial_distance /
704 std::sqrt(Utility::pow<2>(cell_boundary_p_x) + Utility::pow<2>(cell_boundary_p_y));
705 const Real pin_azimuthal_p_y =
706 cell_boundary_p_y * bin_radial_distance /
707 std::sqrt(Utility::pow<2>(cell_boundary_p_x) + Utility::pow<2>(cell_boundary_p_y));
708
709 // pin_azimuthal_p are the points on the bins towards different azimuthal angles, at
710 // different intervals; excluding the ones produced by pin_corner_p
711 mesh.add_point(Point(pin_azimuthal_p_x, pin_azimuthal_p_y, 0.0));
712 }
713 }
714 }
715}

Referenced by PolygonMeshGeneratorBase::buildSlice().

◆ setRingExtraIDs()

void PolygonMeshGeneratorBase::setRingExtraIDs ( MeshBase &  mesh,
const std::string  id_name,
const unsigned int  num_sides,
const std::vector< unsigned int num_sectors_per_side,
const std::vector< unsigned int ring_intervals,
const bool  ring_wise_id,
const bool  quad_center_elements 
)
protectedinherited

assign ring extra ids to polygon mesh

Parameters
meshinput mesh where ring extra ids are assigned
id_namering extra id name
num_sidesnumber of polygon sides
num_sectors_per_sidenumber of sectors of each side of the polygon
ring_intervalsnumber of rings in each circle
ring_wise_idwhether ring ids are assigned to each ring or to each block
quad_center_elementswhether center elements are quad or triangular

Definition at line 1636 of file PolygonMeshGeneratorBase.C.

1643{
1644 // this function assumes that elements are ordered by rings (inner) then by sectors (outer
1645 // ordering)
1646 const auto extra_id_index = mesh.add_elem_integer(id_name);
1647 auto elem_it = mesh.elements_begin();
1648 for (unsigned int is = 0; is < num_sides; ++is)
1649 {
1650 // number of elements in the current sector
1651 unsigned int nelem = mesh.n_elem() * num_sectors_per_side[is] /
1652 (accumulate(num_sectors_per_side.begin(), num_sectors_per_side.end(), 0));
1653 if (!ring_wise_id)
1654 {
1655 for (unsigned int ir : index_range(ring_intervals))
1656 {
1657 // number of elements in the current ring and sector
1658 unsigned int nelem_annular_ring = num_sectors_per_side[is] * ring_intervals[ir];
1659 // if _quad_center_elements is true, the number of elements in center ring are
1660 // _num_sectors_per_side[is] * _num_sectors_per_side[is] / 4
1661 if (quad_center_elements && ir == 0)
1662 nelem_annular_ring = num_sectors_per_side[is] * (ring_intervals[ir] - 1) +
1663 num_sectors_per_side[is] * num_sectors_per_side[is] / 4;
1664 // assign ring id
1665 for (unsigned i = 0; i < nelem_annular_ring; ++i, ++elem_it)
1666 (*elem_it)->set_extra_integer(extra_id_index, ir + 1);
1667 // update number of elements in background region of current side.
1668 nelem -= nelem_annular_ring;
1669 }
1670 }
1671 else
1672 {
1673 unsigned int ir = 0;
1674 for (unsigned int ir0 : index_range(ring_intervals))
1675 {
1676 for (unsigned int ir1 = 0; ir1 < ring_intervals[ir0]; ++ir1)
1677 {
1678 // number of elements in the current ring and sector
1679 unsigned int nelem_annular_ring = num_sectors_per_side[is];
1680 // if _quad_center_elements is true, the number of elements in center ring are
1681 // _num_sectors_per_side[is] * _num_sectors_per_side[is] / 4
1682 if (quad_center_elements && ir == 0)
1683 nelem_annular_ring = num_sectors_per_side[is] * num_sectors_per_side[is] / 4;
1684 // assign ring id
1685 for (unsigned i = 0; i < nelem_annular_ring; ++i, ++elem_it)
1686 (*elem_it)->set_extra_integer(extra_id_index, ir + 1);
1687 // update ring id
1688 ++ir;
1689 // update number of elements in background region of current side.
1690 nelem -= nelem_annular_ring;
1691 }
1692 }
1693 }
1694 // assign ring id of 0 to the background region
1695 for (unsigned i = 0; i < nelem; ++i, ++elem_it)
1696 (*elem_it)->set_extra_integer(extra_id_index, 0);
1697 }
1698}
PetscErrorCode PetscInt const PetscInt IS * is

Referenced by PolygonConcentricCircleMeshGeneratorBase::generate(), and TriPinHexAssemblyGenerator::generate().

◆ setSectorExtraIDs()

void PolygonMeshGeneratorBase::setSectorExtraIDs ( MeshBase &  mesh,
const std::string  id_name,
const unsigned int  num_sides,
const std::vector< unsigned int num_sectors_per_side 
)
protectedinherited

assign sector extra ids to polygon mesh

Parameters
meshinput mesh where sector extra ids are assigned
id_namesector extra ID name
num_sidenumber of polygon sides
num_sectors_per_sidenumber of sections of each side of the polygon

Definition at line 1611 of file PolygonMeshGeneratorBase.C.

1615{
1616 const auto extra_id_index = mesh.add_elem_integer(id_name);
1617 // vector to store sector ids for each element
1618 auto elem_it = mesh.elements_begin();
1619 unsigned int id = 1;
1620 // starting element id of the current sector
1621 for (unsigned int is = 0; is < num_sides; ++is)
1622 {
1623 // number of elements in the current sector
1624 unsigned int nelem_sector =
1625 mesh.n_elem() * num_sectors_per_side[is] /
1626 (accumulate(num_sectors_per_side.begin(), num_sectors_per_side.end(), 0));
1627 // assign sector ids to mesh
1628 for (unsigned i = 0; i < nelem_sector; ++i, ++elem_it)
1629 (*elem_it)->set_extra_integer(extra_id_index, id);
1630 // update sector id
1631 ++id;
1632 }
1633}

Referenced by PolygonConcentricCircleMeshGeneratorBase::generate(), and TriPinHexAssemblyGenerator::generate().

◆ validParams()

InputParameters PatternedCartesianMeshGenerator::validParams ( )
static

Definition at line 22 of file PatternedCartesianMeshGenerator.C.

23{
25 params.addRequiredParam<std::vector<MeshGeneratorName>>(
26 "inputs", "The names of the meshes forming the pattern.");
27 params.addRequiredRangeCheckedParam<std::vector<std::vector<unsigned int>>>(
28 "pattern",
29 "pattern>=0",
30 "A two-dimensional cartesian (square-shaped) array starting with the upper-left corner."
31 "It is composed of indexes into the inputs vector");
32 MooseEnum cartesian_pattern_boundary("none expanded", "expanded");
33 params.addParam<MooseEnum>(
34 "pattern_boundary", cartesian_pattern_boundary, "The boundary shape of the patterned mesh.");
35 params.addParam<bool>(
36 "generate_core_metadata",
37 false,
38 "A Boolean parameter that controls whether the core related metadata "
39 "is generated for other MOOSE objects such as 'MultiControlDrumFunction' or not.");
40 params.addRangeCheckedParam<unsigned int>("background_intervals",
41 3,
42 "background_intervals>0",
43 "Radial intervals in the assembly peripheral region.");
45 "square_size",
46 "square_size>0.0",
47 "Size (side length) of the outmost square boundary to be generated; this is "
48 "required only when pattern type is 'expanded'.");
49 params.addRangeCheckedParam<std::vector<Real>>(
50 "duct_sizes", "duct_sizes>0.0", "Distance(s) from center to duct(s) inner boundaries.");
51 MooseEnum duct_sizes_style("apothem radius", "apothem");
52 params.addParam<MooseEnum>("duct_sizes_style",
53 duct_sizes_style,
54 "Style in which square center to duct distance(s) is given (apothem "
55 "= center-to-face, radius = center-to-vertex).");
56 params.addRangeCheckedParam<std::vector<unsigned int>>(
57 "duct_intervals", "duct_intervals>0", "Number of meshing intervals in each enclosing duct.");
58 params.addParam<bool>("uniform_mesh_on_sides",
59 false,
60 "Whether the side elements are reorganized to have a uniform size.");
61 params.addParam<bool>("generate_control_drum_positions_file",
62 false,
63 "Whether a positions file is generated in the core mesh mode.");
64 params.addParam<bool>("assign_control_drum_id",
65 false,
66 "Whether control drum id is assigned to the mesh as an extra integer.");
67 std::string position_file_default = "positions_meta.data";
68 params.addParam<std::string>(
69 "position_file", position_file_default, "Data file name to store control drum positions.");
70 // A square pattern_boundary mesh can be used in "inputs" of `PatternedCartesianMeshGenerator`
71 // without rotation or with rotation of 90, 180, or 270 degrees.
72 params.addParam<Real>(
73 "rotate_angle",
74 0.0,
75 "Rotate the entire patterned mesh by a certain degrees that is defined here.");
77 "background_block_id",
78 "Optional customized block id for the background block in 'assembly' mode; must be provided "
79 "along with 'duct_block_ids' if 'duct_sizes' is provided.");
80 params.addParam<SubdomainName>(
81 "background_block_name",
82 "Optional customized block name for the background block in 'assembly' mode; must be "
83 "provided along with 'duct_block_names' if 'duct_sizes' is provided.");
84 params.addParam<std::vector<subdomain_id_type>>(
85 "duct_block_ids",
86 "Optional customized block ids for each duct geometry block in 'assembly' mode; must be "
87 "provided along with 'background_block_id'.");
88 params.addParam<std::vector<SubdomainName>>(
89 "duct_block_names",
90 std::vector<SubdomainName>(),
91 "Optional customized block names for each duct geometry block in 'assembly' mode; must be "
92 "provided along with 'background_block_name'.");
93 params.addRangeCheckedParam<boundary_id_type>("external_boundary_id",
94 "external_boundary_id>0",
95 "Optional customized external boundary id.");
96 params.addParam<bool>("create_inward_interface_boundaries",
97 false,
98 "Whether the inward interface boundary sidesets are created.");
99 params.addParam<bool>("create_outward_interface_boundaries",
100 true,
101 "Whether the outward interface boundary sidesets are created.");
102 params.addParam<BoundaryName>(
103 "stitching_boundary_name",
104 std::to_string(OUTER_SIDESET_ID),
105 "Name of the boundary used for stitching pins togethers and with the background region");
106 params.addParam<BoundaryName>(
107 "external_boundary_name", BoundaryName(), "Optional customized external boundary name.");
108 params.addParam<bool>("deform_non_circular_region",
109 true,
110 "Whether the non-circular region (outside the rings) can be deformed.");
111 params.addParam<std::vector<std::string>>("id_name", "List of extra integer ID set names");
112 params.addParam<std::vector<MeshGeneratorName>>(
113 "exclude_id", "Name of input meshes to be excluded in ID generation");
114 std::vector<MooseEnum> option = {MooseEnum("cell pattern manual", "cell")};
115 params.addParam<std::vector<MooseEnum>>(
116 "assign_type", option, "List of integer ID assignment types");
117 params.addParam<std::vector<std::vector<std::vector<dof_id_type>>>>(
118 "id_pattern",
119 "User-defined element IDs. A double-indexed array starting with the upper-left corner. When "
120 "providing multiple patterns, each pattern should be separated using '|'");
121 params.addParam<std::vector<std::vector<boundary_id_type>>>(
122 "interface_boundary_id_shift_pattern",
123 "User-defined shift values for each pattern cell. A double-indexed array starting with the "
124 "upper-left corner.");
125 MooseEnum quad_elem_type("QUAD4 QUAD8 QUAD9", "QUAD4");
126 params.addParam<MooseEnum>(
127 "boundary_region_element_type",
128 quad_elem_type,
129 "Type of the quadrilateral elements to be generated in the boundary region.");
130 params.addParam<bool>(
131 "allow_unused_inputs",
132 false,
133 "Whether additional input assemblies can be part of inputs without being used in lattice");
134 params.addParam<bool>(
135 "verbose_stitching",
136 false,
137 "Whether to output the number of nodes stitched when stitching pin and background meshes");
138
140 "pattern_boundary background_block_id background_block_name duct_block_ids duct_block_names "
141 "external_boundary_id external_boundary_name create_inward_interface_boundaries "
142 "create_outward_interface_boundaries boundary_region_element_type",
143 "Customized Subdomain/Boundary");
145 "generate_control_drum_positions_file assign_control_drum_id position_file", "Control Drum");
147 "background_intervals duct_intervals uniform_mesh_on_sides deform_non_circular_region",
148 "Mesh Density");
149 params.addParamNamesToGroup("id_name exclude_id assign_type id_pattern", "Reporting ID");
150 params.addClassDescription(
151 "This PatternedCartesianMeshGenerator source code assembles square meshes into a square "
152 "grid "
153 "and optionally forces the outer boundary to be square and/or adds a duct.");
154
155 return params;
156}
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
static InputParameters validParams()

Member Data Documentation

◆ _allow_unused_inputs

const bool PatternedCartesianMeshGenerator::_allow_unused_inputs
protected

Whether to allow additional assembly types to be passed to "inputs" parameter without being used in lattice.

Definition at line 101 of file PatternedCartesianMeshGenerator.h.

Referenced by PatternedCartesianMeshGenerator().

◆ _assign_control_drum_id

const bool PatternedCartesianMeshGenerator::_assign_control_drum_id
protected

Wheter control drum IDs are assigned as an extra element integer.

Definition at line 57 of file PatternedCartesianMeshGenerator.h.

Referenced by generate().

◆ _assign_types

std::vector<ReportingIDGeneratorUtils::AssignType> PatternedCartesianMeshGenerator::_assign_types
protected

reporting ID assignment type

Definition at line 87 of file PatternedCartesianMeshGenerator.h.

Referenced by addReportingIDs(), and PatternedCartesianMeshGenerator().

◆ _background_intervals

const unsigned int PatternedCartesianMeshGenerator::_background_intervals
protected

Number of radial intervals in the background region.

Definition at line 43 of file PatternedCartesianMeshGenerator.h.

Referenced by generate().

◆ _boundary_quad_elem_type

QUAD_ELEM_TYPE PatternedCartesianMeshGenerator::_boundary_quad_elem_type
protected

Type of quadrilateral elements to be generated in the periphery region.

Definition at line 99 of file PatternedCartesianMeshGenerator.h.

Referenced by addPeripheralMesh(), and generate().

◆ _create_inward_interface_boundaries

const bool PatternedCartesianMeshGenerator::_create_inward_interface_boundaries
protected

Whether inward interface boundaries are created.

Definition at line 71 of file PatternedCartesianMeshGenerator.h.

Referenced by addPeripheralMesh(), and generate().

◆ _create_outward_interface_boundaries

const bool PatternedCartesianMeshGenerator::_create_outward_interface_boundaries
protected

Whether outward interface boundaries are created.

Definition at line 73 of file PatternedCartesianMeshGenerator.h.

Referenced by addPeripheralMesh(), and generate().

◆ _deform_non_circular_region

const bool PatternedCartesianMeshGenerator::_deform_non_circular_region
protected

Whether the non-circular region (outside the rings) can be deformed.

Definition at line 75 of file PatternedCartesianMeshGenerator.h.

Referenced by generate().

◆ _duct_block_ids

const std::vector<subdomain_id_type> PatternedCartesianMeshGenerator::_duct_block_ids
protected

Subdomain IDs of the duct layers.

Definition at line 61 of file PatternedCartesianMeshGenerator.h.

Referenced by PatternedCartesianMeshGenerator().

◆ _duct_block_names

const std::vector<SubdomainName> PatternedCartesianMeshGenerator::_duct_block_names
protected

Subdomain Names of the duct layers.

Definition at line 63 of file PatternedCartesianMeshGenerator.h.

Referenced by PatternedCartesianMeshGenerator().

◆ _duct_intervals

const std::vector<unsigned int> PatternedCartesianMeshGenerator::_duct_intervals
protected

Number(s) of radial intervals of duct layer(s)

Definition at line 51 of file PatternedCartesianMeshGenerator.h.

Referenced by generate().

◆ _duct_sizes

std::vector<Real> PatternedCartesianMeshGenerator::_duct_sizes
protected

Size parameter(s) of duct(s)

Definition at line 47 of file PatternedCartesianMeshGenerator.h.

Referenced by generate(), and PatternedCartesianMeshGenerator().

◆ _duct_sizes_style

const PolygonSizeStyle PatternedCartesianMeshGenerator::_duct_sizes_style
protected

Style of the duct size parameter(s)

Definition at line 49 of file PatternedCartesianMeshGenerator.h.

Referenced by generate().

◆ _exclude_ids

std::vector<bool> PatternedCartesianMeshGenerator::_exclude_ids
protected

vector indicating which ids in the pattern to exclude (true at pattern positions to exclude)

Definition at line 91 of file PatternedCartesianMeshGenerator.h.

Referenced by addReportingIDs(), and PatternedCartesianMeshGenerator().

◆ _external_boundary_id

const boundary_id_type PatternedCartesianMeshGenerator::_external_boundary_id
protected

Boundary ID of mesh's external boundary.

Definition at line 67 of file PatternedCartesianMeshGenerator.h.

Referenced by generate().

◆ _external_boundary_name

const BoundaryName PatternedCartesianMeshGenerator::_external_boundary_name
protected

Boundary name of mesh's external boundary.

Definition at line 69 of file PatternedCartesianMeshGenerator.h.

Referenced by generate().

◆ _generate_control_drum_positions_file

const bool PatternedCartesianMeshGenerator::_generate_control_drum_positions_file
protected

Whether a text file containing control drum positions is generated.

Definition at line 55 of file PatternedCartesianMeshGenerator.h.

Referenced by generate().

◆ _generate_core_metadata

const bool PatternedCartesianMeshGenerator::_generate_core_metadata
protected

Whether a reactor core mesh with core metadata is generated.

Definition at line 41 of file PatternedCartesianMeshGenerator.h.

Referenced by generate(), and PatternedCartesianMeshGenerator().

◆ _has_assembly_duct

const bool PatternedCartesianMeshGenerator::_has_assembly_duct
protected

Whether the square pattern has external duct(s)

Definition at line 45 of file PatternedCartesianMeshGenerator.h.

Referenced by generate().

◆ _id_patterns

std::map<std::string, std::vector<std::vector<dof_id_type> > > PatternedCartesianMeshGenerator::_id_patterns
protected

hold ID patterns for each manual reporting ID. Individual ID pattern contains ID values for each pattern cell.

Definition at line 93 of file PatternedCartesianMeshGenerator.h.

Referenced by addReportingIDs(), and PatternedCartesianMeshGenerator().

◆ _input_names

const std::vector<MeshGeneratorName>& PatternedCartesianMeshGenerator::_input_names
protected

Names of input meshes.

Definition at line 35 of file PatternedCartesianMeshGenerator.h.

Referenced by generate(), and PatternedCartesianMeshGenerator().

◆ _interface_boundary_id_shift_pattern

std::vector<std::vector<boundary_id_type> > PatternedCartesianMeshGenerator::_interface_boundary_id_shift_pattern
protected

hold user-defined shift values for each pattern cell

Definition at line 97 of file PatternedCartesianMeshGenerator.h.

Referenced by generate(), and PatternedCartesianMeshGenerator().

◆ _mesh_ptrs

const std::vector<std::unique_ptr<MeshBase> *> PatternedCartesianMeshGenerator::_mesh_ptrs
protected

The input meshes.

Definition at line 33 of file PatternedCartesianMeshGenerator.h.

Referenced by generate().

◆ _pattern

const std::vector<std::vector<unsigned int> >& PatternedCartesianMeshGenerator::_pattern
protected

2D vector of the square pattern

Definition at line 37 of file PatternedCartesianMeshGenerator.h.

Referenced by addReportingIDs(), generate(), and PatternedCartesianMeshGenerator().

◆ _pattern_boundary

const MooseEnum PatternedCartesianMeshGenerator::_pattern_boundary
protected

Type of the external boundary shape.

Definition at line 39 of file PatternedCartesianMeshGenerator.h.

Referenced by addReportingIDs(), generate(), and PatternedCartesianMeshGenerator().

◆ _pattern_pitch

Real PatternedCartesianMeshGenerator::_pattern_pitch
protected

Pitch size of the input assembly mesh.

Definition at line 77 of file PatternedCartesianMeshGenerator.h.

Referenced by generate().

◆ _peripheral_block_ids

std::vector<subdomain_id_type> PatternedCartesianMeshGenerator::_peripheral_block_ids
protected

Subdomain IDs of the peripheral regions.

Definition at line 79 of file PatternedCartesianMeshGenerator.h.

Referenced by generate(), and PatternedCartesianMeshGenerator().

◆ _peripheral_block_names

std::vector<SubdomainName> PatternedCartesianMeshGenerator::_peripheral_block_names
protected

Subdomain Names of the peripheral regions.

Definition at line 81 of file PatternedCartesianMeshGenerator.h.

Referenced by generate(), and PatternedCartesianMeshGenerator().

◆ _reporting_id_names

std::vector<std::string> PatternedCartesianMeshGenerator::_reporting_id_names
protected

names of reporting ID

Definition at line 85 of file PatternedCartesianMeshGenerator.h.

Referenced by addReportingIDs(), and PatternedCartesianMeshGenerator().

◆ _rotate_angle

const Real PatternedCartesianMeshGenerator::_rotate_angle
protected

The mesh rotation angle after mesh generation.

Definition at line 59 of file PatternedCartesianMeshGenerator.h.

Referenced by generate().

◆ _stitching_boundary_name

const BoundaryName PatternedCartesianMeshGenerator::_stitching_boundary_name
protected

Name of the boundary used for stitching.

Definition at line 65 of file PatternedCartesianMeshGenerator.h.

Referenced by addPeripheralMesh(), and generate().

◆ _uniform_mesh_on_sides

const bool PatternedCartesianMeshGenerator::_uniform_mesh_on_sides
protected

Whether the nodes on the external boundary are uniformly distributed.

Definition at line 53 of file PatternedCartesianMeshGenerator.h.

Referenced by generate().

◆ _use_exclude_id

const bool PatternedCartesianMeshGenerator::_use_exclude_id
protected

flag to indicate if exclude_id is defined

Definition at line 89 of file PatternedCartesianMeshGenerator.h.

Referenced by addReportingIDs(), and PatternedCartesianMeshGenerator().

◆ _use_interface_boundary_id_shift

const bool PatternedCartesianMeshGenerator::_use_interface_boundary_id_shift
protected

whether the interface boundary ids from input meshes are shifted, using a user-defined pattern of values for each pattern cell

Definition at line 95 of file PatternedCartesianMeshGenerator.h.

Referenced by generate(), and PatternedCartesianMeshGenerator().

◆ _use_reporting_id

const bool PatternedCartesianMeshGenerator::_use_reporting_id
protected

Whether reporting ID is added to mesh.

Definition at line 83 of file PatternedCartesianMeshGenerator.h.

Referenced by generate(), and PatternedCartesianMeshGenerator().

◆ _verbose_stitching

const bool PatternedCartesianMeshGenerator::_verbose_stitching
protected

Whether the mesh stitching should be verbose.

Definition at line 103 of file PatternedCartesianMeshGenerator.h.

Referenced by addPeripheralMesh(), and generate().


The documentation for this class was generated from the following files: