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

Generated by: LCOV version 1.14