intersection with triangle plane for miss
[OpenFOAM-1.5.x.git] / src / conversion / polyDualMesh / polyDualMesh.H
blob9ad2312ce1fbb701656fd0ab2c65774a72d564d0
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::polyDualMesh
28 Description
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.
36 SourceFiles
37     polyDualMesh.C
39 \*---------------------------------------------------------------------------*/
41 #ifndef polyDualMesh_H
42 #define polyDualMesh_H
44 #include "polyMesh.H"
45 #include "labelIOList.H"
46 #include "typeInfo.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace Foam
53 /*---------------------------------------------------------------------------*\
54                            Class polyDualMesh Declaration
55 \*---------------------------------------------------------------------------*/
57 class polyDualMesh
59     public polyMesh
61     // Private data
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
73         (
74             const labelList& faceOwner,
75             const labelList& faceNeighbour,
76             const cellList& cells,
77             label& nInternalFaces
78         );
80         static void getPointEdges
81         (
82             const primitivePatch& patch,
83             const label faceI,
84             const label pointI,
85             label& e0,
86             label& e1
87         );
89         static labelList collectPatchSideFace
90         (
91             const polyPatch& patch,
92             const label patchToDualOffset,
93             const labelList& edgeToDualPoint,
94             const labelList& pointToDualPoint,
95             const label pointI,
97             label& edgeI
98         );
100         static void collectPatchInternalFace
101         (
102             const polyPatch& patch,
103             const label patchToDualOffset,
104             const labelList& edgeToDualPoint,
106             const label pointI,
107             const label startEdgeI,
109             labelList& dualFace2,
110             labelList& featEdgeIndices2
111         );
113         static void splitFace
114         (
115             const polyPatch& patch,
116             const labelList& pointToDualPoint,
118             const label pointI,
119             const labelList& dualFace,
120             const labelList& featEdgeIndices,
122             DynamicList<face>& dualFaces,
123             DynamicList<label>& dualOwner,
124             DynamicList<label>& dualNeighbour,
125             DynamicList<label>& dualRegion
126         );
128         static void dualPatch
129         (
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
141         );
143         void calcDual
144         (
145             const polyMesh& mesh,
146             const labelList& featureEdges,
147             const labelList& featurePoints
148         );
151         //- Disallow default bitwise copy construct
152         polyDualMesh(const polyDualMesh&);
154         //- Disallow default bitwise assignment
155         void operator=(const polyDualMesh&);
158 public:
160     //- Runtime type information
161     ClassName("polyDualMesh");
164     // Constructors
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.
172         polyDualMesh
173         (
174             const polyMesh&,
175             const labelList& featureEdges,
176             const labelList& featurePoints
177         );
179         //- Construct from polyMesh and feature edge angle. Uses calcFeatures
180         //  below to determine feature edges and points.
181         polyDualMesh
182         (
183             const polyMesh&,
184             const scalar featureCos
185         );
187         //- Helper function to create feature edges and points based on
188         //  feature angle and patches.
189         static void calcFeatures
190         (
191             const polyMesh&,
192             const scalar featureCos,
193             labelList& featureEdges,
194             labelList& featurePoints
195         );
198     // Destructor
200         ~polyDualMesh();
203     // Member Functions
205         // Access
207             //- From polyMesh cell to dual point
208             const labelIOList& cellPoint() const
209             {
210                 return cellPoint_;
211             }
213             //- From polyMesh patch face to dual point
214             const labelIOList& boundaryFacePoint() const
215             {
216                 return boundaryFacePoint_;
217             }
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 } // End namespace Foam
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 #endif
228 // ************************************************************************* //