53 scalar
s = v.
perp(w) / d;
59 else if (
s >= (1-SMALL))
69 scalar t = u.
perp(w) / d;
75 else if (t >= (1-SMALL))
81 edgePt =
e.start()+t*v;
89 scalar edge0 =
e.start() & u;
90 scalar edge1 =
e.end() & u;
91 bool edgeOrder = edge0 < edge1;
93 scalar minEdge = (edgeOrder ? edge0 : edge1);
94 scalar maxEdge = (edgeOrder ? edge1 : edge0);
95 const point2D& minEdgePt = (edgeOrder ?
e.start() :
e.end());
96 const point2D& maxEdgePt = (edgeOrder ?
e.end() :
e.start());
98 scalar this0 = start() & u;
99 scalar this1 =
end() & u;
100 bool thisOrder = this0 < this1;
102 scalar minThis =
min(this0, this1);
103 scalar maxThis =
max(this1, this0);
104 const point2D& minThisPt = (thisOrder ? start() :
end());
105 const point2D& maxThisPt = (thisOrder ?
end() : start());
107 if (maxEdge < minThis)
113 else if (maxEdge < maxThis)
117 thisPt = nearestDist(edgePt).point();
122 if (minEdge < minThis)
127 edgePt =
e.nearestDist(thisPt).point();
129 else if (minEdge < maxThis)
133 thisPt = nearestDist(edgePt).point();
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
scalar perp(const Vector2D< Cmpt > &b) const
Perp dot product (dot product with perpendicular vector)
const dimensionedScalar e
Elementary charge.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
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))
PointHit< Point > nearestDist(const Point &p) const
Return nearest distance to line from a given point.