Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
triSurface
meshTriangulation
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) 1991-2010 OpenCFD Ltd.
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/triSurface.H
>
43
#include <
OpenFOAM/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
58
class
meshTriangulation
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,
87
label&
nInternalFaces
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
111
meshTriangulation
();
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
119
meshTriangulation
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
// ************************ vim: set sw=4 sts=4 et: ************************ //