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);
const labelListList & cellPoints() const
tetOverlapVolume()
Null constructor.
const point & min() const
Minimum describing the bounding box.
virtual const pointField & points() const =0
Return mesh points.
tetPointRef tet() const
Return the tetrahedron.
A cell is defined as a list of faces with extra functionality.
treeBoundBox bounds() const
Calculate the bounding box.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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.
Standard boundBox + extra functionality for use in octree.
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 cellList & cells() const
const vectorField & cellCentres() const
virtual const faceList & faces() const =0
Return faces.
A 1D vector of objects of type <T> with a fixed size <Size>.
void sliceWithPlane(const plane &pl, AboveTetOp &aboveOp, BelowTetOp &belowOp) const
Decompose tet into tets above and below plane.
scalar mag() const
Return volume.
A face is a list of labels corresponding to mesh vertices.
Cell-face mesh analysis engine.
virtual const pointField & points() const
Return raw points.
scalar cellCellOverlapVolumeMinDecomp(const primitiveMesh &meshA, const label cellAI, const primitiveMesh &meshB, const label cellBI, const treeBoundBox &cellBbB) const
Calculates the overlap volume.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const indexedOctree< treeDataCell > & cellTree() const
Return the cell search tree.
const point & max() const
Maximum describing the bounding box.
Non-pointer based hierarchical recursive searching.
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
Mesh consisting of general polyhedral cells.
labelList overlappingCells(const polyMesh &meshA, const polyMesh &meshB, const label cellBI) const
Return a list of cells in meshA which overlaps with cellBI in.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
virtual const labelList & faceOwner() const =0
Face face-owner addresing.
bool overlaps(const boundBox &) const
Overlaps/touches boundingBox?
Tet storage. Null constructable (unfortunately tetrahedron<point, point> is not)
defineTypeNameAndDebug(combustionModel, 0)