LCOV - code coverage report
Current view: top level - src/meshgenerators - HexagonConcentricCircleAdaptiveBoundaryMeshGenerator.C (source / functions) Hit Total Coverage
Test: idaholab/moose reactor: #32971 (54bef8) with base c6cf66 Lines: 38 38 100.0 %
Date: 2026-05-29 20:39: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         488 : HexagonConcentricCircleAdaptiveBoundaryMeshGenerator::validParams()
      18             : {
      19         488 :   InputParameters params = PolygonConcentricCircleMeshGeneratorBase::validParams();
      20         976 :   params.addRequiredRangeCheckedParam<Real>(
      21             :       "hexagon_size", "hexagon_size>0.0", "Size of the hexagon to be generated.");
      22         976 :   MooseEnum hexagon_size_style("apothem radius", "apothem");
      23         976 :   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         976 :   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         976 :   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         976 :   params.addParam<std::vector<MeshGeneratorName>>("meshes_to_adapt_to",
      36             :                                                   "The name list of the input meshes to adapt to.");
      37         976 :   params.addParam<bool>("is_control_drum",
      38         976 :                         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         488 :   params.setParameters<bool>("uniform_mesh_on_sides", false);
      42         488 :   params.setParameters<bool>("quad_center_elements", false);
      43         488 :   params.setParameters<unsigned int>("smoothing_max_it", 0);
      44         488 :   params.suppressParameter<bool>("uniform_mesh_on_sides");
      45         488 :   params.suppressParameter<bool>("quad_center_elements");
      46         488 :   params.suppressParameter<unsigned int>("smoothing_max_it");
      47         488 :   params.suppressParameter<Real>("center_quad_factor");
      48         976 :   params.addParamNamesToGroup("is_control_drum", "Control Drum");
      49         488 :   params.addClassDescription(
      50             :       "This HexagonConcentricCircleAdaptiveBoundaryMeshGenerator object is designed to generate "
      51             :       "hexagonal meshes with adaptive boundary to facilitate stitching.");
      52             : 
      53         488 :   return params;
      54         488 : }
      55             : 
      56         246 : HexagonConcentricCircleAdaptiveBoundaryMeshGenerator::
      57         246 :     HexagonConcentricCircleAdaptiveBoundaryMeshGenerator(const InputParameters & parameters)
      58             :   : PolygonConcentricCircleMeshGeneratorBase(parameters),
      59         733 :     _input_names(isParamValid("meshes_to_adapt_to")
      60         246 :                      ? getParam<std::vector<MeshGeneratorName>>("meshes_to_adapt_to")
      61         657 :                      : (isParamValid("inputs") ? getParam<std::vector<MeshGeneratorName>>("inputs")
      62         246 :                                                : std::vector<MeshGeneratorName>()))
      63             : {
      64         246 :   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         756 :   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         484 :   if (isParamValid("inputs"))
      72         264 :     _input_ptrs = getMeshes("inputs");
      73         220 :   else if (isParamValid("meshes_to_adapt_to"))
      74         210 :     _input_ptrs = getMeshes("meshes_to_adapt_to");
      75         484 :   _is_control_drum_meta = getParam<bool>("is_control_drum");
      76         242 :   _is_general_polygon = false;
      77         242 : }

Generated by: LCOV version 1.14