50template<
class Po
int,
class Po
intRef>
62template<
class Po
int,
class Po
intRef>
69 a_(
points[indices.template get<0>()]),
70 b_(
points[indices.template get<1>()])
74template<
class Po
int,
class Po
intRef>
89template<
class Po
int,
class Po
intRef>
98 return 0.5*(
a() +
b());
102template<
class Po
int,
class Po
intRef>
105 return ::Foam::mag(
b() -
a());
111 return ::Foam::mag(
b() -
a());
115template<
class Po
int,
class Po
intRef>
118 return ::Foam::magSqr(
b() -
a());
124 return ::Foam::magSqr(
b() -
a());
128template<
class Po
int,
class Po
intRef>
141template<
class Po
int,
class Po
intRef>
144 const Point v = (b_ - a_);
151 return s < ROOTVSMALL ?
Zero : v/
s;
161template<
class Po
int,
class Po
intRef>
172template<
class Po
int,
class Po
intRef>
185template<
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;
217template<
class Po
int,
class Po
intRef>
226 Point a(end() - start());
233 if (magCrossSqr > VSMALL)
235 scalar
s = ((c ^
b) & crossab)/magCrossSqr;
236 scalar t = ((c ^ a) & crossab)/magCrossSqr;
242 thisPt = start() + a*
s;
251 PointHit<Point> this0(nearestDist(edge.
start()));
252 PointHit<Point> this1(nearestDist(edge.
end()));
253 scalar thisDist =
min(this0.distance(), this1.distance());
258 scalar edgeDist =
min(edge0.distance(), edge1.distance());
260 if (thisDist < edgeDist)
262 if (this0.distance() < this1.distance())
264 thisPt = this0.point();
265 edgePt = edge.
start();
269 thisPt = this1.point();
275 if (edge0.distance() < edge1.distance())
278 edgePt = edge0.point();
283 edgePt = edge1.point();
295 bool edgeOrder = edge0 < edge1;
297 scalar minEdge = (edgeOrder ? edge0 : edge1);
298 scalar maxEdge = (edgeOrder ? edge1 : edge0);
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)
331 edgePt =
edge.nearestDist(thisPt).point();
333 else if (minEdge < maxThis)
337 thisPt = nearestDist(edgePt).point();
354template<
class Po
int,
class Po
intRef>
355inline Foam::Istream& Foam::operator>>
361 is.readBegin(
"line");
370template<
class Po
int,
class Po
intRef>
371inline Foam::Ostream& Foam::operator<<
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
A 1D vector of objects of type <T> with a fixed length <N>.
T & get() noexcept
Element access using compile-time indexing.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
An ordered pair of two objects of type <T> with first() and second() elements.
Describes the interaction of a object and a (templated) point. It carries the info of a successful hi...
scalar distance() const noexcept
Return distance to hit.
const point_type & point() const noexcept
Return the point, no checks.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
label & end() noexcept
The end (second/last) vertex label.
label start() const noexcept
The start (first) vertex label.
vector vec() const
Return start-to-end vector.
linePointRef ln() const
Return as line reference.
const point & b() const noexcept
The second vertex.
Pair< point > box() const
The enclosing (bounding) box for the line.
scalar mag() const
The magnitude (length) of the line.
const point & a() const noexcept
The first vertex.
scalar magSqr() const
The magnitude squared (length squared) of the line.
vector unitVec() const
Return the unit vector (start-to-end).
linePoints()=default
Default construct.
point centre() const
Return centre (centroid).
PointHit< Point > nearestDist(const Point &p) const
Return nearest distance to line from a given point.
PointRef end() const noexcept
The end (second) point.
line(const Point &from, const Point &to)
Construct from two points.
PointRef a() const noexcept
The first point.
Point centre() const
Return centre (centroid).
scalar mag() const
The magnitude (length) of the line.
Point unitVec() const
Return the unit vector (start-to-end).
Pair< Point > box() const
The enclosing (bounding) box for the line.
scalar magSqr() const
The magnitude squared (length squared) of the line.
PointRef b() const noexcept
The second point.
PointRef start() const noexcept
The start (first) point.
Point vec() const
Return start-to-end vector.
@ BEGIN_LIST
Begin list [isseparator].
@ END_LIST
End list [isseparator].
const volScalarField & p0
OBJstream os(runTime.globalPath()/outputName)
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))
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
line< point, const point & > linePointRef
A line using referred points.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
vector point
Point is a vector.
static constexpr const zero Zero
Global zero (0).
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)