mergePolyMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::mergePolyMesh
26 
27 Description
28  Merge meshes into a single mesh without stitching.
29 
30 SourceFiles
31  mergePolyMesh.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef mergePolyMesh_H
36 #define mergePolyMesh_H
37 
38 #include "polyMesh.H"
39 #include "polyTopoChange.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class mergePolyMesh Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class mergePolyMesh
51 {
52  // Private Data
53 
54  //- The master mesh the other meshes are merged into
55  polyMesh& mesh_;
56 
57  //- Topological change to accumulated all mesh changes
58  polyTopoChange meshMod_;
59 
60  //- Patch names
61  DynamicList<word> patchNames_;
62 
63  //- Patch dictionaries
64  DynamicList<dictionary> patchDicts_;
65 
66  //- Point zone names
67  DynamicList<word> pointZoneNames_;
68 
69  //- Zones of the added points
70  List<labelHashSet> pointZonesAddedPoints_;
71 
72  //- Face zone names
73  DynamicList<word> faceZoneNames_;
74 
75  //- Zones of the added faces
76  List<Map<bool>> faceZonesAddedFaces_;
77 
78  //- Cell zone names
79  DynamicList<word> cellZoneNames_;
80 
81  //- Zones of the added cells
82  List<labelHashSet> cellZonesAddedCells_;
83 
84 
85  // Private Member Functions
86 
87  //- Return patch index given a name and type
88  label patchIndex(const polyPatch&);
89 
90  //- Return zone index given a list of active zones and a name
91  label zoneIndex(DynamicList<word>&, const word&);
92 
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("mergePolyMesh");
98 
99 
100  // Constructors
101 
102  //- Construct from polyMesh
103  mergePolyMesh(polyMesh& mesh);
104 
105 
106  //- Destructor
107  virtual ~mergePolyMesh()
108  {}
109 
110 
111  // Member Functions
112 
113  //- Add a mesh
114  void addMesh(const polyMesh& m);
115 
116  //- Merge meshes
117  void merge();
118 
119 
120  // Member Operators
121 
122  //- Disallow default bitwise assignment
123  void operator=(const mergePolyMesh&) = delete;
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
Merge meshes into a single mesh without stitching.
Definition: mergePolyMesh.H:50
void operator=(const mergePolyMesh &)=delete
Disallow default bitwise assignment.
virtual ~mergePolyMesh()
Destructor.
void addMesh(const polyMesh &m)
Add a mesh.
mergePolyMesh(polyMesh &mesh)
Construct from polyMesh.
void merge()
Merge meshes.
TypeName("mergePolyMesh")
Runtime type information.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
Direct mesh changes based on v1.3 polyTopoChange syntax.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59