15 #include "libmesh/mesh_modification.h" 16 #include "libmesh/serial_mesh.h" 17 #include "libmesh/exodusII_io.h" 26 "The name of the mesh files to read. " 27 " They are automatically assigned " 28 "ids starting with zero.");
31 "x_width", 0,
"x_width>=0",
"The tile width in the x direction");
33 "y_width", 0,
"y_width>=0",
"The tile width in the y direction");
35 "z_width", 0,
"z_width>=0",
"The tile width in the z direction");
38 params.
addParam<BoundaryName>(
"left_boundary",
"left_boundary",
"name of the left (x) boundary");
40 "right_boundary",
"right_boundary",
"name of the right (x) boundary");
43 params.
addParam<BoundaryName>(
"top_boundary",
"top_boundary",
"name of the top (y) boundary");
45 "bottom_boundary",
"bottom_boundary",
"name of the bottom (y) boundary");
48 "pattern",
"A double-indexed array starting with the upper-left corner");
50 params.
addClassDescription(
"Creates a 2D mesh from a specified set of unique 'tiles' meshes and " 51 "a two-dimensional pattern.");
58 _files(getParam<
std::vector<MeshFileName>>(
"files")),
59 _pattern(getParam<
std::vector<
std::vector<unsigned
int>>>(
"pattern")),
60 _x_width(getParam<
Real>(
"x_width")),
61 _y_width(getParam<
Real>(
"y_width")),
62 _z_width(getParam<
Real>(
"z_width"))
72 _files(other_mesh._files),
73 _pattern(other_mesh._pattern),
74 _x_width(other_mesh._x_width),
75 _y_width(other_mesh._y_width),
76 _z_width(other_mesh._z_width)
80 std::unique_ptr<MooseMesh>
104 std::vector<ReplicatedMesh *> row_meshes;
105 row_meshes.reserve(
_pattern.size());
107 row_meshes.push_back(static_cast<ReplicatedMesh *>(&
getMesh()));
110 row_meshes.push_back(row_mesh.get());
128 MeshTools::Modification::translate(*row_meshes[i], deltax, -deltay, 0);
136 MeshTools::Modification::translate(cell_mesh, deltax, -deltay, 0);
138 row_meshes[i]->stitch_meshes(dynamic_cast<ReplicatedMesh &>(cell_mesh),
145 MeshTools::Modification::translate(cell_mesh, -deltax, deltay, 0);
151 row_meshes[0]->stitch_meshes(
152 *row_meshes[i], bottom, top, TOLERANCE,
true);
static InputParameters validParams()
Typical "Moose-style" constructor and copy constructor.
std::vector< std::unique_ptr< ReplicatedMesh > > _meshes
registerMooseObject("MooseApp", PatternedMesh)
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...
static InputParameters validParams()
PatternedMesh(const InputParameters ¶meters)
const Parallel::Communicator & _communicator
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.
const std::vector< MeshFileName > & _files
void errorIfDistributedMesh(std::string name) const
Generate a unified error message if the underlying libMesh mesh is a DistributedMesh.
Reads one or more 2D mesh files and stitches them together based on a provided two-dimensional patter...
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
boundary_id_type BoundaryID
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
MooseApp & _app
The MOOSE application this is associated with.
const std::vector< std::vector< unsigned int > > & _pattern
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< std::unique_ptr< ReplicatedMesh > > _row_meshes
virtual void buildMesh() override
Must be overridden by child classes.
void ErrorVector unsigned int
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.