www.mooseframework.org
PatternedMesh.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef PATTERNEDMESH_H
16 #define PATTERNEDMESH_H
17 
18 #include "MooseMesh.h"
19 
20 // Forward declarations
21 class PatternedMesh;
22 
23 namespace libMesh
24 {
25 class ReplicatedMesh;
26 }
27 
28 template <>
30 
41 class PatternedMesh : public MooseMesh
42 {
43 public:
44  PatternedMesh(const InputParameters & parameters);
45  PatternedMesh(const PatternedMesh & other_mesh);
46  virtual ~PatternedMesh();
47 
48  virtual MooseMesh & clone() const override;
49 
50  virtual void buildMesh() override;
51 
52 protected:
53  // The mesh files to read
54  const std::vector<MeshFileName> & _files;
55 
56  // The pattern, starting with the upper left corner
57  const std::vector<std::vector<unsigned int>> & _pattern;
58 
59  // Pointer to the original "row" mesh to be repeated and stitched
60  ReplicatedMesh * _original_mesh;
61 
62  // Holds the pointers to the meshes
63  std::vector<std::unique_ptr<ReplicatedMesh>> _meshes;
64 
65  // Holds a mesh for each row, these will be stitched together in the end
66  std::vector<std::unique_ptr<ReplicatedMesh>> _row_meshes;
67 
68  const Real _x_width;
69  const Real _y_width;
70  const Real _z_width;
71 };
72 
73 #endif /* PATTERNEDMESH_H */
InputParameters validParams< PatternedMesh >()
Definition: PatternedMesh.C:25
std::vector< std::unique_ptr< ReplicatedMesh > > _meshes
Definition: PatternedMesh.h:63
const Real _y_width
Definition: PatternedMesh.h:69
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
const Real _z_width
Definition: PatternedMesh.h:70
const std::vector< MeshFileName > & _files
Definition: PatternedMesh.h:54
Reads one or more 2D mesh files and stitches them together based on a provided two-dimensional patter...
Definition: PatternedMesh.h:41
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
const Real _x_width
Definition: PatternedMesh.h:68
const std::vector< std::vector< unsigned int > > & _pattern
Definition: PatternedMesh.h:57
std::vector< std::unique_ptr< ReplicatedMesh > > _row_meshes
Definition: PatternedMesh.h:66
ReplicatedMesh * _original_mesh
Definition: PatternedMesh.h:60