patchToPoly2DMesh.H
Go to the documentation of this file.
1 /*--------------------------------*- C++ -*----------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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::patchToPoly2DMesh
26 
27 Description
28  Convert a primitivePatch into a 2D polyMesh.
29 
30 SourceFiles
31  patchToPoly2DMesh.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef patchToPoly2DMesh_H
36 #define patchToPoly2DMesh_H
37 
38 #include "EdgeMap.H"
39 #include "MeshedSurface.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class patchToPoly2DMesh Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 {
52  // Private Data
53 
54  // Reference to the meshed surface
55  const MeshedSurface<face>& patch_;
56 
57  const wordList& patchNames_;
58 
59  const labelList& patchSizes_;
60 
61  labelList patchStarts_;
62 
63  const EdgeMap<label>& mapEdgesRegion_;
64 
65  pointField points_;
66 
67  faceList faces_;
68 
69  labelList owner_;
70 
71  labelList neighbour_;
72 
73 
74  // Private Member Functions
75 
76  void flipFaceOrder();
77 
78  void createNeighbours();
79 
80  labelList internalFaceOrder();
81 
82  void addPatchFacesToFaces();
83 
84  void addPatchFacesToOwner();
85 
86  void createPolyMeshComponents();
87 
88 
89 public:
90 
91  // Constructors
92 
93  //- Construct from a primitivePatch
95  (
96  const MeshedSurface<face>& patch,
97  const wordList& patchNames,
98  const labelList& patchSizes,
99  const EdgeMap<label>& mapEdgesRegion
100  );
101 
102  //- Disallow default bitwise copy construction
103  patchToPoly2DMesh(const patchToPoly2DMesh&) = delete;
104 
105 
106  //- Destructor
108 
109 
110  // Member Functions
111 
112  // Access
114  pointField& points()
115  {
116  return points_;
117  }
119  faceList& faces()
120  {
121  return faces_;
122  }
124  labelList& owner()
125  {
126  return owner_;
127  }
130  {
131  return neighbour_;
132  }
134  const wordList& patchNames() const
135  {
136  return patchNames_;
137  }
139  const labelList& patchSizes() const
140  {
141  return patchSizes_;
142  }
144  const labelList& patchStarts() const
145  {
146  return patchStarts_;
147  }
148 
149 
150  // Edit
151 
152  //- Create the mesh
153  void createMesh();
154 
155 
156  // Member Operators
157 
158  //- Disallow default bitwise assignment
159  void operator=(const patchToPoly2DMesh&) = delete;
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
patchToPoly2DMesh(const MeshedSurface< face > &patch, const wordList &patchNames, const labelList &patchSizes, const EdgeMap< label > &mapEdgesRegion)
Construct from a primitivePatch.
const wordList & patchNames() const
~patchToPoly2DMesh()
Destructor.
Convert a primitivePatch into a 2D polyMesh.
void operator=(const patchToPoly2DMesh &)=delete
Disallow default bitwise assignment.
void createMesh()
Create the mesh.
const labelList & patchStarts() const
const labelList & patchSizes() const
Namespace for OpenFOAM.