polyMeshTetDecomposition.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-2020 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  //- Given a face and cc and starting index for triangulation determine
71  // the worst tet quality.
72  static scalar minQuality
73  (
74  const polyMesh& mesh,
75  const point& cC,
76  const label fI,
77  const bool isOwner,
78  const label faceBasePtI
79  );
80 
81  //- Find the first suitable base point to use for a minimum
82  // triangle decomposition of the face, suiting owner and
83  // neighbour cells. Finds the first base point on the face
84  // whose worst quality tet from either cell is better than
85  // tolerance. Neighbour cell centre supplied. For coupled
86  // patches.
88  (
89  const polyMesh& mesh,
90  label fI,
91  const point& nCc,
92  scalar tol,
93  bool report = false
94  );
95 
96  //- As for findSharedBasePoint, but using neighbour cell
97  // centre from the mesh. For internal faces.
99  (
100  const polyMesh& mesh,
101  label fI,
102  scalar tol,
103  bool report = false
104  );
105 
106  //- Find the base point to use for a minimum triangle
107  // decomposition of the face, using only the owner
108  // information. For non-coupled boundary faces.
109  static label findBasePoint
110  (
111  const polyMesh& mesh,
112  label fI,
113  scalar tol,
114  bool report = false
115  );
116 
117  //- Find a suitable base point for each face for decomposition
118  // into tets
120  (
121  const polyMesh& mesh,
122  scalar tol = minTetQuality,
123  bool report = false
124  );
125 
126  //- Check face-decomposition tet volume
127  static bool checkFaceTets
128  (
129  const polyMesh& mesh,
130  scalar tol = minTetQuality,
131  const bool report = false,
132  labelHashSet* setPtr = nullptr
133  );
134 
135  //- Return the tet decomposition of the given face, with
136  // respect to the given cell
138  (
139  const polyMesh& mesh,
140  label fI,
141  label cI
142  );
143 
144  //- Return the tet decomposition of the given cell, see
145  // findFacePt for the meaning of the indices
147  (
148  const polyMesh& mesh,
149  label cI
150  );
151 
152  //- Find the tet decomposition of the cell containing the given point
153  static tetIndices findTet
154  (
155  const polyMesh& mesh,
156  label cI,
157  const point& pt
158  );
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
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 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.
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.