patchToPoly2DMesh.H
Go to the documentation of this file.
1/*--------------------------------*- C++ -*----------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2013 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::patchToPoly2DMesh
28
29Description
30 Convert a primitivePatch into a 2D polyMesh.
31
32SourceFiles
33 patchToPoly2DMesh.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef patchToPoly2DMesh_H
38#define patchToPoly2DMesh_H
39
40#include "edgeHashes.H"
41#include "MeshedSurface.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48/*---------------------------------------------------------------------------*\
49 Class patchToPoly2DMesh Declaration
50\*---------------------------------------------------------------------------*/
53{
54 // Private data
55
56 // Reference to the meshed surface
57 const MeshedSurface<face>& patch_;
58
59 const wordList& patchNames_;
60
61 const labelList& patchSizes_;
62
63 labelList patchStarts_;
64
65 const EdgeMap<label>& mapEdgesRegion_;
66
67 pointField points_;
68
69 faceList faces_;
70
71 labelList owner_;
72
73 labelList neighbour_;
74
75
76 // Private Member Functions
77
78 void flipFaceOrder();
79
80 void createNeighbours();
81
82 labelList internalFaceOrder();
83
84 void addPatchFacesToFaces();
85
86 void addPatchFacesToOwner();
87
88 void createPolyMeshComponents();
89
90 //- No copy construct
91 patchToPoly2DMesh(const patchToPoly2DMesh&) = delete;
92
93 //- No copy assignment
94 void operator=(const patchToPoly2DMesh&) = delete;
95
96
97public:
98
99 // Constructors
100
101 //- Construct from a primitivePatch
103 (
104 const MeshedSurface<face>& patch,
105 const wordList& patchNames,
106 const labelList& patchSizes,
107 const EdgeMap<label>& mapEdgesRegion
108 );
109
110
111 //- Destructor
113
114
115 // Member Functions
116
117 // Access
120 {
121 return points_;
122 }
124 faceList& faces()
125 {
126 return faces_;
127 }
130 {
131 return owner_;
132 }
135 {
136 return neighbour_;
137 }
139 const wordList& patchNames() const
140 {
141 return patchNames_;
142 }
144 const labelList& patchSizes() const
145 {
146 return patchSizes_;
147 }
149 const labelList& patchStarts() const
150 {
151 return patchStarts_;
152 }
153
154
155 // Edit
156
157 //- Create the mesh
158 void createMesh();
159};
160
161
162// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163
164} // End namespace Foam
165
166// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167
168#endif
169
170// ************************************************************************* //
Map from edge (expressed as its endpoints) to value. For easier forward declaration it is currently i...
Definition: EdgeMap.H:54
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: MeshedSurface.H:99
Convert a primitivePatch into a 2D polyMesh.
const labelList & patchStarts() const
void createMesh()
Create the mesh.
const labelList & patchSizes() const
~patchToPoly2DMesh()
Destructor.
const wordList & patchNames() const
patchToPoly2DMesh(const MeshedSurface< face > &patch, const wordList &patchNames, const labelList &patchSizes, const EdgeMap< label > &mapEdgesRegion)
Construct from a primitivePatch.
Namespace for OpenFOAM.