17 #include "libmesh/exodusII_io.h" 18 #include "libmesh/mesh_tools.h" 19 #include "libmesh/nemesis_io.h" 20 #include "libmesh/parallel_mesh.h" 31 params.
addRequiredParam<MeshFileName>(
"file",
"The name of the mesh file to read");
35 "This is only required for certain mesh formats where " 36 "the dimension of the mesh cannot be autodetected. " 37 "In particular you must supply this for GMSH meshes. " 38 "Note: This is completely ignored for ExodusII meshes!");
39 params.
addParam<
bool>(
"clear_spline_nodes",
41 "If clear_spline_nodes=true, IsoGeometric Analyis spline nodes " 42 "and constraints are removed from an IGA mesh, after which only " 43 "C^0 Rational-Bernstein-Bezier elements will remain.");
49 :
MooseMesh(parameters), _file_name(getParam<MeshFileName>(
"file"))
54 :
MooseMesh(other_mesh), _file_name(other_mesh._file_name)
60 std::unique_ptr<MooseMesh>
69 TIME_SECTION(
"buildMesh", 2,
"Reading Mesh");
72 getMesh().set_mesh_dimension(getParam<MooseEnum>(
"dim"));
77 DistributedMesh & pmesh = cast_ref<DistributedMesh &>(
getMesh());
80 getMesh().allow_renumbering(
false);
85 bool skip_partitioning_later =
getMesh().skip_partitioning();
86 getMesh().skip_partitioning(
true);
88 getMesh().skip_partitioning(skip_partitioning_later);
101 auto exreader = std::make_shared<ExodusII_IO>(
getMesh());
105 getMesh().allow_renumbering(
false);
118 const bool skip_partitioning_later = restarting &&
getMesh().skip_partitioning();
119 const bool allow_renumbering_later = restarting &&
getMesh().allow_renumbering();
123 getMesh().skip_partitioning(
true);
124 getMesh().allow_renumbering(
false);
130 if (getParam<bool>(
"clear_spline_nodes"))
131 MeshTools::clear_spline_nodes(
getMesh());
137 getMesh().allow_renumbering(allow_renumbering_later);
138 getMesh().skip_partitioning(skip_partitioning_later);
148 getMesh().read(file_name, NULL,
false);
150 getMesh().read(file_name, NULL,
true);
static InputParameters validParams()
Typical "Moose-style" constructor and copy constructor.
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...
bool _is_nemesis
True if a Nemesis Mesh was read in.
virtual void read(const std::string &base_filename) override
virtual void buildMesh() override
Must be overridden by child classes.
static const RestartableDataMapName MESH_META_DATA
std::string _file_name
the file_name from whence this mesh came
std::unique_ptr< T > copyConstruct(const T &object)
Copy constructs the object object.
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
bool getExodusFileRestart() const
Whether or not we need to use a separate Exodus reader to read the mesh BEFORE we create the mesh...
void possiblyLoadRestartableMetaData(const RestartableDataMapName &name, const std::filesystem::path &folder_base)
Loads the restartable meta data for name if it is available with the folder base folder_base.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
bool checkFileReadable(const std::string &filename, bool check_line_endings=false, bool throw_on_unreadable=true, bool check_for_git_lfs_pointer=true)
Checks to see if a file is readable (exists and permissions)
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
MooseApp & _app
The MOOSE application this is associated with.
static std::string deduceCheckpointPath(const MooseObject &object, const std::string &file_name)
Helper for deducing a checkpoint file given the path.
FileMesh(const InputParameters ¶meters)
void read(const std::string &file_name)
static InputParameters validParams()
registerMooseObject("MooseApp", FileMesh)
void setExReaderForRestart(std::shared_ptr< libMesh::ExodusII_IO > &&exreader)
Set the Exodus reader to restart variables from an Exodus mesh file.