LCOV - code coverage report
Current view: top level - src/components - HeatStructureFromFile3D.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #31405 (292dce) with base fef103 Lines: 33 34 97.1 %
Date: 2025-09-04 07:58:41 Functions: 8 8 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 "HeatStructureFromFile3D.h"
      11             : #include "libmesh/exodusII_io.h"
      12             : #include "libmesh/exodusII_io_helper.h"
      13             : 
      14             : registerMooseObject("ThermalHydraulicsApp", HeatStructureFromFile3D);
      15             : 
      16             : InputParameters
      17         394 : HeatStructureFromFile3D::validParams()
      18             : {
      19         394 :   InputParameters params = FileMeshComponent::validParams();
      20         394 :   params += HeatStructureInterface::validParams();
      21             : 
      22         394 :   params.addClassDescription("Heat structure component that loads a 3D mesh from an ExodusII file");
      23             : 
      24         394 :   return params;
      25           0 : }
      26             : 
      27         197 : HeatStructureFromFile3D::HeatStructureFromFile3D(const InputParameters & params)
      28         197 :   : FileMeshComponent(params), HeatStructureInterface(this)
      29             : {
      30         197 :   if (_file_is_readable)
      31             :   {
      32         197 :     libMesh::ExodusII_IO_Helper exio_helper(*this, false, true, false);
      33         197 :     exio_helper.open(_file_name.c_str(), true);
      34         197 :     exio_helper.read_and_store_header_info();
      35         197 :     if (exio_helper.num_dim != 3)
      36           2 :       logError("File '", _file_name, "' does not contain a 3D mesh.");
      37         197 :   }
      38         197 : }
      39             : 
      40             : bool
      41          16 : HeatStructureFromFile3D::hasRegion(const std::string & name) const
      42             : {
      43          16 :   checkSetupStatus(MESH_PREPARED);
      44             : 
      45          16 :   return std::find(_region_names.begin(), _region_names.end(), name) != _region_names.end();
      46             : }
      47             : 
      48             : void
      49         197 : HeatStructureFromFile3D::setupMesh()
      50             : {
      51         197 :   _region_names = buildMesh();
      52         197 : }
      53             : 
      54             : void
      55         197 : HeatStructureFromFile3D::init()
      56             : {
      57             :   FileMeshComponent::init();
      58         197 :   HeatStructureInterface::init();
      59         197 : }
      60             : 
      61             : void
      62         192 : HeatStructureFromFile3D::check() const
      63             : {
      64             :   FileMeshComponent::check();
      65         192 :   HeatStructureInterface::check();
      66         192 : }
      67             : 
      68             : void
      69         167 : HeatStructureFromFile3D::addVariables()
      70             : {
      71         167 :   HeatStructureInterface::addVariables();
      72         167 : }
      73             : 
      74             : void
      75         167 : HeatStructureFromFile3D::addMooseObjects()
      76             : {
      77         167 :   HeatStructureInterface::addMooseObjects();
      78         167 : }

Generated by: LCOV version 1.14