1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
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.
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
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/>.
28 A simple engine which provides topological information of a 2D mesh
29 and allows for maintaining consistency
34 \*---------------------------------------------------------------------------*/
36 #ifndef polyMeshGen2DEngine_H
37 #define polyMeshGen2DEngine_H
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 #include "polyMeshGen.H"
43 #include "labelList.H"
45 #include "demandDrivenData.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 class polyMeshGen2DEngine
55 //- reference to the mesh
61 //- which faces are not in the x-y plane
62 mutable boolList* activeFacePtr_;
64 //- labels of active faces
65 mutable labelList* activeFaceLabelsPtr_;
67 //- which points are in the x-y plane and at smallest z
68 mutable boolList* zMinPointPtr_;
70 //- labels of points at minimum z
71 mutable labelList* zMinPointLabelsPtr_;
73 //- labels of offset points of zMin points
74 mutable labelList* zMinToZMaxPtr_;
76 //- which points are in the x-y plane and at largest z
77 mutable boolList* zMaxPointPtr_;
79 //- labels of points at maximum z
80 mutable labelList* zMaxPointLabelsPtr_;
82 //- labels of zMin points of zMax points
83 mutable labelList* zMaxToZMinPtr_;
85 // Private member functions
87 void findActiveFaces() const;
89 //- find active face labels
90 void findActiveFaceLabels() const;
92 //- find points at minimum z
93 void findZMinPoints() const;
95 //- find labels of points at minimum z
96 void findZMinPointLabels() const;
98 //- find offset point to each zMin point
99 void findZMinOffsetPoints() const;
101 //- find points at maximum z
102 void findZMaxPoints() const;
104 //- find labels of points at minimum z
105 void findZMaxPointLabels() const;
107 //- find offset point to each zMin point
108 void findZMaxOffsetPoints() const;
110 //- disallow bitwise assignment
111 void operator=(const polyMeshGen2DEngine&);
113 //- disallow copy construct
114 polyMeshGen2DEngine(const polyMeshGen2DEngine&);
119 //- Construct from the reference to the mesh
120 polyMeshGen2DEngine(polyMeshGen& mesh);
123 ~polyMeshGen2DEngine();
126 //- const access to active faces
127 inline const boolList& activeFace() const;
129 //- labels of active faces
130 inline const labelList& activeFaceLabels() const;
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;
136 //- labels of points in the x-y with the smallest z coordinate
137 inline const labelList& zMinPointLabels() const;
139 //- offset points of points at minimum z
140 inline const labelList& zMinToZMax() const;
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;
146 //- labels of points in the x-y with the largest z coordinate
147 inline const labelList& zMaxPointLabels() const;
149 //- offset points of points at maximum z
150 inline const labelList& zMaxToZMin() const;
152 //- correct x and y coordinates of offset points
153 //- and unify the z coordinate
154 void correctPoints();
156 //- delete all dynamically allocated data
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 } // End namespace Foam
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 #include "polyMeshGen2DEngineI.H"
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //