meshTriangulation.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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.
65  label nInternalFaces_;
66 
67  //- From triangle to mesh face
68  labelList faceMap_;
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 // ************************************************************************* //
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:74
Triangulation of mesh faces. Generates (multiply connected) trisurface.
void reverse(UList< T > &, const label n)
Definition: UListI.H:334
const labelList & faceMap() const
From triangle to mesh face.
meshTriangulation()
Construct null.
ClassName("meshTriangulation")
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:76
Triangulated surface description with patch information.
Definition: triSurface.H:66
label nInternalFaces() const
Number of triangles in *this which are internal to the surface.
Namespace for OpenFOAM.