https://mooseframework.inl.gov
FileMesh.h
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 
10 #pragma once
11 
12 #include "MooseMesh.h"
13 
14 class FileMesh : public MooseMesh
15 {
16 public:
18 
20  FileMesh(const FileMesh & other_mesh);
21  virtual ~FileMesh(); // empty dtor required for unique_ptr with forward declarations
22 
23  virtual std::unique_ptr<MooseMesh> safeClone() const override;
24 
25  virtual void buildMesh() override;
26 
27  void read(const std::string & file_name);
28 
29  // Get/Set Filename (for meshes read from a file)
30  void setFileName(const std::string & file_name) { _file_name = file_name; }
31  virtual std::string getFileName() const override { return _file_name; }
32 
33 protected:
35  std::string _file_name;
36 
38  std::unique_ptr<libMesh::ExodusII_IO> _exreader;
39 };
virtual std::unique_ptr< MooseMesh > safeClone() const override
A safer version of the clone() method that hands back an allocated object wrapped in a smart pointer...
Definition: FileMesh.C:61
virtual void buildMesh() override
Must be overridden by child classes.
Definition: FileMesh.C:67
std::string _file_name
the file_name from whence this mesh came
Definition: FileMesh.h:35
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual ~FileMesh()
Definition: FileMesh.C:58
void setFileName(const std::string &file_name)
Definition: FileMesh.h:30
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
FileMesh(const InputParameters &parameters)
Definition: FileMesh.C:48
void read(const std::string &file_name)
Definition: FileMesh.C:145
static InputParameters validParams()
Definition: FileMesh.C:28
std::unique_ptr< libMesh::ExodusII_IO > _exreader
Auxiliary object for restart.
Definition: FileMesh.h:38
const InputParameters & parameters() const
Get the parameters of the object.
virtual std::string getFileName() const override
Returns the name of the mesh file read to produce this mesh if any or an empty string otherwise...
Definition: FileMesh.h:31