LCOV - code coverage report
Current view: top level - src/meshgenerators - SCMDetailedQuadPinMeshGenerator.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #31405 (292dce) with base fef103 Lines: 24 26 92.3 %
Date: 2025-09-04 07:58:06 Functions: 3 3 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 "SCMDetailedQuadPinMeshGenerator.h"
      11             : #include "QuadSubChannelMesh.h"
      12             : #include "libmesh/cell_prism6.h"
      13             : 
      14             : registerMooseObject("SubChannelApp", SCMDetailedQuadPinMeshGenerator);
      15             : registerMooseObjectRenamed("SubChannelApp",
      16             :                            DetailedQuadPinMeshGenerator,
      17             :                            "06/30/2025 24:00",
      18             :                            SCMDetailedQuadPinMeshGenerator);
      19             : 
      20             : InputParameters
      21          50 : SCMDetailedQuadPinMeshGenerator::validParams()
      22             : {
      23          50 :   InputParameters params = DetailedPinMeshGeneratorBase::validParams();
      24          50 :   params.addClassDescription(
      25             :       "Creates a detailed mesh of fuel pins in a square lattice arrangement");
      26         100 :   params.addRequiredParam<MeshGeneratorName>("input", "The corresponding subchannel mesh");
      27         100 :   params.addRequiredParam<unsigned int>("nx", "Number of channels in the x direction [-]");
      28         100 :   params.addRequiredParam<unsigned int>("ny", "Number of channels in the y direction [-]");
      29          50 :   return params;
      30           0 : }
      31             : 
      32          25 : SCMDetailedQuadPinMeshGenerator::SCMDetailedQuadPinMeshGenerator(const InputParameters & parameters)
      33             :   : DetailedPinMeshGeneratorBase(parameters),
      34          25 :     _input(getMesh("input")),
      35          50 :     _nx(getParam<unsigned int>("nx")),
      36          75 :     _ny(getParam<unsigned int>("ny"))
      37             : {
      38          25 : }
      39             : 
      40             : std::unique_ptr<MeshBase>
      41          25 : SCMDetailedQuadPinMeshGenerator::generate()
      42             : {
      43          25 :   std::unique_ptr<MeshBase> mesh_base = std::move(_input);
      44          25 :   if (!mesh_base)
      45           0 :     mesh_base = buildMeshBaseObject();
      46          25 :   mesh_base->set_mesh_dimension(3);
      47             : 
      48             :   std::vector<Point> pin_centers;
      49          25 :   QuadSubChannelMesh::generatePinCenters(_nx, _ny, _pitch, 0, pin_centers);
      50             : 
      51          25 :   _elem_id = mesh_base->n_elem();
      52         161 :   for (auto & ctr : pin_centers)
      53         136 :     generatePin(mesh_base, ctr);
      54             : 
      55          25 :   mesh_base->subdomain_name(_block_id) = name();
      56          25 :   mesh_base->prepare_for_use();
      57             : 
      58          25 :   return mesh_base;
      59          25 : }

Generated by: LCOV version 1.14