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 | Copyright (C) 2011-2017 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 Class
25  Foam::polyMeshTetDecomposition
26 
27 Description
28  Tools for performing the minimum decomposition of faces of the
29  mesh into triangles so that the cells may be tet decomposed.
30  Includes functions for finding variable face starting (base)
31  points on each face to avoid the decomposition of cells into tets
32  that have negative or zero volume.
33 
34 SourceFiles
35  polyMeshTetDecomposition.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef polyMeshTetDecomposition_H
40 #define polyMeshTetDecomposition_H
41 
42 #include "polyMesh.H"
43 #include "coupledPolyPatch.H"
44 #include "syncTools.H"
45 #include "tetPointRef.H"
46 #include "tetIndices.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class polyMeshTetDecomposition Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 {
59 
60 public:
61 
62  // Static data members
63 
64  //- Minimum tetrahedron quality
65  static const scalar minTetQuality;
66 
67 
68  // Member Functions
69 
70  //- Find the first suitable base point to use for a minimum
71  // triangle decomposition of the face, suiting owner and
72  // neighbour cells. Finds the first base point on the face
73  // whose worst quality tet from either cell is better than
74  // tolerance. Neighbour cell centre supplied. For coupled
75  // patches.
77  (
78  const polyMesh& mesh,
79  label fI,
80  const point& nCc,
81  scalar tol,
82  bool report = false
83  );
84 
85  //- As for findSharedBasePoint, but using neighbour cell
86  // centre from the mesh. For internal faces.
88  (
89  const polyMesh& mesh,
90  label fI,
91  scalar tol,
92  bool report = false
93  );
94 
95  //- Find the base point to use for a minimum triangle
96  // decomposition of the face, using only the owner
97  // information. For non-coupled boundary faces.
98  static label findBasePoint
99  (
100  const polyMesh& mesh,
101  label fI,
102  scalar tol,
103  bool report = false
104  );
105 
106  //- Find a suitable base point for each face for decomposition
107  // into tets
109  (
110  const polyMesh& mesh,
111  scalar tol = minTetQuality,
112  bool report = false
113  );
114 
115  //- Check face-decomposition tet volume
116  static bool checkFaceTets
117  (
118  const polyMesh& mesh,
119  scalar tol = minTetQuality,
120  const bool report = false,
121  labelHashSet* setPtr = nullptr
122  );
123 
124  //- Return the tet decomposition of the given face, with
125  // respect to the given cell
127  (
128  const polyMesh& mesh,
129  label fI,
130  label cI
131  );
132 
133  //- Return the tet decomposition of the given cell, see
134  // findFacePt for the meaning of the indices
136  (
137  const polyMesh& mesh,
138  label cI
139  );
140 
141  //- Find the tet decomposition of the cell containing the given point
142  static tetIndices findTet
143  (
144  const polyMesh& mesh,
145  label cI,
146  const point& pt
147  );
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
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
static labelList findFaceBasePts(const polyMesh &mesh, scalar tol=minTetQuality, bool report=false)
Find a suitable base point for each face for decomposition.
static label findBasePoint(const polyMesh &mesh, label fI, scalar tol, bool report=false)
Find the base point to use for a minimum triangle.
static List< tetIndices > cellTetIndices(const polyMesh &mesh, label cI)
Return the tet decomposition of the given cell, see.
static tetIndices findTet(const polyMesh &mesh, label cI, const point &pt)
Find the tet decomposition of the cell containing the given point.
static bool checkFaceTets(const polyMesh &mesh, scalar tol=minTetQuality, const bool report=false, labelHashSet *setPtr=nullptr)
Check face-decomposition tet volume.
dynamicFvMesh & mesh
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.
Tools for performing the minimum decomposition of faces of the mesh into triangles so that the cells ...
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
Definition: tetIndices.H:81
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
static const scalar minTetQuality
Minimum tetrahedron quality.
Namespace for OpenFOAM.
static List< tetIndices > faceTetIndices(const polyMesh &mesh, label fI, label cI)
Return the tet decomposition of the given face, with.