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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::patchToPoly2DMesh
28 
29 Description
30  Convert a primitivePatch into a 2D polyMesh.
31 
32 SourceFiles
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 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class patchToPoly2DMesh Declaration
50 \*---------------------------------------------------------------------------*/
51 
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 
97 public:
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
118 
119  pointField& points()
120  {
121  return points_;
122  }
123 
124  faceList& faces()
125  {
126  return faces_;
127  }
128 
129  labelList& owner()
130  {
131  return owner_;
132  }
133 
135  {
136  return neighbour_;
137  }
138 
139  const wordList& patchNames() const
140  {
141  return patchNames_;
142  }
143 
144  const labelList& patchSizes() const
145  {
146  return patchSizes_;
147  }
148 
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 // ************************************************************************* //
Foam::patchToPoly2DMesh::patchNames
const wordList & patchNames() const
Definition: patchToPoly2DMesh.H:138
Foam::patchToPoly2DMesh::createMesh
void createMesh()
Create the mesh.
Foam::Field< vector >
Foam::patchToPoly2DMesh::patchSizes
const labelList & patchSizes() const
Definition: patchToPoly2DMesh.H:143
Foam::patchToPoly2DMesh::neighbour
labelList & neighbour()
Definition: patchToPoly2DMesh.H:133
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::patchToPoly2DMesh::faces
faceList & faces()
Definition: patchToPoly2DMesh.H:123
Foam::patchToPoly2DMesh::patchStarts
const labelList & patchStarts() const
Definition: patchToPoly2DMesh.H:148
Foam::EdgeMap< label >
edgeHashes.H
Foam::patchToPoly2DMesh::points
pointField & points()
Definition: patchToPoly2DMesh.H:118
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::patchToPoly2DMesh
Convert a primitivePatch into a 2D polyMesh.
Definition: patchToPoly2DMesh.H:51
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::patchToPoly2DMesh::owner
labelList & owner()
Definition: patchToPoly2DMesh.H:128
Foam::MeshedSurface< face >
MeshedSurface.H
Foam::patchToPoly2DMesh::~patchToPoly2DMesh
~patchToPoly2DMesh()
Destructor.