Go to the documentation of this file.
120 return (first() < second() ? first() : second());
126 return (first() > second() ? first() : second());
132 return (first() != second() && first() >= 0 && second() >= 0);
142 && (pointLabel == first() || pointLabel == second())
152 if (pointLabel == first())
156 if (pointLabel == second())
168 return (other.
found(first()) || other.
found(second()));
174 if (other.
found(first()))
178 if (other.
found(second()))
190 if (pointLabel == first())
194 if (pointLabel == second())
211 if (first() == second() || second() < 0)
241 if (first() == second() || second() < 0)
256 return (first() < 0 && second() < 0);
271 if (index != second())
277 else if (second() < 0)
280 if (index != first())
291 template<
class InputIterator>
294 InputIterator begIter,
295 InputIterator endIter
300 const int maxChange = ((first() < 0 ? 1 : 0) + (second() < 0 ? 1 : 0));
303 for (; changed < maxChange && begIter != endIter; ++begIter)
317 return insert(list.begin(), list.end());
343 if (index == first())
350 if (index == second())
360 template<
class InputIterator>
363 InputIterator begIter,
364 InputIterator endIter
369 const int maxChange = ((first() >= 0 ? 1 : 0) + (second() >= 0 ? 1 : 0));
372 for (; changed < maxChange && begIter != endIter; ++begIter)
374 changed +=
erase(*begIter);
383 return erase(list.begin(), list.end());
405 if (first() < 0 || second() < 0)
408 <<
"negative point index on edge " << *
this
413 return 0.5*(pts[first()] + pts[second()]);
420 if (first() < 0 || second() < 0)
423 <<
"negative point index on edge " << *
this
428 return pts[second()] - pts[first()];
435 if (first() < 0 || second() < 0)
438 <<
"negative point index on edge " << *
this
443 const vector v = (pts[second()] - pts[first()]);
446 return s < ROOTVSMALL ?
Zero : v/
s;
459 if (first() < 0 || second() < 0)
462 <<
"negative point index on edge " << *
this
482 return (i ? second() : first());
495 return (i ? second() : first());
srcOptions insert("case", fileName(rootDirSource/caseDirSource))
label minVertex() const
Return the smallest point label used by the edge.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
label commonVertex(const edge &other) const
Return vertex common with other edge or -1 on failure.
iterator end() noexcept
Return an iterator to end traversing the FixedList.
point centre(const UList< point > &pts) const
Return centre point (centroid) of the edge.
bool empty() const
Return true if edge has no valid point labels.
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))
edge reverseEdge() const
Return reverse edge as copy.
iterator end() noexcept
Return an iterator to end traversing the UList.
scalar mag(const UList< point > &pts) const
Return scalar magnitude of the edge.
static constexpr const zero Zero
Global zero (0)
linePointRef line(const UList< point > &pts) const
Return edge line.
T & last() noexcept
The last element of the list, position [N-1].
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
edge()
Default construct, with invalid point labels (-1)
bool insert(const label index)
Fill any open slot with the index if it did not previously exist.
vector unitVec(const UList< point > &pts) const
Return the unit vector (end - start)
Pair< label > labelPair
A pair of labels.
T & first() noexcept
The first element of the list, position [0].
bool connects(const edge &other) const
Do the edges share a common vertex index?
iterator begin() noexcept
Return an iterator to begin traversing the FixedList.
bool operator!=(const eddy &a, const eddy &b)
void clear()
'Clears' edge by setting both ends to invalid point labels.
label start() const
Return start (first) vertex label.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
static int compare(const Pair< label > &a, const Pair< label > &b)
Compare Pairs.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
bool found(const label pointLabel) const
Return true if point label is found in edge.
label erase(const label index)
Remove an existing index from the edge and set its location to '-1'.
label end() const
Return end (last/second) vertex label.
label which(const label pointLabel) const
Return local index (0,1) of point label in edge -1 on failure.
errorManip< error > abort(error &err)
label otherVertex(const label pointLabel) const
Given the point label for one vertex, return the other one.
line< point, const point & > linePointRef
A line using referred points.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static int compare(const edge &a, const edge &b)
Compare edges.
vector vec(const UList< point > &pts) const
Return the vector (end - start)
label maxVertex() const
Return the largest point label used by the edge.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A 1D vector of objects of type <T> with a fixed length <N>.
bool valid() const
Return true if the vertices are unique and non-negative.
label count() const
Return the number of unique, valid (non -1) point labels.
label & operator[](const label i)
Return edge element. Index should be limited to 0/1.