97 return (first() < second() ? first() : second());
103 return (second() < first() ? first() : second());
109 return (first() != second() && first() >= 0 && second() >= 0);
119 && (vertex == first() || vertex == second())
129 if (vertex == first())
133 if (vertex == second())
167 if (vertex == first())
171 if (vertex == second())
188 if (first() == second() || second() < 0)
218 if (first() == second() || second() < 0)
233 return (first() < 0 && second() < 0);
248 if (vertex != second())
254 else if (second() < 0)
257 if (vertex != first())
268 template<
class InputIterator>
271 InputIterator begIter,
272 InputIterator endIter
277 const int maxChange = ((first() < 0 ? 1 : 0) + (second() < 0 ? 1 : 0));
280 for (; changed < maxChange && begIter != endIter; ++begIter)
294 return insert(list.begin(), list.end());
320 if (vertex == first())
327 if (vertex == second())
337 template<
class InputIterator>
340 InputIterator begIter,
341 InputIterator endIter
346 const int maxChange = ((first() >= 0 ? 1 : 0) + (second() >= 0 ? 1 : 0));
349 for (; changed < maxChange && begIter != endIter; ++begIter)
360 return erase(list.begin(), list.end());
382 if (first() < 0 || second() < 0)
385 <<
"negative point index on edge " << *
this 390 return 0.5*(
pts[first()] +
pts[second()]);
397 if (first() < 0 || second() < 0)
400 <<
"negative point index on edge " << *
this 405 return pts[second()] -
pts[first()];
412 if (first() < 0 || second() < 0)
415 <<
"negative point index on edge " << *
this 421 (void) v.normalise(ROOTVSMALL);
428 return pts[first()].dist(
pts[second()]);
434 return pts[first()].distSqr(
pts[second()]);
442 if (first() < 0 || second() < 0)
445 <<
"negative point index on edge " << *
this 457 if (first() < 0 || second() < 0)
460 <<
"negative point index on edge " << *
this 480 return (i ? second() : first());
493 return (i ? second() : first());
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
label count() const
Return the number of unique, valid (non -1) vertex labels.
scalar mag(const UList< point > &pts) const
The length (L2-norm) of the edge vector.
iterator begin() noexcept
Return an iterator to begin traversing the FixedList.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
edge reverseEdge() const
Return reverse edge as copy.
linePointRef line(const UList< point > &pts) const
Return edge line.
srcOptions insert("case", fileName(rootDirSource/caseDirSource))
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
iterator end() noexcept
Return an iterator to end traversing the FixedList.
label b() const noexcept
The second vertex.
bool connected(const edge &other) const
True if the edge has at least one vertex in common with other.
Pair< Point > box() const
The enclosing (bounding) box for the line.
bool empty() const noexcept
Return true if edge has no valid vertex labels.
vector unitVec(const UList< point > &pts) const
Return the unit vector (from first to second).
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
label erase(const label vertex)
Remove an existing vertex from the edge and set its location to '-1'. A negative vertex label never r...
void clear()
'Clears' edge by setting both ends to invalid vertex labels.
label minVertex() const noexcept
Return the smallest vertex label used by the edge.
line< point, const point & > linePointRef
A line using referred points.
label commonVertex(const edge &other) const
Return vertex common with other edge or -1 on failure.
static int compare(const Pair< label > &a, const Pair< label > &b)
Compare Pairs.
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].
label which(const label vertex) const
Return local index (0,1) of vertex label in edge -1 on failure.
label collapse()
'Collapse' edge by marking duplicate vertex labels as '-1', the lower vertex is retained.
vector vec(const UList< point > &pts) const
Return the vector (from first to second).
errorManip< error > abort(error &err)
iterator begin() noexcept
Return an iterator to begin traversing the UList.
Pair< point > box(const UList< point > &pts) const
The enclosing (bounding) box for the edge.
bool good() const noexcept
True if the vertices are unique and non-negative.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
label a() const noexcept
The first vertex.
label otherVertex(const label vertex) const
Given one vertex label, return the other one.
bool insert(const label vertex)
Fill any open slot with the vertex label (if not previously contained in the edge).
label maxVertex() const noexcept
Return the largest vertex label used by the edge.
edge()
Default construct, with invalid vertex labels (-1)
scalar magSqr(const UList< point > &pts) const
The length (L2-norm) squared of the edge vector.
bool contains(const label vertex) const noexcept
Return true if the vertex label is contained in the edge.
point centre(const UList< point > &pts) const
Return centre point (centroid) of the edge.
bool operator!=(const eddy &a, const eddy &b)
iterator end() noexcept
Return an iterator to end traversing the UList.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
label & operator[](const label i)
Return edge element. Index should be limited to 0/1.
static int compare(const edge &a, const edge &b)
Compare edges.