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-2018 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  //- Disallow default bitwise copy construct
90 
91  //- Disallow default bitwise assignment
92  void operator=(const patchToPoly2DMesh&);
93 
94 
95 public:
96 
97  // Constructors
98 
99  //- Construct from a primitivePatch
101  (
102  const MeshedSurface<face>& patch,
103  const wordList& patchNames,
104  const labelList& patchSizes,
105  const EdgeMap<label>& mapEdgesRegion
106  );
107 
108 
109  //- Destructor
111 
112 
113  // Member Functions
114 
115  // Access
117  pointField& points()
118  {
119  return points_;
120  }
122  faceList& faces()
123  {
124  return faces_;
125  }
127  labelList& owner()
128  {
129  return owner_;
130  }
133  {
134  return neighbour_;
135  }
137  const wordList& patchNames() const
138  {
139  return patchNames_;
140  }
142  const labelList& patchSizes() const
143  {
144  return patchSizes_;
145  }
147  const labelList& patchStarts() const
148  {
149  return patchStarts_;
150  }
151 
152 
153  // Edit
154 
155  //- Create the mesh
156  void createMesh();
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
const wordList & patchNames() const
~patchToPoly2DMesh()
Destructor.
Convert a primitivePatch into a 2D polyMesh.
void createMesh()
Create the mesh.
const labelList & patchStarts() const
const labelList & patchSizes() const
Namespace for OpenFOAM.