LCOV - code coverage report
Current view: top level - src/meshgenerators - SCMDetailedQuadPinMeshGenerator.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #32971 (54bef8) with base c6cf66 Lines: 24 26 92.3 %
Date: 2026-05-29 20:40:47 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             : 
      16             : InputParameters
      17          44 : SCMDetailedQuadPinMeshGenerator::validParams()
      18             : {
      19          44 :   InputParameters params = DetailedPinMeshGeneratorBase::validParams();
      20          44 :   params.addClassDescription(
      21             :       "Creates a detailed mesh of fuel pins in a square lattice arrangement");
      22          88 :   params.addRequiredParam<MeshGeneratorName>("input", "The corresponding subchannel mesh");
      23          88 :   params.addRequiredParam<unsigned int>("nx", "Number of channels in the x direction [-]");
      24          88 :   params.addRequiredParam<unsigned int>("ny", "Number of channels in the y direction [-]");
      25          44 :   return params;
      26           0 : }
      27             : 
      28          22 : SCMDetailedQuadPinMeshGenerator::SCMDetailedQuadPinMeshGenerator(const InputParameters & parameters)
      29             :   : DetailedPinMeshGeneratorBase(parameters),
      30          22 :     _input(getMesh("input")),
      31          44 :     _nx(getParam<unsigned int>("nx")),
      32          66 :     _ny(getParam<unsigned int>("ny"))
      33             : {
      34          22 : }
      35             : 
      36             : std::unique_ptr<MeshBase>
      37          22 : SCMDetailedQuadPinMeshGenerator::generate()
      38             : {
      39          22 :   std::unique_ptr<MeshBase> mesh_base = std::move(_input);
      40          22 :   if (!mesh_base)
      41           0 :     mesh_base = buildMeshBaseObject();
      42          22 :   mesh_base->set_mesh_dimension(3);
      43             : 
      44             :   std::vector<Point> pin_centers;
      45          22 :   QuadSubChannelMesh::generatePinCenters(_nx, _ny, _pitch, 0, pin_centers);
      46             : 
      47          22 :   _elem_id = mesh_base->n_elem();
      48         146 :   for (auto & ctr : pin_centers)
      49         124 :     generatePin(mesh_base, ctr);
      50             : 
      51          22 :   mesh_base->subdomain_name(_block_id) = name();
      52          22 :   mesh_base->prepare_for_use();
      53             : 
      54          22 :   return mesh_base;
      55          22 : }

Generated by: LCOV version 1.14