51 Foam::scalar Foam::tetOverlapVolume::tetTetOverlapVol
67 if ((tetA.
tet().
mag() < SMALL*SMALL) || (tetB.
tet().
mag() < SMALL*SMALL))
73 plane pl0(tetB[1], tetB[3], tetB[2]);
81 plane pl1(tetB[0], tetB[2], tetB[3]);
83 for (
label i = 0; i < nCutInside; i++)
94 plane pl2(tetB[0], tetB[3], tetB[1]);
96 for (
label i = 0; i < nInside; i++)
107 plane pl3(tetB[0], tetB[1], tetB[2]);
108 for (
label i = 0; i < nCutInside; i++)
114 return volInside.
vol_;
128 const point& pt = points[f[fp]];
145 const scalar threshold
148 const cell& cFacesA = meshA.
cells()[cellAI];
151 const cell& cFacesB = meshB.
cells()[cellBI];
158 label faceAI = cFacesA[cFA];
167 bool ownA = (meshA.
faceOwner()[faceAI] == cellAI);
169 label tetBasePtAI = 0;
171 const point& tetBasePtA = meshA.
points()[fA[tetBasePtAI]];
173 for (
label tetPtI = 1; tetPtI < fA.
size() - 1; tetPtI++)
175 label facePtAI = (tetPtI + tetBasePtAI) % fA.
size();
184 pt1I = fA[otherFacePtAI];
188 pt0I = fA[otherFacePtAI];
205 label faceBI = cFacesB[cFB];
214 bool ownB = (meshB.
faceOwner()[faceBI] == cellBI);
216 label tetBasePtBI = 0;
218 const point& tetBasePtB = meshB.
points()[fB[tetBasePtBI]];
220 for (
label tetPtI = 1; tetPtI < fB.
size() - 1; tetPtI++)
222 label facePtBI = (tetPtI + tetBasePtBI) % fB.
size();
231 pt1I = fB[otherFacePtBI];
235 pt0I = fB[otherFacePtBI];
252 vol += tetTetOverlapVol(tetA, tetB);
276 const cell& cFacesA = meshA.
cells()[cellAI];
279 const cell& cFacesB = meshB.
cells()[cellBI];
286 label faceAI = cFacesA[cFA];
295 bool ownA = (meshA.
faceOwner()[faceAI] == cellAI);
297 label tetBasePtAI = 0;
299 const point& tetBasePtA = meshA.
points()[fA[tetBasePtAI]];
301 for (
label tetPtI = 1; tetPtI < fA.
size() - 1; tetPtI++)
303 label facePtAI = (tetPtI + tetBasePtAI) % fA.
size();
312 pt1I = fA[otherFacePtAI];
316 pt0I = fA[otherFacePtAI];
333 label faceBI = cFacesB[cFB];
342 bool ownB = (meshB.
faceOwner()[faceBI] == cellBI);
344 label tetBasePtBI = 0;
346 const point& tetBasePtB = meshB.
points()[fB[tetBasePtBI]];
348 for (
label tetPtI = 1; tetPtI < fB.
size() - 1; tetPtI++)
350 label facePtBI = (tetPtI + tetBasePtBI) % fB.
size();
359 pt1I = fB[otherFacePtBI];
363 pt0I = fB[otherFacePtBI];
379 vol += tetTetOverlapVol(tetA, tetB);
400 return treeA.findBox(bbB);
labelList overlappingCells(const polyMesh &meshA, const polyMesh &meshB, const label cellBI) const
Return a list of cells in meshA which overlaps with cellBI in.
#define forAll(list, i)
Loop across all elements in list.
const indexedOctree< treeDataCell > & cellTree() const
Return the cell search tree.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A face is a list of labels corresponding to mesh vertices.
A 1D vector of objects of type <T> with a fixed size <Size>.
const point & min() const
Minimum describing the bounding box.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Cell-face mesh analysis engine.
void size(const label)
Override size to be inconsistent with allocated storage.
const labelListList & cellPoints() const
virtual const pointField & points() const =0
Return mesh points.
const point & max() const
Maximum describing the bounding box.
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
const cellList & cells() const
virtual const pointField & points() const
Return raw points.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
treeBoundBox bounds() const
Calculate the bounding box.
tetOverlapVolume()
Null constructor.
const vectorField & cellCentres() const
defineTypeNameAndDebug(combustionModel, 0)
scalar mag() const
Return volume.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
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.
tetPointRef tet() const
Return the tetrahedron.
scalar cellCellOverlapVolumeMinDecomp(const primitiveMesh &meshA, const label cellAI, const primitiveMesh &meshB, const label cellBI, const treeBoundBox &cellBbB) const
Calculates the overlap volume.
Non-pointer based hierarchical recursive searching.
void sliceWithPlane(const plane &pl, AboveTetOp &aboveOp, BelowTetOp &belowOp) const
Decompose tet into tets above and below plane.
Tet storage. Null constructable (unfortunately tetrahedron<point, point> is not)
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 addresing.
Mesh consisting of general polyhedral cells.
bool overlaps(const boundBox &) const
Overlaps/touches boundingBox?