50 template<
class Po
int,
class Po
intRef>
62 template<
class Po
int,
class Po
intRef>
74 template<
class Po
int,
class Po
intRef>
89 template<
class Po
int,
class Po
intRef>
98 return 0.5*(a() +
b());
102 template<
class Po
int,
class Po
intRef>
115 template<
class Po
int,
class Po
intRef>
128 template<
class Po
int,
class Po
intRef>
141 template<
class Po
int,
class Po
intRef>
144 const Point v = (b_ - a_);
151 return s < ROOTVSMALL ?
Zero : v/
s;
161 template<
class Po
int,
class Po
intRef>
172 template<
class Po
int,
class Po
intRef>
185 template<
class Po
int,
class Po
intRef>
195 const scalar
c1 = v & w;
202 const scalar
c2 = v & v;
206 return PointHit<Point>(
false, b_,
Foam::mag(
p - b_),
true);
209 const scalar
b =
c1/
c2;
217 template<
class Po
int,
class Po
intRef>
233 if (magCrossSqr > VSMALL)
235 scalar
s = ((
c ^
b) & crossab)/magCrossSqr;
236 scalar t = ((
c ^ a) & crossab)/magCrossSqr;
239 if (
s >= 0 && s <= 1 && t >= 0 && t <= 1)
242 thisPt = start() + a*
s;
258 scalar edgeDist =
min(edge0.distance(), edge1.distance());
260 if (thisDist < edgeDist)
264 thisPt = this0.
point();
269 thisPt = this1.
point();
275 if (edge0.distance() < edge1.distance())
278 edgePt = edge0.point();
283 edgePt = edge1.point();
293 scalar edge0 = edge.
start() & a;
294 scalar edge1 = edge.
end() & a;
295 bool edgeOrder = edge0 < edge1;
297 scalar minEdge = (edgeOrder ? edge0 : edge1);
298 scalar maxEdge = (edgeOrder ? edge1 : edge0);
299 const Point& minEdgePt = (edgeOrder ? edge.
start() : edge.
end());
300 const Point& maxEdgePt = (edgeOrder ? edge.
end() : edge.
start());
302 scalar this0 = start() & a;
303 scalar this1 =
end() & a;
304 bool thisOrder = this0 < this1;
306 scalar minThis =
min(this0, this1);
307 scalar maxThis =
max(this1, this0);
308 const Point& minThisPt = (thisOrder ? start() :
end());
309 const Point& maxThisPt = (thisOrder ?
end() : start());
311 if (maxEdge < minThis)
317 else if (maxEdge < maxThis)
321 thisPt = nearestDist(edgePt).point();
326 if (minEdge < minThis)
333 else if (minEdge < maxThis)
337 thisPt = nearestDist(edgePt).point();
354 template<
class Po
int,
class Po
intRef>
358 line<Point, PointRef>& l
370 template<
class Po
int,
class Po
intRef>
374 const line<Point, PointRef>& l
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
Point unitVec() const
Return the unit vector (start-to-end)
line(const Point &from, const Point &to)
Construct from two points.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
linePointRef ln() const
Return as line reference.
scalar mag() const
The magnitude (length) of the line.
bool readBegin(const char *funcName)
Begin read of data chunk, starts with '('.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Pair< point > box() const
The enclosing (bounding) box for the line.
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
scalar mag() const
The magnitude (length) of the line.
Begin list [isseparator].
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
PointRef end() const noexcept
The end (second) point.
Pair< Point > box() const
The enclosing (bounding) box for the line.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
vector vec() const
Return start-to-end vector.
label start() const noexcept
The start (first) vertex label.
vector unitVec() const
Return the unit vector (start-to-end)
linePoints()=default
Default construct.
An ordered pair of two objects of type <T> with first() and second() elements.
line< point, const point & > linePointRef
A line using referred points.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
scalar magSqr() const
The magnitude squared (length squared) of the line.
Describes the interaction of a object and a (templated) point. It carries the info of a successful hi...
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
point centre() const
Return centre (centroid)
Point centre() const
Return centre (centroid)
Point vec() const
Return start-to-end vector.
const dimensionedScalar c
Speed of light in a vacuum.
scalar distance() const noexcept
Return distance to hit.
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
const point_type & point() const noexcept
Return the point, no checks.
PointRef start() const noexcept
The start (first) point.
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))
scalar magSqr() const
The magnitude squared (length squared) of the line.
PointHit< Point > nearestDist(const Point &p) const
Return nearest distance to line from a given point.
const volScalarField & p0
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
label & end() noexcept
The end (second/last) vertex label.
static constexpr const zero Zero
Global zero (0)