www.mooseframework.org
PatternedMeshGenerator.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "MeshGenerator.h"
13 #include "libmesh/replicated_mesh.h"
14 
26 {
27 public:
29 
31 
32  std::unique_ptr<MeshBase> generate() override;
33 
34 protected:
36  const std::vector<MeshGeneratorName> & _input_names;
37 
39  const std::vector<std::unique_ptr<MeshBase> *> _mesh_ptrs;
40 
42  const std::vector<std::vector<unsigned int>> & _pattern;
43 
45  std::vector<std::unique_ptr<ReplicatedMesh>> _meshes;
46 
48  std::vector<std::unique_ptr<ReplicatedMesh>> _row_meshes;
49 
57  void
58  mergeSubdomainNameMaps(std::map<subdomain_id_type, std::string> & main_subdomain_map,
59  const std::map<subdomain_id_type, std::string> & increment_subdomain_map);
60 
64 };
Reads one or more 2D mesh files and stitches them together based on a provided two-dimensional patter...
void mergeSubdomainNameMaps(std::map< subdomain_id_type, std::string > &main_subdomain_map, const std::map< subdomain_id_type, std::string > &increment_subdomain_map)
Merges the subdomain name maps between two meshes, throws an error if input maps contain shared subdo...
PatternedMeshGenerator(const InputParameters &parameters)
std::vector< std::unique_ptr< ReplicatedMesh > > _meshes
Holds the pointers to the input generated meshes.
const std::vector< std::vector< unsigned int > > & _pattern
The pattern, starting with the upper left corner.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::vector< std::unique_ptr< ReplicatedMesh > > _row_meshes
Holds a mesh for each row, these will be stitched together in the end.
static InputParameters validParams()
const std::vector< std::unique_ptr< MeshBase > * > _mesh_ptrs
Holds pointers to the meshes before they are generated.
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const InputParameters & parameters() const
Get the parameters of the object.
MeshGenerators are objects that can modify or add to an existing mesh.
Definition: MeshGenerator.h:32
const std::vector< MeshGeneratorName > & _input_names
The mesh generators to read.