17 #include "libmesh/exodusII_io.h" 18 #include "libmesh/mesh_tools.h" 19 #include "libmesh/nemesis_io.h" 20 #include "libmesh/parallel_mesh.h" 28 params.
addRequiredParam<MeshFileName>(
"file",
"The name of the mesh file to read");
29 params.
addParam<
bool>(
"clear_spline_nodes",
31 "If clear_spline_nodes=true, IsoGeometric Analyis spline nodes " 32 "and constraints are removed from an IGA mesh, after which only " 33 "C^0 Rational-Bernstein-Bezier elements will remain.");
40 _file_name(getParam<MeshFileName>(
"file")),
46 :
MooseMesh(other_mesh), _file_name(other_mesh._file_name), _dim(other_mesh._dim)
52 std::unique_ptr<MooseMesh>
55 return std::make_unique<FileMesh>(*this);
61 TIME_SECTION(
"buildMesh", 2,
"Reading Mesh");
63 getMesh().set_mesh_dimension(getParam<MooseEnum>(
"dim"));
68 DistributedMesh & pmesh = cast_ref<DistributedMesh &>(
getMesh());
71 getMesh().allow_renumbering(
false);
76 bool skip_partitioning_later =
getMesh().skip_partitioning();
77 getMesh().skip_partitioning(
true);
79 getMesh().skip_partitioning(skip_partitioning_later);
92 auto exreader = std::make_shared<ExodusII_IO>(
getMesh());
96 getMesh().allow_renumbering(
false);
110 const bool skip_partitioning_later = restarting &&
getMesh().skip_partitioning();
111 const bool allow_renumbering_later = restarting &&
getMesh().allow_renumbering();
115 getMesh().skip_partitioning(
true);
116 getMesh().allow_renumbering(
false);
122 if (getParam<bool>(
"clear_spline_nodes"))
123 MeshTools::clear_spline_nodes(
getMesh());
129 getMesh().allow_renumbering(allow_renumbering_later);
130 getMesh().skip_partitioning(skip_partitioning_later);
140 getMesh().read(file_name, NULL,
false);
142 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 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
void setExReaderForRestart(std::shared_ptr< ExodusII_IO > &&exreader)
Set the Exodus reader to restart variables from an Exodus mesh file.
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)