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>
134 return s < ROOTVSMALL ?
Zero : v/
s;
144 template<
class Po
int,
class Po
intRef>
155 template<
class Po
int,
class Po
intRef>
168 template<
class Po
int,
class Po
intRef>
178 const scalar
c1 = v & w;
185 const scalar
c2 = v & v;
189 return PointHit<Point>(
false, b_,
Foam::mag(
p - b_),
true);
192 const scalar
b =
c1/
c2;
200 template<
class Po
int,
class Po
intRef>
216 if (magCrossSqr > VSMALL)
218 scalar
s = ((
c ^
b) & crossab)/magCrossSqr;
219 scalar t = ((
c ^ a) & crossab)/magCrossSqr;
222 if (
s >= 0 && s <= 1 && t >= 0 && t <= 1)
225 thisPt = start() + a*
s;
241 scalar edgeDist =
min(edge0.distance(), edge1.distance());
243 if (thisDist < edgeDist)
247 thisPt = this0.
point();
252 thisPt = this1.
point();
258 if (edge0.distance() < edge1.distance())
261 edgePt = edge0.point();
266 edgePt = edge1.point();
276 scalar edge0 = edge.
start() & a;
277 scalar edge1 = edge.
end() & a;
278 bool edgeOrder = edge0 < edge1;
280 scalar minEdge = (edgeOrder ? edge0 : edge1);
281 scalar maxEdge = (edgeOrder ? edge1 : edge0);
282 const Point& minEdgePt = (edgeOrder ? edge.
start() : edge.
end());
283 const Point& maxEdgePt = (edgeOrder ? edge.
end() : edge.
start());
285 scalar this0 = start() & a;
286 scalar this1 =
end() & a;
287 bool thisOrder = this0 < this1;
289 scalar minThis =
min(this0, this1);
290 scalar maxThis =
max(this1, this0);
291 const Point& minThisPt = (thisOrder ? start() :
end());
292 const Point& maxThisPt = (thisOrder ?
end() : start());
294 if (maxEdge < minThis)
300 else if (maxEdge < maxThis)
304 thisPt = nearestDist(edgePt).point();
309 if (minEdge < minThis)
316 else if (minEdge < maxThis)
320 thisPt = nearestDist(edgePt).point();
337 template<
class Po
int,
class Po
intRef>
341 line<Point, PointRef>& l
353 template<
class Po
int,
class Po
intRef>
357 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].
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...
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
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.
label end() const noexcept
The end (last/second) vertex label.
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))
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)
static constexpr const zero Zero
Global zero (0)