48 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());
68 const FixedList<point, 4> t({tetA.
a(), tetA.
b(), tetA.
c(), tetA.
d()});
70 tetCut(t, pl0, cutTriTet::appendOp<tetListType>(cutTetList1), noOp());
71 if (cutTetList1.size() == 0)
77 const plane pl1(tetB.
a(), tetB.
c(), tetB.
d());
83 for (
label i = 0; i < cutTetList1.size(); i++)
85 const FixedList<point, 4>& t = cutTetList1[i];
86 tetCut(t, pl1, cutTriTet::appendOp<tetListType>(cutTetList2), noOp());
88 if (cutTetList2.size() == 0)
94 const plane pl2(tetB.
a(), tetB.
d(), tetB.
b());
100 for (
label i = 0; i < cutTetList2.size(); i++)
102 const FixedList<point, 4>& t = cutTetList2[i];
103 tetCut(t, pl2, cutTriTet::appendOp<tetListType>(cutTetList1), noOp());
105 if (cutTetList1.size() == 0)
111 const plane pl3(tetB.
a(), tetB.
b(), tetB.
c());
117 for (
label i = 0; i < cutTetList1.size(); i++)
119 const FixedList<point, 4>& t = cutTetList1[i];
120 v +=
tetCut(t, pl3, cutTriTet::volumeOp(), noOp());
134 treeBoundBox bb(fc, fc);
138 bb.min() =
min(bb.min(), pt);
139 bb.max() =
max(bb.max(), pt);
160 label faceI = cFaces[cF];
166 label tetBasePtI = 0;
170 for (
label tetPtI = 1; tetPtI <
f.
size() - 1; tetPtI++)
172 label facePtI = (tetPtI + tetBasePtI) %
f.
size();
181 pt1I =
f[otherFacePtI];
185 pt0I =
f[otherFacePtI];
212 const scalar threshold
215 const cell& cFacesA = meshA.
cells()[cellAI];
218 const cell& cFacesB = meshB.
cells()[cellBI];
225 label faceAI = cFacesA[cFA];
234 bool ownA = (meshA.
faceOwner()[faceAI] == cellAI);
236 label tetBasePtAI = 0;
238 const point& tetBasePtA = meshA.
points()[fA[tetBasePtAI]];
240 for (
label tetPtI = 1; tetPtI < fA.
size() - 1; tetPtI++)
242 label facePtAI = (tetPtI + tetBasePtAI) % fA.
size();
251 pt1I = fA[otherFacePtAI];
255 pt0I = fA[otherFacePtAI];
272 label faceBI = cFacesB[cFB];
281 bool ownB = (meshB.
faceOwner()[faceBI] == cellBI);
283 label tetBasePtBI = 0;
285 const point& tetBasePtB = meshB.
points()[fB[tetBasePtBI]];
287 for (
label tetPtI = 1; tetPtI < fB.
size() - 1; tetPtI++)
289 label facePtBI = (tetPtI + tetBasePtBI) % fB.
size();
298 pt1I = fB[otherFacePtBI];
302 pt0I = fB[otherFacePtBI];
319 vol += tetTetOverlapVol(tetA, tetB);
343 const cell& cFacesA = meshA.
cells()[cellAI];
346 const cell& cFacesB = meshB.
cells()[cellBI];
353 label faceAI = cFacesA[cFA];
362 bool ownA = (meshA.
faceOwner()[faceAI] == cellAI);
364 label tetBasePtAI = 0;
366 const point& tetBasePtA = meshA.
points()[fA[tetBasePtAI]];
368 for (
label tetPtI = 1; tetPtI < fA.
size() - 1; tetPtI++)
370 label facePtAI = (tetPtI + tetBasePtAI) % fA.
size();
379 pt1I = fA[otherFacePtAI];
383 pt0I = fA[otherFacePtAI];
400 label faceBI = cFacesB[cFB];
409 bool ownB = (meshB.
faceOwner()[faceBI] == cellBI);
411 label tetBasePtBI = 0;
413 const point& tetBasePtB = meshB.
points()[fB[tetBasePtBI]];
415 for (
label tetPtI = 1; tetPtI < fB.
size() - 1; tetPtI++)
417 label facePtBI = (tetPtI + tetBasePtBI) % fB.
size();
426 pt1I = fB[otherFacePtBI];
430 pt0I = fB[otherFacePtBI];
446 vol += tetTetOverlapVol(tetA, tetB);
#define forAll(list, i)
Loop across all elements in list.
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.
bool overlaps(const boundBox &) const
Overlaps/touches boundingBox?
A cell is defined as a list of faces with extra functionality.
A face is a list of labels corresponding to mesh vertices.
Geometric class that creates a 2D plane and can return the intersection point between a line and the ...
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
virtual const pointField & points() const
Return raw points.
Cell-face mesh analysis engine.
virtual const faceList & faces() const =0
Return faces.
const vectorField & cellCentres() const
virtual const labelList & faceOwner() const =0
Face face-owner addressing.
virtual const pointField & points() const =0
Return mesh points.
const cellList & cells() const
Calculates the overlap volume of two cells using tetrahedral decomposition.
scalar cellCellOverlapVolumeMinDecomp(const primitiveMesh &meshA, const label cellAI, const primitiveMesh &meshB, const label cellBI, const treeBoundBox &cellBbB) const
Calculates the overlap volume.
scalar cellVolumeMinDecomp(const primitiveMesh &mesh, const label celli) const
Calculates the cell volume.
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.
tetOverlapVolume()
Null constructor.
boundBox bounds() const
Calculate the bounding box.
const Point & a() const
Return vertices.
scalar mag() const
Return volume.
Standard boundBox + extra functionality for use in octree.
bool overlaps(const boundBox &) const
Overlaps other bounding box?
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
cutTriTet::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.
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)