polyMeshGen2DEngine.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  polyMeshGen2DEngine
26 
27 Description
28  A simple engine which provides topological information of a 2D mesh
29  and allows for maintaining consistency
30 
31 SourceFiles
32  polyMeshGen2DEngine.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef polyMeshGen2DEngine_H
37 #define polyMeshGen2DEngine_H
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 #include "polyMeshGen.H"
42 #include "boolList.H"
43 #include "labelList.H"
44 #include "boundBox.H"
45 #include "demandDrivenData.H"
46 
47 namespace Foam
48 {
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
53 {
54  // Private data
55  //- const reference to the mesh
56  const polyMeshGen& mesh_;
57 
58  //- bounding box
59  boundBox bb_;
60 
61  //- which faces are not in the x-y plane
62  mutable boolList* activeFacePtr_;
63 
64  //- labels of active faces
66 
67  //- which points are in the x-y plane and at smallest z
68  mutable boolList* zMinPointPtr_;
69 
70  //- labels of points at minimum z
72 
73  //- labels of offset points of zMin points
74  mutable labelList* zMinToZMaxPtr_;
75 
76  //- which points are in the x-y plane and at largest z
77  mutable boolList* zMaxPointPtr_;
78 
79  //- labels of points at maximum z
81 
82  //- labels of zMin points of zMax points
83  mutable labelList* zMaxToZMinPtr_;
84 
85  // Private member functions
86  //- find active faces
87  void findActiveFaces() const;
88 
89  //- find active face labels
90  void findActiveFaceLabels() const;
91 
92  //- find points at minimum z
93  void findZMinPoints() const;
94 
95  //- find labels of points at minimum z
96  void findZMinPointLabels() const;
97 
98  //- find offset point to each zMin point
99  void findZMinOffsetPoints() const;
100 
101  //- find points at maximum z
102  void findZMaxPoints() const;
103 
104  //- find labels of points at minimum z
105  void findZMaxPointLabels() const;
106 
107  //- find offset point to each zMin point
108  void findZMaxOffsetPoints() const;
109 
110  //- disallow bitwise assignment
111  void operator=(const polyMeshGen2DEngine&);
112 
113  //- disallow copy construct
115 
116 public:
117 
118  // Constructors
119  //- Construct from the const reference to the mesh
121 
122  // Destructor
124 
125  // Member functions
126  //- const access to active faces
127  inline const boolList& activeFace() const;
128 
129  //- labels of active faces
130  inline const labelList& activeFaceLabels() const;
131 
132  //- const access to an array of booleans which is true for points
133  //- in the x-y plane with the smallest z coordinate
134  inline const boolList& zMinPoints() const;
135 
136  //- labels of points in the x-y with the smallest z coordinate
137  inline const labelList& zMinPointLabels() const;
138 
139  //- offset points of points at minimum z
140  inline const labelList& zMinToZMax() const;
141 
142  //- const access to an array of booleans which is true for points
143  //- in the x-y plane with the largest z coordinate
144  inline const boolList& zMaxPoints() const;
145 
146  //- labels of points in the x-y with the largest z coordinate
147  inline const labelList& zMaxPointLabels() const;
148 
149  //- offset points of points at maximum z
150  inline const labelList& zMaxToZMin() const;
151 
152  //- correct x and y coordinates of offset points
153  //- and unify the z coordinate
154  void correctPoints();
155 
156  //- delete all dynamically allocated data
157  void clearOut();
158 };
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #include "polyMeshGen2DEngineI.H"
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::polyMeshGen2DEngine::findZMaxPoints
void findZMaxPoints() const
find points at maximum z
Definition: polyMeshGen2DEngine.C:179
Foam::polyMeshGen2DEngine::activeFacePtr_
boolList * activeFacePtr_
which faces are not in the x-y plane
Definition: polyMeshGen2DEngine.H:61
boolList.H
Foam::polyMeshGen2DEngine::activeFace
const boolList & activeFace() const
const access to active faces
Definition: polyMeshGen2DEngineI.H:48
Foam::polyMeshGen2DEngine::activeFaceLabelsPtr_
labelList * activeFaceLabelsPtr_
labels of active faces
Definition: polyMeshGen2DEngine.H:64
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::polyMeshGen2DEngine::bb_
boundBox bb_
bounding box
Definition: polyMeshGen2DEngine.H:58
Foam::polyMeshGen2DEngine::mesh_
const polyMeshGen & mesh_
const reference to the mesh
Definition: polyMeshGen2DEngine.H:55
Foam::polyMeshGen2DEngine::zMaxPointPtr_
boolList * zMaxPointPtr_
which points are in the x-y plane and at largest z
Definition: polyMeshGen2DEngine.H:76
Foam::polyMeshGen
Definition: polyMeshGen.H:46
polyMeshGen2DEngineI.H
Foam::polyMeshGen2DEngine::findActiveFaces
void findActiveFaces() const
find active faces
Definition: polyMeshGen2DEngine.C:43
Foam::polyMeshGen2DEngine::zMinToZMax
const labelList & zMinToZMax() const
offset points of points at minimum z
Definition: polyMeshGen2DEngineI.H:80
Foam::polyMeshGen2DEngine::operator=
void operator=(const polyMeshGen2DEngine &)
disallow bitwise assignment
Foam::polyMeshGen2DEngine::findZMinOffsetPoints
void findZMinOffsetPoints() const
find offset point to each zMin point
Definition: polyMeshGen2DEngine.C:140
Foam::polyMeshGen2DEngine::zMinPoints
const boolList & zMinPoints() const
Definition: polyMeshGen2DEngineI.H:64
Foam::polyMeshGen2DEngine::zMinPointLabelsPtr_
labelList * zMinPointLabelsPtr_
labels of points at minimum z
Definition: polyMeshGen2DEngine.H:70
Foam::polyMeshGen2DEngine::~polyMeshGen2DEngine
~polyMeshGen2DEngine()
Definition: polyMeshGen2DEngine.C:323
labelList.H
polyMeshGen.H
Foam::polyMeshGen2DEngine::zMaxToZMinPtr_
labelList * zMaxToZMinPtr_
labels of zMin points of zMax points
Definition: polyMeshGen2DEngine.H:82
Foam::polyMeshGen2DEngine::correctPoints
void correctPoints()
Definition: polyMeshGen2DEngine.C:330
Foam::polyMeshGen2DEngine::zMaxPoints
const boolList & zMaxPoints() const
Definition: polyMeshGen2DEngineI.H:88
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::polyMeshGen2DEngine::zMaxPointLabelsPtr_
labelList * zMaxPointLabelsPtr_
labels of points at maximum z
Definition: polyMeshGen2DEngine.H:79
Foam::polyMeshGen2DEngine::zMinToZMaxPtr_
labelList * zMinToZMaxPtr_
labels of offset points of zMin points
Definition: polyMeshGen2DEngine.H:73
Foam::polyMeshGen2DEngine::zMinPointLabels
const labelList & zMinPointLabels() const
labels of points in the x-y with the smallest z coordinate
Definition: polyMeshGen2DEngineI.H:72
Foam::polyMeshGen2DEngine::zMaxToZMin
const labelList & zMaxToZMin() const
offset points of points at maximum z
Definition: polyMeshGen2DEngineI.H:104
boundBox.H
Foam::polyMeshGen2DEngine::clearOut
void clearOut()
delete all dynamically allocated data
Definition: polyMeshGen2DEngine.C:352
Foam::polyMeshGen2DEngine
Definition: polyMeshGen2DEngine.H:51
Foam::polyMeshGen2DEngine::findActiveFaceLabels
void findActiveFaceLabels() const
find active face labels
Definition: polyMeshGen2DEngine.C:69
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::polyMeshGen2DEngine::findZMinPointLabels
void findZMinPointLabels() const
find labels of points at minimum z
Definition: polyMeshGen2DEngine.C:111
Foam::boundBox
A bounding box defined in terms of the points at its extremities.
Definition: boundBox.H:55
Foam::polyMeshGen2DEngine::findZMaxOffsetPoints
void findZMaxOffsetPoints() const
find offset point to each zMin point
Definition: polyMeshGen2DEngine.C:232
Foam::polyMeshGen2DEngine::findZMinPoints
void findZMinPoints() const
find points at minimum z
Definition: polyMeshGen2DEngine.C:87
Foam::polyMeshGen2DEngine::activeFaceLabels
const labelList & activeFaceLabels() const
labels of active faces
Definition: polyMeshGen2DEngineI.H:56
Foam::polyMeshGen2DEngine::findZMaxPointLabels
void findZMaxPointLabels() const
find labels of points at minimum z
Definition: polyMeshGen2DEngine.C:203
Foam::polyMeshGen2DEngine::polyMeshGen2DEngine
polyMeshGen2DEngine(const polyMeshGen2DEngine &)
disallow copy construct
Foam::polyMeshGen2DEngine::zMaxPointLabels
const labelList & zMaxPointLabels() const
labels of points in the x-y with the largest z coordinate
Definition: polyMeshGen2DEngineI.H:96
Foam::polyMeshGen2DEngine::zMinPointPtr_
boolList * zMinPointPtr_
which points are in the x-y plane and at smallest z
Definition: polyMeshGen2DEngine.H:67