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>
131 const Point v = (b_ - a_);
138 return s < ROOTVSMALL ?
Zero : v/
s;
148 template<
class Po
int,
class Po
intRef>
159 template<
class Po
int,
class Po
intRef>
172 template<
class Po
int,
class Po
intRef>
182 const scalar
c1 = v & w;
189 const scalar
c2 = v & v;
193 return PointHit<Point>(
false, b_,
Foam::mag(
p - b_),
true);
196 const scalar
b =
c1/
c2;
204 template<
class Po
int,
class Po
intRef>
220 if (magCrossSqr > VSMALL)
222 scalar
s = ((
c ^
b) & crossab)/magCrossSqr;
223 scalar t = ((
c ^ a) & crossab)/magCrossSqr;
226 if (
s >= 0 && s <= 1 && t >= 0 && t <= 1)
229 thisPt = start() + a*
s;
245 scalar edgeDist =
min(edge0.distance(), edge1.distance());
247 if (thisDist < edgeDist)
251 thisPt = this0.
point();
256 thisPt = this1.
point();
262 if (edge0.distance() < edge1.distance())
265 edgePt = edge0.point();
270 edgePt = edge1.point();
280 scalar edge0 = edge.
start() & a;
281 scalar edge1 = edge.
end() & a;
282 bool edgeOrder = edge0 < edge1;
284 scalar minEdge = (edgeOrder ? edge0 : edge1);
285 scalar maxEdge = (edgeOrder ? edge1 : edge0);
286 const Point& minEdgePt = (edgeOrder ? edge.
start() : edge.
end());
287 const Point& maxEdgePt = (edgeOrder ? edge.
end() : edge.
start());
289 scalar this0 = start() & a;
290 scalar this1 =
end() & a;
291 bool thisOrder = this0 < this1;
293 scalar minThis =
min(this0, this1);
294 scalar maxThis =
max(this1, this0);
295 const Point& minThisPt = (thisOrder ? start() :
end());
296 const Point& maxThisPt = (thisOrder ?
end() : start());
298 if (maxEdge < minThis)
304 else if (maxEdge < maxThis)
308 thisPt = nearestDist(edgePt).point();
313 if (minEdge < minThis)
320 else if (minEdge < maxThis)
324 thisPt = nearestDist(edgePt).point();
341 template<
class Po
int,
class Po
intRef>
345 line<Point, PointRef>& l
357 template<
class Po
int,
class Po
intRef>
361 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)