Go to the documentation of this file.
38 void Foam::triangleFuncs::setIntersection
40 const point& oppositeSidePt,
41 const scalar oppositeSign,
43 const point& thisSidePt,
44 const scalar thisSign,
51 const scalar denom = oppositeSign - thisSign;
60 pt = oppositeSidePt + oppositeSign/denom*(thisSidePt - oppositeSidePt);
74 const scalar maxLength,
83 label i1 = (i0 + 1) % 3;
84 label i2 = (i1 + 1) % 3;
94 scalar
det = v2*u1 - u2*v1;
100 if (localScale < VSMALL ||
Foam::mag(
det)/localScale < SMALL)
108 const point& P = origin[originI];
110 scalar
u0 = P[i1] - V0[i1];
111 scalar v0 = P[i2] - V0[i2];
139 scalar
s = (pInter - origin[originI])[i0];
141 if ((
s >= 0) && (
s <= maxLength))
170 const edge&
e = es[i];
223 scalar magArea =
mag(na);
226 if (
mag(na & normal) > (1 - SMALL))
232 const point va1 = va0 + va10;
233 const point va2 = va0 + va20;
236 scalar sign0 = (va0 - base) & normal;
237 scalar sign1 = (va1 - base) & normal;
238 scalar sign2 = (va2 - base) & normal;
240 label oppositeVertex = -1;
303 if (oppositeVertex == 0)
306 setIntersection(va0, sign0, va1, sign1, tol, pInter0);
307 setIntersection(va0, sign0, va2, sign2, tol, pInter1);
309 else if (oppositeVertex == 1)
312 setIntersection(va1, sign1, va0, sign0, tol, pInter0);
313 setIntersection(va1, sign1, va2, sign2, tol, pInter1);
318 setIntersection(va2, sign2, va0, sign0, tol, pInter0);
319 setIntersection(va2, sign2, va1, sign1, tol, pInter1);
350 if (!intersect(va0, va10, va20, vb0, nb, planeB0, planeB1))
358 if (!intersect(vb0, vb10, vb20, va0, na, planeA0, planeA1))
381 sortCoords[0] = coordB0;
385 sortCoords[1] = coordB1;
389 sortCoords[2] = coordA0;
393 sortCoords[3] = coordA1;
399 if (isFromB[indices[0]] == isFromB[indices[1]])
408 pInter0 = *pts[indices[1]];
409 pInter1 = *pts[indices[2]];
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
void sort()
Forward (stable) sort the list (if changed after construction).
tmp< pointField > points() const
Vertex coordinates. In octant coding.
Describes the interaction of a face and a point. It carries the info of a successful hit and (if succ...
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 with extra functionality for use in octree.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
scalar distance() const noexcept
Return distance to hit.
static const edgeList edges
Edge to point addressing.
#define forAll(list, i)
Loop across all elements in list.
static bool intersectBb(const point &p0, const point &p1, const point &p2, const treeBoundBox &cubeBb)
Intersect triangle with bounding box.
A triangle primitive used to calculate face normals and swept volumes.
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,.
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
A list that is sorted upon construction or when explicitly requested with the sort() method.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const dimensionedScalar e
Elementary charge.
pointHit intersection(const point &p, const vector &q, const intersection::algorithm alg, const scalar tol=0.0) const
Fast intersection with a ray.
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)
Intersect triangle with plane.
const volScalarField & p0
vector point
Point is a vector.
bool hit() const noexcept
Is there a hit.