All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
meshCheck.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-2023 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 Description
25  Functions for checking mesh topology and geometry
26 
27 SourceFiles
28  checkTopology.C
29  checkGeometry.C
30  checkMesh.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef meshCheck_H
35 #define meshCheck_H
36 
37 #include "primitiveMeshCheck.H"
38 #include "polyMeshCheck.H"
39 #include "wedgePolyPatch.H"
40 #include "mergeAndWrite.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace meshCheck
50 {
51  //- Find wedge with opposite orientation. Note: does not actually check
52  // that it is opposite, only that it has opposite normal and same axis.
53  label findOppositeWedge(const polyMesh&, const wedgePolyPatch&);
54 
55  //- Check wedge orientation
56  bool checkWedges
57  (
58  const polyMesh&,
59  const bool report,
60  const Vector<label>&,
62  );
63 
64  //- Check 0th vertex on coupled faces
65  bool checkCoupledPoints(const polyMesh&, const bool report, labelHashSet*);
66 
67  //- Check the topology
69  (
70  const polyMesh& mesh,
71  const bool allTopology,
72  const autoPtr<surfaceWriter>& surfWriter,
73  const autoPtr<setWriter>& setWriter
74  );
75 
76  //- Check the geometry
78  (
79  const polyMesh& mesh,
80  const bool allGeometry,
81  const scalar nonOrthThreshold,
82  const scalar skewThreshold,
83  const autoPtr<surfaceWriter>&,
84  const autoPtr<setWriter>&
85  );
86 
87  //- Check (subset of mesh including baffles) with mesh settings in dict.
88  // Collects incorrect faces in set.
89  // Returns true if one or more faces in error.
90  bool checkMesh
91  (
92  const bool report,
93  const polyMesh& mesh,
94  const dictionary& dict,
95  const labelList& checkFaces,
96  const List<labelPair>& baffles,
97  labelHashSet& wrongFaces
98  );
99 
100  //- Check (subset of mesh) with mesh settings in dict.
101  // Collects incorrect faces in set.
102  // Returns true if one or more faces in error.
103  bool checkMesh
104  (
105  const bool report,
106  const polyMesh& mesh,
107  const dictionary& dict,
108  const labelList& checkFaces,
109  labelHashSet& wrongFaces
110  );
111 
112  //- Check mesh with mesh settings in dict.
113  // Collects incorrect faces in set.
114  // Returns true if one or more faces in error.
115  bool checkMesh
116  (
117  const bool report,
118  const polyMesh& mesh,
119  const dictionary& dict,
120  labelHashSet& wrongFaces
121  );
122 }
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
Tools for checking the mesh.
bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet &wrongFaces)
Check (subset of mesh including baffles) with mesh settings in dict.
Definition: checkMesh.C:33
bool checkCoupledPoints(const polyMesh &, const bool report, labelHashSet *)
Check 0th vertex on coupled faces.
bool checkWedges(const polyMesh &, const bool report, const Vector< label > &, labelHashSet *)
Check wedge orientation.
Definition: checkGeometry.C:87
label findOppositeWedge(const polyMesh &, const wedgePolyPatch &)
Find wedge with opposite orientation. Note: does not actually check.
Definition: checkGeometry.C:47
label checkTopology(const polyMesh &mesh, const bool allTopology, const autoPtr< surfaceWriter > &surfWriter, const autoPtr< setWriter > &setWriter)
Check the topology.
Definition: checkTopology.C:42
label checkGeometry(const polyMesh &mesh, const bool allGeometry, const scalar nonOrthThreshold, const scalar skewThreshold, const autoPtr< surfaceWriter > &, const autoPtr< setWriter > &)
Check the geometry.
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: labelList.H:56
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
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Definition: HashSet.H:213
dictionary dict