polyMeshTetDecomposition.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2019 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::polyMeshTetDecomposition
28 
29 Description
30  Tools for performing the minimum decomposition of faces of the
31  mesh into triangles so that the cells may be tet decomposed.
32  Includes functions for finding variable face starting (base)
33  points on each face to avoid the decomposition of cells into tets
34  that have negative or zero volume.
35 
36 SourceFiles
37  polyMeshTetDecomposition.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef polyMeshTetDecomposition_H
42 #define polyMeshTetDecomposition_H
43 
44 #include "polyMesh.H"
45 #include "coupledPolyPatch.H"
46 #include "syncTools.H"
47 #include "tetPointRef.H"
48 #include "tetIndices.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class polyMeshTetDecomposition Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 {
61 
62 public:
63 
64  // Static data members
65 
66  //- Minimum tetrahedron quality
67  static const scalar minTetQuality;
68 
69 
70  // Member Functions
71 
72  //- Given a face and cc and starting index for triangulation determine
73  // the worst tet quality.
74  static scalar minQuality
75  (
76  const polyMesh& mesh,
77  const point& cC,
78  const label fI,
79  const bool isOwner,
80  const label faceBasePtI
81  );
82 
83  //- Find the first suitable base point to use for a minimum
84  // triangle decomposition of the face, suiting owner and
85  // neighbour cells. Finds the first base point on the face
86  // whose worst quality tet from either cell is better than
87  // tolerance. Neighbour cell centre supplied. For coupled
88  // patches.
89  static label findSharedBasePoint
90  (
91  const polyMesh& mesh,
92  label fI,
93  const point& nCc,
94  scalar tol,
95  bool report = false
96  );
97 
98  //- As for findSharedBasePoint, but using neighbour cell
99  // centre from the mesh. For internal faces.
100  static label findSharedBasePoint
101  (
102  const polyMesh& mesh,
103  label fI,
104  scalar tol,
105  bool report = false
106  );
107 
108  //- Find the base point to use for a minimum triangle
109  // decomposition of the face, using only the owner
110  // information. For non-coupled boundary faces.
111  static label findBasePoint
112  (
113  const polyMesh& mesh,
114  label fI,
115  scalar tol,
116  bool report = false
117  );
118 
119  //- Find a suitable base point for each face for decomposition
120  // into tets
122  (
123  const polyMesh& mesh,
124  scalar tol = minTetQuality,
125  bool report = false
126  );
127 
128  //- Check face-decomposition tet volume
129  static bool checkFaceTets
130  (
131  const polyMesh& mesh,
132  scalar tol = minTetQuality,
133  const bool report = false,
134  labelHashSet* setPtr = nullptr
135  );
136 
137  //- Return the tet decomposition of the given face, with
138  // respect to the given cell
140  (
141  const polyMesh& mesh,
142  label fI,
143  label cI
144  );
145 
146  //- Return the tet decomposition of the given cell, see
147  // findFacePt for the meaning of the indices
149  (
150  const polyMesh& mesh,
151  label cI
152  );
153 
154  //- Find the tet decomposition of the cell containing the given point
155  static tetIndices findTet
156  (
157  const polyMesh& mesh,
158  label cI,
159  const point& pt
160  );
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
Foam::polyMeshTetDecomposition::checkFaceTets
static bool checkFaceTets(const polyMesh &mesh, scalar tol=minTetQuality, const bool report=false, labelHashSet *setPtr=nullptr)
Check face-decomposition tet volume.
Definition: polyMeshTetDecomposition.C:345
Foam::polyMeshTetDecomposition::minTetQuality
static const scalar minTetQuality
Minimum tetrahedron quality.
Definition: polyMeshTetDecomposition.H:66
Foam::polyMeshTetDecomposition
Tools for performing the minimum decomposition of faces of the mesh into triangles so that the cells ...
Definition: polyMeshTetDecomposition.H:58
Foam::polyMeshTetDecomposition::findFaceBasePts
static labelList findFaceBasePts(const polyMesh &mesh, scalar tol=minTetQuality, bool report=false)
Find a suitable base point for each face for decomposition.
Definition: polyMeshTetDecomposition.C:186
tetPointRef.H
polyMesh.H
Foam::HashSet< label, Hash< label > >
syncTools.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::polyMeshTetDecomposition::findSharedBasePoint
static label findSharedBasePoint(const polyMesh &mesh, label fI, const point &nCc, scalar tol, bool report=false)
Find the first suitable base point to use for a minimum.
Definition: polyMeshTetDecomposition.C:95
Foam::polyMeshTetDecomposition::findBasePoint
static label findBasePoint(const polyMesh &mesh, label fI, scalar tol, bool report=false)
Find the base point to use for a minimum triangle.
Definition: polyMeshTetDecomposition.C:150
coupledPolyPatch.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::polyMeshTetDecomposition::findTet
static tetIndices findTet(const polyMesh &mesh, label cI, const point &pt)
Find the tet decomposition of the cell containing the given point.
Definition: polyMeshTetDecomposition.C:556
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::tetIndices
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
Definition: tetIndices.H:83
Foam::Vector< scalar >
Foam::List< label >
Foam::polyMeshTetDecomposition::cellTetIndices
static List< tetIndices > cellTetIndices(const polyMesh &mesh, label cI)
Return the tet decomposition of the given cell, see.
Definition: polyMeshTetDecomposition.C:527
Foam::polyMeshTetDecomposition::minQuality
static scalar minQuality(const polyMesh &mesh, const point &cC, const label fI, const bool isOwner, const label faceBasePtI)
Given a face and cc and starting index for triangulation determine.
Definition: polyMeshTetDecomposition.C:42
tetIndices.H
Foam::polyMeshTetDecomposition::faceTetIndices
static List< tetIndices > faceTetIndices(const polyMesh &mesh, label fI, label cI)
Return the tet decomposition of the given face, with.
Definition: polyMeshTetDecomposition.C:503