LCOV - code coverage report
Current view: top level - src/components - HeatStructureFromFile3D.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 33 34 97.1 %
Date: 2025-07-30 13:02:48 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         392 : HeatStructureFromFile3D::validParams()
      18             : {
      19         392 :   InputParameters params = FileMeshComponent::validParams();
      20         392 :   params += HeatStructureInterface::validParams();
      21             : 
      22         392 :   params.addClassDescription("Heat structure component that loads a 3D mesh from an ExodusII file");
      23             : 
      24         392 :   return params;
      25           0 : }
      26             : 
      27         196 : HeatStructureFromFile3D::HeatStructureFromFile3D(const InputParameters & params)
      28         196 :   : FileMeshComponent(params), HeatStructureInterface(this)
      29             : {
      30         196 :   if (_file_is_readable)
      31             :   {
      32         196 :     libMesh::ExodusII_IO_Helper exio_helper(*this, false, true, false);
      33         196 :     exio_helper.open(_file_name.c_str(), true);
      34         196 :     exio_helper.read_and_store_header_info();
      35         196 :     if (exio_helper.num_dim != 3)
      36           2 :       logError("File '", _file_name, "' does not contain a 3D mesh.");
      37         196 :   }
      38         196 : }
      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         196 : HeatStructureFromFile3D::setupMesh()
      50             : {
      51         196 :   _region_names = buildMesh();
      52         196 : }
      53             : 
      54             : void
      55         196 : HeatStructureFromFile3D::init()
      56             : {
      57             :   FileMeshComponent::init();
      58         196 :   HeatStructureInterface::init();
      59         196 : }
      60             : 
      61             : void
      62         191 : HeatStructureFromFile3D::check() const
      63             : {
      64             :   FileMeshComponent::check();
      65         191 :   HeatStructureInterface::check();
      66         191 : }
      67             : 
      68             : void
      69         166 : HeatStructureFromFile3D::addVariables()
      70             : {
      71         166 :   HeatStructureInterface::addVariables();
      72         166 : }
      73             : 
      74             : void
      75         166 : HeatStructureFromFile3D::addMooseObjects()
      76             : {
      77         166 :   HeatStructureInterface::addMooseObjects();
      78         166 : }

Generated by: LCOV version 1.14