1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
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.
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
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/>.
28 A set of functions used for mesh checking mesh quality
31 polyMeshGenAddressingChecks.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef polyMeshGenChecks_H
36 #define polyMeshGenChecks_H
38 #include "polyMeshGen.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Namespace polyMeshGenChecks functions Declaration
49 \*---------------------------------------------------------------------------*/
51 namespace polyMeshGenChecks
55 //- Check boundary closedness
56 bool checkClosedBoundary(const polyMeshGen&, const bool report = false);
58 //- Check cells for closedness
62 const bool report = false,
63 const scalar aspectWarn = 1000,
64 labelHashSet* setPtr = NULL
67 //- Check for negative cell volumes
71 const bool report = false,
72 labelHashSet* setPtr = NULL
75 //- Check for negative face areas
79 const bool report = false,
80 const scalar minFaceArea = VSMALL,
81 labelHashSet* setPtr = NULL,
82 const boolList* changedFacePtr = NULL
85 //- Check for negative part tetrahedra
86 //- Cells are decomposed into tetrahedra formed by
87 //- the cell centre, face centre and the edge vertices
88 bool checkCellPartTetrahedra
91 const bool report = false,
92 const scalar minPartTet = VSMALL,
93 labelHashSet* setPtr = NULL,
94 const boolList* changedFacePtr = NULL
97 //- Check for non-orthogonality
98 bool checkFaceDotProduct
101 const bool report = false,
102 const scalar nonOrthWarn = 70.0,
103 labelHashSet* setPtr = NULL,
104 const boolList* changedFacePtr = NULL
107 //- Check face pyramid volume
108 bool checkFacePyramids
111 const bool report = false,
112 const scalar minPyrVol = -SMALL,
113 labelHashSet* setPtr = NULL,
114 const boolList* changedFacePtr = NULL
117 //- Check face skewness
118 bool checkFaceSkewness
121 const bool report = false,
122 const scalar warnSkew = 4.0,
123 labelHashSet* setPtr = NULL,
124 const boolList* changedFacePtr = NULL
127 //- Check face uniformity
128 bool checkFaceUniformity
131 const bool report = false,
132 const scalar warnUniform = 0.1,
133 labelHashSet* setPtr = NULL,
134 const boolList* changedFacePtr = NULL
137 //- Check face angles
141 const bool report = false,
142 const scalar maxDeg = 10, // In degrees
143 labelHashSet* setPtr = NULL,
144 const boolList* changedFacePtr = NULL
147 //- Check face warpage: decompose face and check ratio between
148 // magnitude of sum of triangle areas and sum of magnitude of
150 bool checkFaceFlatness
154 const scalar warnFlatness, // When to include in set.
155 labelHashSet* setPtr,
156 const boolList* changedFacePtr = NULL
159 // Checks using topology only
161 //- Check for unused points
165 const bool report = false,
166 labelHashSet* setPtr = NULL
169 //- Check face ordering
170 bool checkUpperTriangular
173 const bool report = false,
174 labelHashSet* setPtr = NULL
177 //- Check cell zip-up
181 const bool report = false,
182 labelHashSet* setPtr = NULL
185 //- Check uniqueness of face vertices
186 bool checkFaceVertices
189 const bool report = false,
190 labelHashSet* setPtr = NULL
193 //- Check mesh topology for correctness. Returns false for no error.
194 bool checkTopology(const polyMeshGen&, const bool report = false);
196 //- Check mesh geometry (& implicitly topology) for correctness.
197 // Returns false for no error.
198 bool checkGeometry(const polyMeshGen&, const bool report = false);
200 //- Check mesh for correctness. Returns false for no error.
201 bool checkMesh(const polyMeshGen&, const bool report = false);
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 } // End namespace Foam
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 // ************************************************************************* //