FIX: Require and use Python-2 to run AsciiDoc
[freefoam.git] / src / triSurface / meshTriangulation / meshTriangulation.H
blob3e929c3ced1a1cb75e2a2e07439401c3247a09bc
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2010 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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::meshTriangulation
27 Description
28     Triangulation of mesh faces. Generates (multiply connected) trisurface.
30     All patch faces keep their patchID as triangle region.
31     Internal faces get the supplied region number.
33 SourceFiles
34     meshTriangulation.C
36 \*---------------------------------------------------------------------------*/
39 #ifndef meshTriangulation_H
40 #define meshTriangulation_H
42 #include <triSurface/triSurface.H>
43 #include <OpenFOAM/typeInfo.H>
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 // Forward declaration of classes
51 class polyMesh;
52 class primitiveMesh;
54 /*---------------------------------------------------------------------------*\
55                            Class meshTriangulation Declaration
56 \*---------------------------------------------------------------------------*/
58 class meshTriangulation
60     public triSurface
62     // Private data
64         //- Number of triangles in this that are internal to the surface.
65         label nInternalFaces_;
67         //- From triangle to mesh face
68         labelList faceMap_;
70     // Private Member Functions
72         //- Is face internal to the subset.
73         static bool isInternalFace
74         (
75             const primitiveMesh&,
76             const boolList& includedCell,
77             const label faceI
78         );
80         //- find boundary faces of subset.
81         static void getFaces
82         (
83             const primitiveMesh&,
84             const boolList& includedCell,
85             boolList& faceIsCut,
86             label& nFaces,
87             label& nInternalFaces
88         );
90         //- Add triangulation of face to triangles. Optionally reverse.
91         void insertTriangles
92         (
93             const triFaceList&,
94             const label faceI,
95             const label regionI,
96             const bool reverse,
98             List<labelledTri>& triangles,
99             label& triI
100         );
103 public:
105     ClassName("meshTriangulation");
108     // Constructors
110         //- Construct null
111         meshTriangulation();
113         //- Construct from selected mesh cell and region number to be used
114         //  for triangles resulting from internal faces. (all boundary triangles
115         //  get polyMesh patch id). 
116         //  faceCentreDecomposition = true  : decomposition around face centre
117         //                            false : decomposition using
118         //                                    existing vertices
119         meshTriangulation
120         (
121             const polyMesh&,
122             const label internalFacesPatch,
123             const boolList& includedCell,
124             const bool faceCentreDecomposition = false
125         );
128     // Member Functions
130         //- number of triangles in *this which are internal to the surface
131         label nInternalFaces() const
132         {
133             return nInternalFaces_;
134         }
136         //- from triangle to mesh face
137         const labelList& faceMap() const
138         {
139             return faceMap_;
140         }
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 } // End namespace Foam
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 #endif
152 // ************************ vim: set sw=4 sts=4 et: ************************ //