34template<
class Po
int,
class Po
intRef>
42template<
class Po
int,
class Po
intRef>
54template<
class Po
int,
class Po
intRef>
63template<
class Po
int,
class Po
intRef>
70template<
class Po
int,
class Po
intRef>
77template<
class Po
int,
class Po
intRef>
84template<
class Po
int,
class Po
intRef>
90template<
class Po
int,
class Po
intRef>
97template<
class Po
int,
class Po
intRef>
100 return 0.5*(a_ + b_);
104template<
class Po
int,
class Po
intRef>
107 return ::Foam::mag(vec());
111template<
class Po
int,
class Po
intRef>
118template<
class Po
int,
class Po
intRef>
121 const Point v = (b_ - a_);
124 return s < ROOTVSMALL ?
Zero : v/
s;
128template<
class Po
int,
class Po
intRef>
138 const scalar c1 = v & w;
145 const scalar c2 = v & v;
152 const scalar
b = c1/c2;
160template<
class Po
int,
class Po
intRef>
169 Point a(end() - start());
176 if (magCrossSqr > VSMALL)
178 scalar
s = ((c ^
b) & crossab)/magCrossSqr;
179 scalar t = ((c ^ a) & crossab)/magCrossSqr;
182 if (
s >= 0 && s <= 1 && t >= 0 && t <= 1)
185 thisPt = start() + a*
s;
203 if (thisDist < edgeDist)
238 bool edgeOrder = edge0 < edge1;
240 scalar minEdge = (edgeOrder ? edge0 : edge1);
241 scalar maxEdge = (edgeOrder ? edge1 : edge0);
245 scalar this0 = start() & a;
246 scalar this1 = end() & a;
247 bool thisOrder = this0 < this1;
249 scalar minThis =
min(this0, this1);
250 scalar maxThis =
max(this1, this0);
251 const Point& minThisPt = (thisOrder ? start() : end());
252 const Point& maxThisPt = (thisOrder ? end() : start());
254 if (maxEdge < minThis)
260 else if (maxEdge < maxThis)
264 thisPt = nearestDist(edgePt).rawPoint();
269 if (minEdge < minThis)
274 edgePt =
edge.nearestDist(thisPt).rawPoint();
276 else if (minEdge < maxThis)
280 thisPt = nearestDist(edgePt).rawPoint();
297template<
class Po
int,
class Po
intRef>
313template<
class Po
int,
class Po
intRef>
317 const line<Point, PointRef>& l
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>.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
bool readBegin(const char *funcName)
Begin read of data chunk, starts with '('.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Describes the interaction of a face and a point. It carries the info of a successful hit and (if succ...
const point_type & rawPoint() const noexcept
The point, no checks.
scalar distance() const noexcept
Return distance to hit.
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 point labels. The functionality it provides supports the discretisation on a...
label end() const
Return end (last/second) vertex label.
label start() const
Return start (first) vertex label.
PointHit< Point > nearestDist(const Point &p) const
Return nearest distance to line from a given point.
PointRef end() const noexcept
Return second (last) point.
PointRef first() const noexcept
Return first point.
PointRef second() const noexcept
Return second (last) point.
Point centre() const
Return centre (centroid)
PointRef last() const noexcept
Return last (second) point.
scalar mag() const
Return scalar magnitude.
Point unitVec() const
Return the unit vector (start-to-end)
PointRef start() const noexcept
Return first point.
Point vec() const
Return start-to-end vector.
@ BEGIN_LIST
Begin list [isseparator].
@ END_LIST
End list [isseparator].
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))
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static constexpr const zero Zero
Global zero (0)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)