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-2025 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 oriented faces
76  List<Map<bool>> faceZonesAddedOrientedFaces_;
77 
78  //- Zones of the added faces
79  List<labelHashSet> faceZonesAddedFaces_;
80 
81  //- Cell zone names
82  DynamicList<word> cellZoneNames_;
83 
84  //- Zones of the added cells
85  List<labelHashSet> cellZonesAddedCells_;
86 
87 
88  // Private Member Functions
89 
90  //- Return patch index given a name and type
91  label patchIndex(const polyPatch&);
92 
93  //- Return zone index given a list of active zones and a name
94  label zoneIndex(DynamicList<word>&, const word&);
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("mergePolyMesh");
101 
102 
103  // Constructors
104 
105  //- Construct from polyMesh
107 
108 
109  //- Destructor
110  virtual ~mergePolyMesh()
111  {}
112 
113 
114  // Member Functions
115 
116  //- Add a mesh
117  void addMesh(const polyMesh& m);
118 
119  //- Merge meshes
120  void merge();
121 
122 
123  // Member Operators
124 
125  //- Disallow default bitwise assignment
126  void operator=(const mergePolyMesh&) = delete;
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
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
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
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