https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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
40bool
41HeatStructureFromFile3D::hasRegion(const std::string & name) const
42{
44
45 return std::find(_region_names.begin(), _region_names.end(), name) != _region_names.end();
46}
47
48void
53
54void
60
61void
67
68void
73
74void
registerMooseObject("ThermalHydraulicsApp", HeatStructureFromFile3D)
const std::string name
Definition Setup.h:21
virtual void init()
Initializes the component.
Definition Component.h:405
void logError(Args &&... args) const
Logs an error.
Definition Component.h:226
virtual void check() const
Check the component integrity.
Definition Component.h:416
@ MESH_PREPARED
mesh set up
Definition Component.h:40
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
Loads a mesh from an ExodusII file without adding physics.
const FileName & _file_name
The name of the ExodusII file to load the mesh from.
std::vector< std::string > buildMesh()
Loads the ExodusII file into the global mesh and returns the subdomain names (before prepending compo...
static InputParameters validParams()
const bool _file_is_readable
Is the file readable?
Heat structure component that loads the mesh from an ExodusII file.
static InputParameters validParams()
virtual void addVariables() override
virtual void check() const override
Check the component integrity.
virtual void addMooseObjects() override
bool hasRegion(const std::string &region) const
Has the given region?
HeatStructureFromFile3D(const InputParameters &params)
virtual void init() override
Initializes the component.
virtual void setupMesh() override
Performs mesh setup such as creating mesh or naming mesh sets.
std::vector< std::string > _region_names
Region names.
Interface class for heat structure components.
void addMooseObjects()
Method to be called in the component's addMooseObjects() method.
void check() const
Method to be called in the component's check() method.
void init()
Method to be called in the component's init() method.
void addVariables()
Method to be called in the component's addVariables() method.
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
void open(const char *filename, bool read_only)