Go to the documentation of this file.
59 const scalar d = E0 & D;
60 const scalar
e = E1 & D;
63 const scalar
det = a*
c -
b*
b;
79 s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
85 t = (
e >= 0 ? 0 : (-
e >=
c ? 1 : -
e/
c));
92 t = (
e >= 0 ? 0 : (-
e >=
c ? 1 : -
e/
c));
99 s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
104 const scalar invDet = 1/
det;
114 const scalar tmp0 =
b + d;
115 const scalar tmp1 =
c +
e;
119 const scalar numer = tmp1 - tmp0;
120 const scalar denom = a-2*
b+
c;
121 s = (numer >= denom ? 1 : numer/denom);
128 t = (tmp1 <= 0 ? 1 : (
e >= 0 ? 0 : -
e/
c));
134 const scalar tmp0 =
b + d;
135 const scalar tmp1 =
c +
e;
139 const scalar numer = tmp1 - tmp0;
140 const scalar denom = a-2*
b+
c;
141 s = (numer >= denom ? 1 : numer/denom);
148 s = (tmp1 <= 0 ? 1 : (d >= 0 ? 0 : - d/a));
154 const scalar numer =
c+
e-(
b+d);
161 const scalar denom = a-2*
b+
c;
162 s = (numer >= denom ? 1 : numer/denom);
174 const scalar
f = D & D;
198 centres[triI] = surface_[triI].centre(
points);
227 <<
"treeBb:" << treeBb
228 <<
" sample:" << sample
319 scalar& nearestDistSqr,
328 label index = indices[i];
370 scalar distSqr = nearestCoords
384 if (distSqr < nearestDistSqr)
386 nearestDistSqr = distSqr;
388 nearestPoint = base +
s*E0 + t*E1;
410 "treeDataTriSurface::findNearest(const labelList&"
411 ", const linePointRef&, treeBoundBox&, label&, point&, point&) const"
421 point& intersectionPoint
438 if ((startBits & endBits) != 0)
446 const vector dir(end - start);
454 intersectionPoint = inter.
hitPoint();
label index() const
Return index.
bool hit() const
Is there a hit.
label getVolumeType(const indexedOctree< treeDataTriSurface > &, const point &) const
Get type (inside, outside, mixed, unknown) of point.
pointField points() const
Get representative point cloud for all shapes inside.
const point & max() const
Maximum describing the bounding box.
Encapsulates data for (indexedOc)tree searches on triSurface.
#define forAll(list, i)
Loop across all elements in list.
This class describes the interaction of a face and a point. It carries the info of a successful hit a...
Standard boundBox + extra functionality for use in octree.
bool hit() const
Is there a hit.
direction posBits(const point &) const
Position of point relative to bounding box.
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.
vector span() const
The bounding box span (from minimum to maximum)
A triangle primitive used to calculate face normals and swept volumes.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
scalar distance() const
Return distance to hit.
static scalar nearestCoords(const point &base, const point &E0, const point &E1, const scalar a, const scalar b, const scalar c, const point &P, scalar &s, scalar &t)
fast triangle nearest point calculation. Returns point in E0, E1
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Pre-declare SubField and related Field type.
Triangulated surface description with patch information.
#define notImplemented(functionName)
Issue a FatalErrorIn for a function not currently implemented.
const Point & hitPoint() const
Return hit point.
Non-pointer based hierarchical recursive searching.
const point & min() const
Minimum describing the bounding box.
void findNearest(const labelList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
Calculates nearest (to sample) point in shape.
errorManip< error > abort(error &err)
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))
const treeBoundBox & bb() const
Top bounding box.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
treeDataTriSurface(const triSurface &)
Construct from triSurface. Holds reference.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const dimensionedScalar e
Elementary charge.
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does (bb of) shape at index overlap bb.
Triangle with additional region number.
bool intersects(const label index, const point &start, const point &end, point &result) const
Calculate intersection of triangle with ray. Sets result.
const dimensionedScalar c
Speed of light in a vacuum.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
void findNearest(const label nodeI, const linePointRef &ln, treeBoundBox &tightest, label &nearestShapeI, point &linePoint, point &nearestPoint, const FindNearestOp &fnOp) const
Find nearest point to line.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
bool overlaps(const boundBox &) const
Overlaps other bounding box?
dimensionedScalar det(const dimensionedSphericalTensor &dt)
defineTypeNameAndDebug(Foam::treeDataTriSurface, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const Point & hitPoint() const
Return hit point.
dimensioned< scalar > magSqr(const dimensioned< Type > &)