https://mooseframework.inl.gov
HeatStructureFromFile3D.C
Go to the documentation of this file.
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 
11 #include "libmesh/exodusII_io.h"
12 #include "libmesh/exodusII_io_helper.h"
13 
14 registerMooseObject("ThermalHydraulicsApp", HeatStructureFromFile3D);
15 
18 {
21 
22  params.addClassDescription("Heat structure component that loads a 3D mesh from an ExodusII file");
23 
24  return params;
25 }
26 
29 {
31  {
32  libMesh::ExodusII_IO_Helper exio_helper(*this, false, true, false);
33  exio_helper.open(_file_name.c_str(), true);
34  exio_helper.read_and_store_header_info();
35  if (exio_helper.num_dim != 3)
36  logError("File '", _file_name, "' does not contain a 3D mesh.");
37  }
38 }
39 
40 bool
41 HeatStructureFromFile3D::hasRegion(const std::string & name) const
42 {
44 
45  return std::find(_region_names.begin(), _region_names.end(), name) != _region_names.end();
46 }
47 
48 void
50 {
52 }
53 
54 void
56 {
59 }
60 
61 void
63 {
66 }
67 
68 void
70 {
72 }
73 
74 void
76 {
78 }
Heat structure component that loads the mesh from an ExodusII file.
registerMooseObject("ThermalHydraulicsApp", HeatStructureFromFile3D)
static InputParameters validParams()
std::vector< std::string > _region_names
Region names.
virtual void addMooseObjects() override
virtual void setupMesh() override
Performs mesh setup such as creating mesh or naming mesh sets.
virtual const std::string & name() const
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
virtual void check() const
Check the component integrity.
Definition: Component.h:301
void open(const char *filename, bool read_only)
virtual void init() override
Initializes the component.
void check() const
Method to be called in the component&#39;s check() method.
bool hasRegion(const std::string &region) const
Has the given region?
Loads a mesh from an ExodusII file without adding physics.
const bool _file_is_readable
Is the file readable?
const std::string name
Definition: Setup.h:20
const FileName & _file_name
The name of the ExodusII file to load the mesh from.
static InputParameters validParams()
virtual void init()
Initializes the component.
Definition: Component.h:290
Interface class for heat structure components.
virtual void addVariables() override
void checkSetupStatus(const EComponentSetupStatus &status) const
Throws an error if the supplied setup status of this component has not been reached.
Definition: Component.C:117
HeatStructureFromFile3D(const InputParameters &params)
void init()
Method to be called in the component&#39;s init() method.
void addMooseObjects()
Method to be called in the component&#39;s addMooseObjects() method.
void addVariables()
Method to be called in the component&#39;s addVariables() method.
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
std::vector< std::string > buildMesh()
Loads the ExodusII file into the global mesh and returns the subdomain names (before prepending compo...
virtual void check() const override
Check the component integrity.