14 #include "libmesh/mesh_modification.h" 15 #include "libmesh/serial_mesh.h" 16 #include "libmesh/exodusII_io.h" 26 "The name of the mesh files to read. These mesh files will be 'stitched' into the " 27 "current mesh in this order.");
31 "Pairs of boundary names (one after the other) to stitch together for each step.");
34 "clear_stitched_boundary_ids",
36 "Whether or not to erase the boundary IDs after they've been used for stitching.");
39 "Reads in all of the given meshes and stitches them all together into one mesh.");
46 _files(getParam<
std::vector<MeshFileName>>(
"files")),
47 _clear_stitched_boundary_ids(getParam<bool>(
"clear_stitched_boundary_ids")),
48 _stitch_boundaries(getParam<
std::vector<BoundaryName>>(
"stitch_boundaries"))
51 mooseError(
"Must specify at least one mesh file for StitchedMesh");
57 mooseError(
"There must be an even amount of stitch_boundaries in ",
name());
68 _files(other_mesh._files),
69 _clear_stitched_boundary_ids(other_mesh._clear_stitched_boundary_ids),
70 _stitch_boundaries(other_mesh._stitch_boundaries)
74 std::unique_ptr<MooseMesh>
77 return std::make_unique<StitchedMesh>(*this);
static InputParameters validParams()
Typical "Moose-style" constructor and copy constructor.
const bool & _clear_stitched_boundary_ids
Whether or not to clear (remove) the stitched boundary IDs.
ReplicatedMesh * _original_mesh
registerMooseObject("MooseApp", StitchedMesh)
std::vector< std::unique_ptr< ReplicatedMesh > > _meshes
The meshes to be stitched together. The first entry will be the "real" mesh.
virtual void buildMesh() override
Must be overridden by child classes.
const Parallel::Communicator & _communicator
virtual const std::string & name() const
Get the name of the class.
Reads an arbitrary set of meshes and attempts to "stitch" (join) them along boundaries.
void errorIfDistributedMesh(std::string name) const
Generate a unified error message if the underlying libMesh mesh is a DistributedMesh.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
StitchedMesh(const InputParameters ¶meters)
boundary_id_type BoundaryID
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
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...
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
static InputParameters validParams()
const std::vector< BoundaryName > & _stitch_boundaries
The raw data from the input file.
const std::vector< MeshFileName > & _files
The mesh files to read.
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.
std::vector< std::pair< BoundaryName, BoundaryName > > _stitch_boundaries_pairs
A transformed version of _stitch_boundaries into a more logical "pairwise" structure.