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 286 : HeatStructureFromFile3D::validParams() 18 : { 19 286 : InputParameters params = FileMeshComponent::validParams(); 20 286 : params += HeatStructureInterface::validParams(); 21 : 22 286 : params.addClassDescription("Heat structure component that loads a 3D mesh from an ExodusII file"); 23 : 24 286 : return params; 25 0 : } 26 : 27 143 : HeatStructureFromFile3D::HeatStructureFromFile3D(const InputParameters & params) 28 143 : : FileMeshComponent(params), HeatStructureInterface(this) 29 : { 30 143 : if (_file_is_readable) 31 : { 32 143 : libMesh::ExodusII_IO_Helper exio_helper(*this, false, true, false); 33 143 : exio_helper.open(_file_name.c_str(), true); 34 143 : exio_helper.read_and_store_header_info(); 35 143 : if (exio_helper.num_dim != 3) 36 2 : logError("File '", _file_name, "' does not contain a 3D mesh."); 37 143 : } 38 143 : } 39 : 40 : bool 41 12 : HeatStructureFromFile3D::hasRegion(const std::string & name) const 42 : { 43 12 : checkSetupStatus(MESH_PREPARED); 44 : 45 12 : return std::find(_region_names.begin(), _region_names.end(), name) != _region_names.end(); 46 : } 47 : 48 : void 49 143 : HeatStructureFromFile3D::setupMesh() 50 : { 51 143 : _region_names = buildMesh(); 52 143 : } 53 : 54 : void 55 143 : HeatStructureFromFile3D::init() 56 : { 57 : FileMeshComponent::init(); 58 143 : HeatStructureInterface::init(); 59 143 : } 60 : 61 : void 62 140 : HeatStructureFromFile3D::check() const 63 : { 64 : FileMeshComponent::check(); 65 140 : HeatStructureInterface::check(); 66 140 : } 67 : 68 : void 69 113 : HeatStructureFromFile3D::addVariables() 70 : { 71 113 : HeatStructureInterface::addVariables(); 72 113 : } 73 : 74 : void 75 113 : HeatStructureFromFile3D::addMooseObjects() 76 : { 77 113 : HeatStructureInterface::addMooseObjects(); 78 113 : }