triSurfaceChecks.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh 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 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  triSurface2DCheck
26 
27 Description
28 
29 
30 SourceFiles
31  triSurface2DCheck.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef triSurface2DCheck_H
36 #define triSurface2DCheck_H
37 
38 #include "labelLongList.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 class triSurf;
46 class boundBox;
47 
48 /*---------------------------------------------------------------------------*\
49  Namespace triSurfaceChecka Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 namespace triSurfaceChecks
53 {
54 
55 //- check the angles of triangles. Triangles wth the smallest angle below
56 //- the given threshold are marked as bad-quality triangles
58 (
59  const triSurf&,
61  const scalar angleTol = 5.0
62 );
63 
65 (
66  triSurf&,
67  const word subsetName = "smallAngles",
68  const scalar angleTol = 5.0
69 );
70 
71 //- check for existence of boudary and non-manifold edges
72 label checkSurfaceManifolds(const triSurf&, labelLongList&triangleInManifold);
73 label checkSurfaceManifolds(triSurf&, const word subsetPrefix="manifold_");
74 
75 //- check for existence of holes in the surface mesh
77 label checkForHoles(triSurf&, const word subsetName="holes");
78 
79 //- check for existence of non-manifold edges
82 (
83  triSurf&,
84  const word subsetPrefix="nonManifold_"
85 );
86 
87 //- check orientation of triangles
88 label checkOrientation(const triSurf&, labelLongList& triangleInGroup);
89 label checkOrientation(triSurf&, const word subsetPrefix="orientation_");
90 
91 //- check for disconnected surface parts
92 label checkDisconnectedParts(const triSurf&, labelLongList& triangleInRegion);
93 label checkDisconnectedParts(triSurf&, const word subsetPrefix="region_");
94 
95 //- calculate bounding box of the surface mesh
96 void calculateBoundingBox(const triSurf&, boundBox&);
97 
98 //- check existence of collocated points
100 (
101  const triSurf&,
102  labelLongList&,
103  const scalar distTol = 1e-6
104 );
106 (
107  triSurf&,
108  const word subsetName="collocatedPoints",
109  const scalar distTol = 1e-6
110 );
111 
112 //- check if there exist any self-intersections
114 (
115  const triSurf&,
116  labelLongList&,
117  const scalar tol=1e-6
118 );
120 (
121  triSurf&,
122  const word subsetName="selfIntersect",
123  const scalar tol=1e-6
124 );
125 
126 //- check if there exist any overlaps
128 (
129  const triSurf&,
130  labelLongList&,
131  const scalar tol = 1e-6,
132  const scalar angleTol = 5.0
133 );
135 (
136  triSurf&,
137  const word subsetName="overlappingTriangles",
138  const scalar tol = 1e-6,
139  const scalar angleTol = 5.0
140 );
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace triSurfaceChecks
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
Foam::triSurfaceChecks::checkOrientation
label checkOrientation(const triSurf &surf, labelLongList &triangleInGroup)
check orientation of triangles
Definition: triSurfaceChecks.C:460
labelLongList
This is a typedef for LongList<label>
Foam::triSurfaceChecks::calculateBoundingBox
void calculateBoundingBox(const triSurf &surf, boundBox &bb)
calculate bounding box of the surface mesh
Definition: triSurfaceChecks.C:631
Foam::triSurfaceChecks::checkForHoles
label checkForHoles(const triSurf &surf, labelLongList &badTriangles)
check for existence of holes in the surface mesh
Definition: triSurfaceChecks.C:274
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::triSurfaceChecks::checkCollocatedPoints
label checkCollocatedPoints(const triSurf &surf, labelLongList &collocatedPoints, const scalar distTol)
check existence of collocated points
Definition: triSurfaceChecks.C:638
Foam::triSurfaceChecks::checkSelfIntersections
label checkSelfIntersections(const triSurf &surf, labelLongList &badFaces, const scalar tol)
check if there exist any self-intersections
Definition: triSurfaceChecks.C:727
Foam::triSurfaceChecks::checkSurfaceManifolds
label checkSurfaceManifolds(const triSurf &surf, labelLongList &triangleInManifold)
check for existence of boudary and non-manifold edges
Definition: triSurfaceChecks.C:225
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::e
const double e
Elementary charge.
Definition: doubleFloat.H:94
Foam::triSurfaceChecks::checkDisconnectedParts
label checkDisconnectedParts(const triSurf &surf, labelLongList &triangleInRegion)
check for disconnected surface parts
Definition: triSurfaceChecks.C:582
triSurf
A class for triangulated surface used in the meshing process. It is derived from points and facets wi...
labelLongList.H
Foam::triSurfaceChecks::checkAngles
label checkAngles(const triSurf &surf, labelLongList &badTriangles, const scalar angleTol)
Definition: triSurfaceChecks.C:58
Foam::triSurfaceChecks::checkOverlaps
label checkOverlaps(const triSurf &surf, labelLongList &badFaces, const scalar tol, const scalar angleTol)
check if there exist any overlaps
Definition: triSurfaceChecks.C:886
Foam::triSurfaceChecks::checkForNonManifoldEdges
label checkForNonManifoldEdges(const triSurf &surf, labelLongList &badTriangles)
check for existence of non-manifold edges
Definition: triSurfaceChecks.C:315