Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #include "CartesianConcentricCircleAdaptiveBoundaryMeshGenerator.h" 11 : 12 : #include <cmath> 13 : 14 : registerMooseObject("ReactorApp", CartesianConcentricCircleAdaptiveBoundaryMeshGenerator); 15 : 16 : InputParameters 17 164 : CartesianConcentricCircleAdaptiveBoundaryMeshGenerator::validParams() 18 : { 19 164 : InputParameters params = PolygonConcentricCircleMeshGeneratorBase::validParams(); 20 328 : params.addRequiredRangeCheckedParam<Real>( 21 : "square_size", "square_size>0.0", "Size (side length) of the square mesh to be generated."); 22 328 : MooseEnum square_size_style("apothem radius", "apothem"); 23 164 : params.setParameters<MooseEnum>("square_size_style", square_size_style); 24 164 : params.suppressParameter<MooseEnum>("square_size_style"); 25 328 : params.addParam<std::vector<unsigned int>>( 26 : "sides_to_adapt", 27 : "List of the square reference side indices that correspond to the sides that need adaptive " 28 : "meshing. The meshes to adapt these sides to are provided in 'inputs'."); 29 328 : params.addParam<std::vector<MeshGeneratorName>>("meshes_to_adapt_to", 30 : "The name list of the input meshes to adapt to."); 31 328 : params.addParam<bool>("is_control_drum", 32 328 : false, 33 : "Whether this mesh is for a control drum. The value can be set as 'false' " 34 : "if the user wants to use this object for other components."); 35 164 : params.setParameters<bool>("flat_side_up", true); 36 164 : params.setParameters<bool>("uniform_mesh_on_sides", false); 37 164 : params.setParameters<bool>("quad_center_elements", false); 38 164 : params.setParameters<unsigned int>("smoothing_max_it", 0); 39 164 : params.suppressParameter<bool>("flat_side_up"); 40 164 : params.suppressParameter<bool>("uniform_mesh_on_sides"); 41 164 : params.suppressParameter<bool>("quad_center_elements"); 42 164 : params.suppressParameter<unsigned int>("smoothing_max_it"); 43 164 : params.suppressParameter<Real>("center_quad_factor"); 44 328 : params.addParamNamesToGroup("is_control_drum", "Control Drum"); 45 164 : params.addClassDescription( 46 : "This CartesianConcentricCircleAdaptiveBoundaryMeshGenerator object is designed to generate " 47 : "square meshes with adaptive boundary to facilitate stitching."); 48 : 49 164 : return params; 50 164 : } 51 : 52 83 : CartesianConcentricCircleAdaptiveBoundaryMeshGenerator:: 53 83 : CartesianConcentricCircleAdaptiveBoundaryMeshGenerator(const InputParameters & parameters) 54 : : PolygonConcentricCircleMeshGeneratorBase(parameters), 55 239 : _input_names(isParamValid("meshes_to_adapt_to") 56 83 : ? getParam<std::vector<MeshGeneratorName>>("meshes_to_adapt_to") 57 83 : : std::vector<MeshGeneratorName>()) 58 : { 59 83 : if (_sides_to_adapt.size() != _input_names.size()) 60 2 : paramError("sides_to_adapt", 61 : "This parameter and meshes_to_adapt_to must have the same length."); 62 162 : if (isParamValid("meshes_to_adapt_to")) 63 152 : _input_ptrs = getMeshes("meshes_to_adapt_to"); 64 162 : _is_control_drum_meta = getParam<bool>("is_control_drum"); 65 81 : _is_general_polygon = false; 66 81 : }