tetOverlapVolume.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) 2012-2013 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::tetOverlapVolume
26 
27 Description
28  Calculates the overlap volume of two cells using tetrahedral decomposition
29 
30 SourceFiles
31  tetOverlapVolume.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef tetOverlapVolume_H
36 #define tetOverlapVolume_H
37 
38 #include "FixedList.H"
39 #include "labelList.H"
40 #include "treeBoundBox.H"
41 
42 namespace Foam
43 {
44 
45 class primitiveMesh;
46 class polyMesh;
47 class tetPoints;
48 
49 /*---------------------------------------------------------------------------*\
50  Class tetOverlapVolume Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class tetOverlapVolume
54 {
55  // Private member functions
56 
57  //- Tet overlap volume
58  scalar tetTetOverlapVol
59  (
60  const tetPoints& tetA,
61  const tetPoints& tetB
62  ) const;
63 
64  //- Return a const treeBoundBox
65  treeBoundBox pyrBb
66  (
67  const pointField& points,
68  const face& f,
69  const point& fc
70  ) const;
71 
72 
73 public:
74 
75  //- Runtime type information
76  ClassName("tetOverlapVolume");
77 
78 
79  // Constructors
80 
81  //- Null constructor
83 
84 
85  // Public members
86 
87  //- Return a list of cells in meshA which overlaps with cellBI in
88  // meshB
90  (
91  const polyMesh& meshA,
92  const polyMesh& meshB,
93  const label cellBI
94  ) const;
95 
96  //- Return true if olverlap volume is greater than threshold
98  (
99  const primitiveMesh& meshA,
100  const label cellAI,
101  const primitiveMesh& meshB,
102  const label cellBI,
103  const treeBoundBox& cellBbB,
104  const scalar threshold = 0.0
105  ) const;
106 
107  //- Calculates the overlap volume
109  (
110  const primitiveMesh& meshA,
111  const label cellAI,
112 
113  const primitiveMesh& meshB,
114  const label cellBI,
115  const treeBoundBox& cellBbB
116  ) const;
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
labelList overlappingCells(const polyMesh &meshA, const polyMesh &meshB, const label cellBI) const
Return a list of cells in meshA which overlaps with cellBI in.
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
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:74
const pointField & points
tetOverlapVolume()
Null constructor.
Calculates the overlap volume of two cells using tetrahedral decomposition.
ClassName("tetOverlapVolume")
Runtime type information.
labelList f(nPoints)
bool cellCellOverlapMinDecomp(const primitiveMesh &meshA, const label cellAI, const primitiveMesh &meshB, const label cellBI, const treeBoundBox &cellBbB, const scalar threshold=0.0) const
Return true if olverlap volume is greater than threshold.
scalar cellCellOverlapVolumeMinDecomp(const primitiveMesh &meshA, const label cellAI, const primitiveMesh &meshB, const label cellBI, const treeBoundBox &cellBbB) const
Calculates the overlap volume.
Tet storage. Null constructable (unfortunately tetrahedron<point, point> is not)
Definition: tetPoints.H:50
Standard boundBox + extra functionality for use in octree.
Definition: treeBoundBox.H:87
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.