LCOV - code coverage report
Current view: top level - src/meshgenerators - CartesianConcentricCircleAdaptiveBoundaryMeshGenerator.C (source / functions) Hit Total Coverage
Test: idaholab/moose reactor: #31405 (292dce) with base fef103 Lines: 35 35 100.0 %
Date: 2025-09-04 07:56:24 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          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         196 : CartesianConcentricCircleAdaptiveBoundaryMeshGenerator::validParams()
      18             : {
      19         196 :   InputParameters params = PolygonConcentricCircleMeshGeneratorBase::validParams();
      20         392 :   params.addRequiredRangeCheckedParam<Real>(
      21             :       "square_size", "square_size>0.0", "Size (side length) of the square mesh to be generated.");
      22         392 :   MooseEnum square_size_style("apothem radius", "apothem");
      23         196 :   params.setParameters<MooseEnum>("square_size_style", square_size_style);
      24         196 :   params.suppressParameter<MooseEnum>("square_size_style");
      25         392 :   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         392 :   params.addParam<std::vector<MeshGeneratorName>>("meshes_to_adapt_to",
      30             :                                                   "The name list of the input meshes to adapt to.");
      31         392 :   params.addParam<bool>("is_control_drum",
      32         392 :                         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         196 :   params.setParameters<bool>("flat_side_up", true);
      36         196 :   params.setParameters<bool>("uniform_mesh_on_sides", false);
      37         196 :   params.setParameters<bool>("quad_center_elements", false);
      38         196 :   params.setParameters<unsigned int>("smoothing_max_it", 0);
      39         196 :   params.suppressParameter<bool>("flat_side_up");
      40         196 :   params.suppressParameter<bool>("uniform_mesh_on_sides");
      41         196 :   params.suppressParameter<bool>("quad_center_elements");
      42         196 :   params.suppressParameter<unsigned int>("smoothing_max_it");
      43         196 :   params.suppressParameter<Real>("center_quad_factor");
      44         392 :   params.addParamNamesToGroup("is_control_drum", "Control Drum");
      45         196 :   params.addClassDescription(
      46             :       "This CartesianConcentricCircleAdaptiveBoundaryMeshGenerator object is designed to generate "
      47             :       "square meshes with adaptive boundary to facilitate stitching.");
      48             : 
      49         196 :   return params;
      50         196 : }
      51             : 
      52          99 : CartesianConcentricCircleAdaptiveBoundaryMeshGenerator::
      53          99 :     CartesianConcentricCircleAdaptiveBoundaryMeshGenerator(const InputParameters & parameters)
      54             :   : PolygonConcentricCircleMeshGeneratorBase(parameters),
      55         287 :     _input_names(isParamValid("meshes_to_adapt_to")
      56          99 :                      ? getParam<std::vector<MeshGeneratorName>>("meshes_to_adapt_to")
      57          99 :                      : std::vector<MeshGeneratorName>())
      58             : {
      59          99 :   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         194 :   if (isParamValid("meshes_to_adapt_to"))
      63         184 :     _input_ptrs = getMeshes("meshes_to_adapt_to");
      64         194 :   _is_control_drum_meta = getParam<bool>("is_control_drum");
      65          97 :   _is_general_polygon = false;
      66          97 : }

Generated by: LCOV version 1.14