LCOV - code coverage report
Current view: top level - src/meshgenerators - SCMDetailedTriPinMeshGenerator.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #31405 (292dce) with base fef103 Lines: 22 24 91.7 %
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 "SCMDetailedTriPinMeshGenerator.h"
      11             : #include "TriSubChannelMesh.h"
      12             : #include "libmesh/cell_prism6.h"
      13             : 
      14             : registerMooseObject("SubChannelApp", SCMDetailedTriPinMeshGenerator);
      15             : registerMooseObjectRenamed("SubChannelApp",
      16             :                            DetailedTriPinMeshGenerator,
      17             :                            "06/30/2025 24:00",
      18             :                            SCMDetailedTriPinMeshGenerator);
      19             : 
      20             : InputParameters
      21          18 : SCMDetailedTriPinMeshGenerator::validParams()
      22             : {
      23          18 :   InputParameters params = DetailedPinMeshGeneratorBase::validParams();
      24          18 :   params.addClassDescription(
      25             :       "Creates a detailed mesh of fuel pins in a triangular lattice arrangement");
      26          36 :   params.addRequiredParam<MeshGeneratorName>("input", "The corresponding subchannel mesh");
      27          36 :   params.addRequiredParam<unsigned int>("nrings", "Number of fuel Pin rings per assembly [-]");
      28          18 :   return params;
      29           0 : }
      30             : 
      31           9 : SCMDetailedTriPinMeshGenerator::SCMDetailedTriPinMeshGenerator(const InputParameters & parameters)
      32             :   : DetailedPinMeshGeneratorBase(parameters),
      33           9 :     _input(getMesh("input")),
      34          27 :     _n_rings(getParam<unsigned int>("nrings"))
      35             : {
      36           9 : }
      37             : 
      38             : std::unique_ptr<MeshBase>
      39           9 : SCMDetailedTriPinMeshGenerator::generate()
      40             : {
      41           9 :   std::unique_ptr<MeshBase> mesh_base = std::move(_input);
      42           9 :   if (!mesh_base)
      43           0 :     mesh_base = buildMeshBaseObject();
      44           9 :   mesh_base->set_mesh_dimension(3);
      45             : 
      46             :   std::vector<Point> pin_centers;
      47           9 :   TriSubChannelMesh::rodPositions(pin_centers, _n_rings, _pitch, Point(0, 0));
      48             : 
      49           9 :   _elem_id = mesh_base->n_elem();
      50         180 :   for (auto & ctr : pin_centers)
      51         171 :     generatePin(mesh_base, ctr);
      52             : 
      53           9 :   mesh_base->subdomain_name(_block_id) = name();
      54           9 :   mesh_base->prepare_for_use();
      55             : 
      56           9 :   return mesh_base;
      57           9 : }

Generated by: LCOV version 1.14