1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Creates dual of polyMesh.
31 Every polyMesh point becomes a cell on the dual mesh
33 Every polyMesh cell and patchFace becomes a point on the dual mesh.
39 \*---------------------------------------------------------------------------*/
41 #ifndef polyDualMesh_H
42 #define polyDualMesh_H
45 #include "labelIOList.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 /*---------------------------------------------------------------------------*\
54 Class polyDualMesh Declaration
55 \*---------------------------------------------------------------------------*/
63 //- From polyMesh cell to my point
64 labelIOList cellPoint_;
66 //- From polyMesh boundary face (face-mesh.nInternalFaces()) to my point
67 labelIOList boundaryFacePoint_;
70 // Private Member Functions
72 static labelList getFaceOrder
74 const labelList& faceOwner,
75 const labelList& faceNeighbour,
76 const cellList& cells,
80 static void getPointEdges
82 const primitivePatch& patch,
89 static labelList collectPatchSideFace
91 const polyPatch& patch,
92 const label patchToDualOffset,
93 const labelList& edgeToDualPoint,
94 const labelList& pointToDualPoint,
100 static void collectPatchInternalFace
102 const polyPatch& patch,
103 const label patchToDualOffset,
104 const labelList& edgeToDualPoint,
107 const label startEdgeI,
109 labelList& dualFace2,
110 labelList& featEdgeIndices2
113 static void splitFace
115 const polyPatch& patch,
116 const labelList& pointToDualPoint,
119 const labelList& dualFace,
120 const labelList& featEdgeIndices,
122 DynamicList<face>& dualFaces,
123 DynamicList<label>& dualOwner,
124 DynamicList<label>& dualNeighbour,
125 DynamicList<label>& dualRegion
128 static void dualPatch
130 const polyPatch& patch,
131 const label patchToDualOffset,
132 const labelList& edgeToDualPoint,
133 const labelList& pointToDualPoint,
135 const pointField& dualPoints,
137 DynamicList<face>& dualFaces,
138 DynamicList<label>& dualOwner,
139 DynamicList<label>& dualNeighbour,
140 DynamicList<label>& dualRegion
145 const polyMesh& mesh,
146 const labelList& featureEdges,
147 const labelList& featurePoints
151 //- Disallow default bitwise copy construct
152 polyDualMesh(const polyDualMesh&);
154 //- Disallow default bitwise assignment
155 void operator=(const polyDualMesh&);
160 //- Runtime type information
161 ClassName("polyDualMesh");
166 //- Construct from IOobject
167 polyDualMesh(const IOobject&);
169 //- Construct from polyMesh and list of edges and points to represent.
170 // Feature edge and point labels are in local addressing of a patch
171 // over all boundary faces.
175 const labelList& featureEdges,
176 const labelList& featurePoints
179 //- Construct from polyMesh and feature edge angle. Uses calcFeatures
180 // below to determine feature edges and points.
184 const scalar featureCos
187 //- Helper function to create feature edges and points based on
188 // feature angle and patches.
189 static void calcFeatures
192 const scalar featureCos,
193 labelList& featureEdges,
194 labelList& featurePoints
207 //- From polyMesh cell to dual point
208 const labelIOList& cellPoint() const
213 //- From polyMesh patch face to dual point
214 const labelIOList& boundaryFacePoint() const
216 return boundaryFacePoint_;
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 } // End namespace Foam
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 // ************************************************************************* //