Go to the documentation of this file.
36 const point& oppositeSidePt,
37 const scalar oppositeSign,
39 const point& thisSidePt,
40 const scalar thisSign,
47 scalar denom = oppositeSign - thisSign;
56 pt = oppositeSidePt + oppositeSign/denom*(thisSidePt - oppositeSidePt);
91 const scalar maxLength,
100 label i1 = (i0 + 1) % 3;
101 label i2 = (i1 + 1) % 3;
111 scalar
det = v2*u1 - u2*v1;
117 if (localScale < VSMALL ||
Foam::mag(
det)/localScale < SMALL)
125 const point& P = origin[originI];
127 scalar
u0 = P[i1] - V0[i1];
128 scalar v0 = P[i2] - V0[i2];
156 scalar
s = (pInter - origin[originI])[i0];
158 if ((
s >= 0) && (
s <= maxLength))
179 const vector p10 = p1 - p0;
180 const vector p20 = p2 - p0;
207 scalar maxSx =
max.x() -
min.x();
209 if (intersectAxesBundle(p0, p10, p20, 0, origin, maxSx, pInter))
220 scalar maxSy =
max.y() -
min.y();
222 if (intersectAxesBundle(p0, p10, p20, 1, origin, maxSy, pInter))
233 scalar maxSz =
max.z() -
min.z();
235 if (intersectAxesBundle(p0, p10, p20, 2, origin, maxSz, pInter))
540 scalar magArea =
mag(na);
549 const point va1 = va0 + va10;
550 const point va2 = va0 + va20;
553 scalar sign0 = (va0 - base) &
normal;
554 scalar sign1 = (va1 - base) &
normal;
555 scalar sign2 = (va2 - base) &
normal;
557 label oppositeVertex = -1;
620 if (oppositeVertex == 0)
623 setIntersection(va0, sign0, va1, sign1, tol, pInter0);
624 setIntersection(va0, sign0, va2, sign2, tol, pInter1);
626 else if (oppositeVertex == 1)
629 setIntersection(va1, sign1, va0, sign0, tol, pInter0);
630 setIntersection(va1, sign1, va2, sign2, tol, pInter1);
635 setIntersection(va2, sign2, va0, sign0, tol, pInter0);
636 setIntersection(va2, sign2, va1, sign1, tol, pInter1);
667 if (!
intersect(va0, va10, va20, vb0, nb, planeB0, planeB1))
675 if (!
intersect(vb0, vb10, vb20, va0, na, planeA0, planeA1))
698 sortCoords[0] = coordB0;
702 sortCoords[1] = coordB1;
706 sortCoords[2] = coordA0;
710 sortCoords[3] = coordA1;
716 if (isFromB[indices[0]] == isFromB[indices[1]])
725 pInter0 = *pts[indices[1]];
726 pInter1 = *pts[indices[2]];
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
const point & max() const
Maximum describing the bounding box.
void sort()
(stable) sort the list (if changed after construction time)
#define forAll(list, i)
Loop across all elements in list.
static bool intersectAxesBundle(const point &V0, const point &V10, const point &V20, const label i0, const pointField &origin, const scalar maxLength, point &pInter)
Intersect triangle with parallel edges aligned with axis i0.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Standard boundBox + extra functionality for use in octree.
dimensioned< scalar > mag(const dimensioned< Type > &)
static bool intersectBb(const point &p0, const point &p1, const point &p2, const treeBoundBox &cubeBb)
Does triangle intersect bounding box.
static void setIntersection(const point &oppositeSidePt, const scalar oppositeSign, const point &thisSidePt, const scalar thisSign, const scalar tol, point &pt)
Helper function for intersect. Sets pt to be anywhere on the edge.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
bool intersects(const point &overallStart, const vector &overallVec, const point &start, const point &end, point &pt, direction &ptBits) const
Intersects segment; set point to intersection position and face,.
static void selectPt(const bool select0, const point &p0, const point &p1, point &min)
Helper function.
const point & min() const
Minimum describing the bounding box.
Raster intersect(const Raster &rast1, const Raster &rast2)
A list that is sorted upon construction or when explicitly requested with the sort() method.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar sqrt(const dimensionedScalar &ds)
const labelList & indices() const
Return the list of sorted indices. Updated every sort.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
static bool intersect(const point &va0, const point &va10, const point &va20, const point &basePoint, const vector &normal, point &pInter0, point &pInter1)
Does triangle intersect plane. Return bool and set intersection segment.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
A normal distribution model.