LCOV - code coverage report
Current view: top level - src/meshgenerators - HexagonConcentricCircleAdaptiveBoundaryMeshGenerator.C (source / functions) Hit Total Coverage
Test: idaholab/moose reactor: #31405 (292dce) with base fef103 Lines: 38 38 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 "HexagonConcentricCircleAdaptiveBoundaryMeshGenerator.h"
      11             : 
      12             : #include <cmath>
      13             : 
      14             : registerMooseObject("ReactorApp", HexagonConcentricCircleAdaptiveBoundaryMeshGenerator);
      15             : 
      16             : InputParameters
      17         620 : HexagonConcentricCircleAdaptiveBoundaryMeshGenerator::validParams()
      18             : {
      19         620 :   InputParameters params = PolygonConcentricCircleMeshGeneratorBase::validParams();
      20        1240 :   params.addRequiredRangeCheckedParam<Real>(
      21             :       "hexagon_size", "hexagon_size>0.0", "Size of the hexagon to be generated.");
      22        1240 :   MooseEnum hexagon_size_style("apothem radius", "apothem");
      23        1240 :   params.addParam<MooseEnum>(
      24             :       "hexagon_size_style",
      25             :       hexagon_size_style,
      26             :       "Style in which the hexagon size is given (default: apothem i.e. half-pitch).");
      27        1240 :   params.addParam<std::vector<unsigned int>>(
      28             :       "sides_to_adapt",
      29             :       "List of the hexagon reference side indices that correspond to the sides that need adaptive "
      30             :       "meshing. The meshes to adapt these sides to are provided in 'inputs'.");
      31        1240 :   params.addDeprecatedParam<std::vector<MeshGeneratorName>>(
      32             :       "inputs",
      33             :       "The name list of the input meshes to adapt to.",
      34             :       "Deprecated parameter, please use 'meshes_to_adapt_to' instead.");
      35        1240 :   params.addParam<std::vector<MeshGeneratorName>>("meshes_to_adapt_to",
      36             :                                                   "The name list of the input meshes to adapt to.");
      37        1240 :   params.addParam<bool>("is_control_drum",
      38        1240 :                         false,
      39             :                         "Whether this mesh is for a control drum. The value can be set as 'false' "
      40             :                         "if the user wants to use this object for other components.");
      41         620 :   params.setParameters<bool>("uniform_mesh_on_sides", false);
      42         620 :   params.setParameters<bool>("quad_center_elements", false);
      43         620 :   params.setParameters<unsigned int>("smoothing_max_it", 0);
      44         620 :   params.suppressParameter<bool>("uniform_mesh_on_sides");
      45         620 :   params.suppressParameter<bool>("quad_center_elements");
      46         620 :   params.suppressParameter<unsigned int>("smoothing_max_it");
      47         620 :   params.suppressParameter<Real>("center_quad_factor");
      48        1240 :   params.addParamNamesToGroup("is_control_drum", "Control Drum");
      49         620 :   params.addClassDescription(
      50             :       "This HexagonConcentricCircleAdaptiveBoundaryMeshGenerator object is designed to generate "
      51             :       "hexagonal meshes with adaptive boundary to facilitate stitching.");
      52             : 
      53         620 :   return params;
      54         620 : }
      55             : 
      56         312 : HexagonConcentricCircleAdaptiveBoundaryMeshGenerator::
      57         312 :     HexagonConcentricCircleAdaptiveBoundaryMeshGenerator(const InputParameters & parameters)
      58             :   : PolygonConcentricCircleMeshGeneratorBase(parameters),
      59         931 :     _input_names(isParamValid("meshes_to_adapt_to")
      60         312 :                      ? getParam<std::vector<MeshGeneratorName>>("meshes_to_adapt_to")
      61         867 :                      : (isParamValid("inputs") ? getParam<std::vector<MeshGeneratorName>>("inputs")
      62         312 :                                                : std::vector<MeshGeneratorName>()))
      63             : {
      64         312 :   if (_sides_to_adapt.size() != _input_names.size())
      65           2 :     paramError("sides_to_adapt",
      66             :                "This parameter and meshes_to_adapt_to must have the same length.");
      67         984 :   if (isParamValid("inputs") && isParamValid("meshes_to_adapt_to"))
      68           2 :     paramError("inputs",
      69             :                "this parameter is deprecated; it cannot be provided along with the new parameter "
      70             :                "'meshes_to_adapt_to'.");
      71         616 :   if (isParamValid("inputs"))
      72         360 :     _input_ptrs = getMeshes("inputs");
      73         256 :   else if (isParamValid("meshes_to_adapt_to"))
      74         246 :     _input_ptrs = getMeshes("meshes_to_adapt_to");
      75         616 :   _is_control_drum_meta = getParam<bool>("is_control_drum");
      76         308 :   _is_general_polygon = false;
      77         308 : }

Generated by: LCOV version 1.14