50 Foam::scalar Foam::tetOverlapVolume::tetTetOverlapVol
59 typedef cutTetList<27> tetListType;
60 static tetListType cutTetList1, cutTetList2;
63 const plane pl0(tetB.
b(), tetB.
d(), tetB.
c());
67 if (cutTetList1.size() == 0)
73 const plane pl1(tetB.
a(), tetB.
c(), tetB.
d());
75 for (
label i = 0; i < cutTetList1.size(); i++)
80 if (cutTetList2.size() == 0)
86 const plane pl2(tetB.
a(), tetB.
d(), tetB.
b());
88 for (
label i = 0; i < cutTetList2.size(); i++)
93 if (cutTetList1.size() == 0)
99 const plane pl3(tetB.
a(), tetB.
b(), tetB.
c());
101 for (
label i = 0; i < cutTetList1.size(); i++)
121 const point& pt = points[f[fp]];
138 const scalar threshold
141 const cell& cFacesA = meshA.
cells()[cellAI];
144 const cell& cFacesB = meshB.
cells()[cellBI];
151 label faceAI = cFacesA[cFA];
160 bool ownA = (meshA.
faceOwner()[faceAI] == cellAI);
162 label tetBasePtAI = 0;
164 const point& tetBasePtA = meshA.
points()[fA[tetBasePtAI]];
166 for (
label tetPtI = 1; tetPtI < fA.
size() - 1; tetPtI++)
168 label facePtAI = (tetPtI + tetBasePtAI) % fA.
size();
177 pt1I = fA[otherFacePtAI];
181 pt0I = fA[otherFacePtAI];
198 label faceBI = cFacesB[cFB];
207 bool ownB = (meshB.
faceOwner()[faceBI] == cellBI);
209 label tetBasePtBI = 0;
211 const point& tetBasePtB = meshB.
points()[fB[tetBasePtBI]];
213 for (
label tetPtI = 1; tetPtI < fB.
size() - 1; tetPtI++)
215 label facePtBI = (tetPtI + tetBasePtBI) % fB.
size();
224 pt1I = fB[otherFacePtBI];
228 pt0I = fB[otherFacePtBI];
245 vol += tetTetOverlapVol(tetA, tetB);
269 const cell& cFacesA = meshA.
cells()[cellAI];
272 const cell& cFacesB = meshB.
cells()[cellBI];
279 label faceAI = cFacesA[cFA];
288 bool ownA = (meshA.
faceOwner()[faceAI] == cellAI);
290 label tetBasePtAI = 0;
292 const point& tetBasePtA = meshA.
points()[fA[tetBasePtAI]];
294 for (
label tetPtI = 1; tetPtI < fA.
size() - 1; tetPtI++)
296 label facePtAI = (tetPtI + tetBasePtAI) % fA.
size();
305 pt1I = fA[otherFacePtAI];
309 pt0I = fA[otherFacePtAI];
326 label faceBI = cFacesB[cFB];
335 bool ownB = (meshB.
faceOwner()[faceBI] == cellBI);
337 label tetBasePtBI = 0;
339 const point& tetBasePtB = meshB.
points()[fB[tetBasePtBI]];
341 for (
label tetPtI = 1; tetPtI < fB.
size() - 1; tetPtI++)
343 label facePtBI = (tetPtI + tetBasePtBI) % fB.
size();
352 pt1I = fB[otherFacePtBI];
356 pt0I = fB[otherFacePtBI];
372 vol += tetTetOverlapVol(tetA, tetB);
393 return treeA.findBox(bbB);
bool overlaps(const boundBox &) const
Overlaps/touches boundingBox?
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
A face is a list of labels corresponding to mesh vertices.
A 1D vector of objects of type <T> with a fixed size <Size>.
Cell-face mesh analysis engine.
void size(const label)
Override size to be inconsistent with allocated storage.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
const Point & a() const
Return vertices.
virtual const pointField & points() const =0
Return mesh points.
const cellList & cells() const
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
virtual const pointField & points() const
Return raw points.
tetOverlapVolume()
Null constructor.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const vectorField & cellCentres() const
defineTypeNameAndDebug(combustionModel, 0)
const point & max() const
Maximum point defining the bounding box.
const indexedOctree< treeDataCell > & cellTree() const
Return the cell search tree.
boundBox bounds() const
Calculate the bounding box.
Non-pointer based hierarchical recursive searching.
A cell is defined as a list of faces with extra functionality.
virtual const faceList & faces() const =0
Return faces.
Standard boundBox + extra functionality for use in octree.
virtual const labelList & faceOwner() const =0
Face face-owner addressing.
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.
Mesh consisting of general polyhedral cells.
const point & min() const
Minimum point defining the bounding box.
labelList overlappingCells(const polyMesh &meshA, const polyMesh &meshB, const label cellBI) const
Return a list of cells in meshA which overlaps with cellBI in.
scalar cellCellOverlapVolumeMinDecomp(const primitiveMesh &meshA, const label cellAI, const primitiveMesh &meshB, const label cellBI, const treeBoundBox &cellBbB) const
Calculates the overlap volume.
const labelListList & cellPoints() const
cut::opAddResult< AboveOp, BelowOp >::type tetCut(const FixedList< Point, 4 > &tet, const FixedList< scalar, 4 > &level, const AboveOp &aboveOp, const BelowOp &belowOp)
As triCut, but for a tetrahedron.