meshTriangulation.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::meshTriangulation
26 
27 Description
28  Triangulation of mesh faces. Generates (multiply connected) trisurface.
29 
30  All patch faces keep their patchID as triangle region.
31  Internal faces get the supplied region number.
32 
33 SourceFiles
34  meshTriangulation.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 
39 #ifndef meshTriangulation_H
40 #define meshTriangulation_H
41 
42 #include "triSurface.H"
43 #include "typeInfo.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward declaration of classes
51 class polyMesh;
52 class primitiveMesh;
53 
54 /*---------------------------------------------------------------------------*\
55  Class meshTriangulation Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 :
60  public triSurface
61 {
62  // Private data
63 
64  //- Number of triangles in this that are internal to the surface.
66 
67  //- From triangle to mesh face
69 
70  // Private Member Functions
71 
72  //- Is face internal to the subset.
73  static bool isInternalFace
74  (
75  const primitiveMesh&,
76  const boolList& includedCell,
77  const label faceI
78  );
79 
80  //- Find boundary faces of subset.
81  static void getFaces
82  (
83  const primitiveMesh&,
84  const boolList& includedCell,
85  boolList& faceIsCut,
86  label& nFaces,
88  );
89 
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,
97 
98  List<labelledTri>& triangles,
99  label& triI
100  );
101 
102 
103 public:
104 
105  ClassName("meshTriangulation");
106 
107 
108  // Constructors
109 
110  //- Construct null
112 
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
120  (
121  const polyMesh&,
122  const label internalFacesPatch,
123  const boolList& includedCell,
124  const bool faceCentreDecomposition = false
125  );
126 
127 
128  // Member Functions
129 
130  //- Number of triangles in *this which are internal to the surface
131  label nInternalFaces() const
132  {
133  return nInternalFaces_;
134  }
135 
136  //- From triangle to mesh face
137  const labelList& faceMap() const
138  {
139  return faceMap_;
140  }
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
Foam::meshTriangulation::nInternalFaces_
label nInternalFaces_
Number of triangles in this that are internal to the surface.
Definition: meshTriangulation.H:64
Foam::meshTriangulation
Triangulation of mesh faces. Generates (multiply connected) trisurface.
Definition: meshTriangulation.H:57
typeInfo.H
Foam::meshTriangulation::nInternalFaces
label nInternalFaces() const
Number of triangles in *this which are internal to the surface.
Definition: meshTriangulation.H:130
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::meshTriangulation::faceMap
const labelList & faceMap() const
From triangle to mesh face.
Definition: meshTriangulation.H:136
Foam::meshTriangulation::isInternalFace
static bool isInternalFace(const primitiveMesh &, const boolList &includedCell, const label faceI)
Is face internal to the subset.
Definition: meshTriangulation.C:33
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::triSurface
Triangulated surface description with patch information.
Definition: triSurface.H:57
Foam::meshTriangulation::faceMap_
labelList faceMap_
From triangle to mesh face.
Definition: meshTriangulation.H:67
Foam::meshTriangulation::insertTriangles
void insertTriangles(const triFaceList &, const label faceI, const label regionI, const bool reverse, List< labelledTri > &triangles, label &triI)
Add triangulation of face to triangles. Optionally reverse.
Definition: meshTriangulation.C:111
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::meshTriangulation::ClassName
ClassName("meshTriangulation")
Foam::meshTriangulation::getFaces
static void getFaces(const primitiveMesh &, const boolList &includedCell, boolList &faceIsCut, label &nFaces, label &nInternalFaces)
Find boundary faces of subset.
Definition: meshTriangulation.C:63
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::reverse
void reverse(UList< T > &, const label n)
Definition: UListI.H:322
Foam::meshTriangulation::meshTriangulation
meshTriangulation()
Construct null.
Definition: meshTriangulation.C:153
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:79