41 return (from < to) ?
edge(from, to) :
edge(to, from);
60 (pair.
get<0>() < pair.
get<1>())
113 return (first() < second() ? first() : second());
119 return (second() < first() ? first() : second());
125 return (first() != second() && first() >= 0 && second() >= 0);
135 && (vertex == first() || vertex == second())
145 if (vertex == first())
149 if (vertex == second())
183 if (vertex == first())
187 if (vertex == second())
204 if (first() == second() || second() < 0)
234 if (first() == second() || second() < 0)
249 return (first() < 0 && second() < 0);
264 if (vertex != second())
270 else if (second() < 0)
273 if (vertex != first())
284 template<
class InputIterator>
287 InputIterator begIter,
288 InputIterator endIter
293 const int maxChange = ((first() < 0 ? 1 : 0) + (second() < 0 ? 1 : 0));
296 for (; changed < maxChange && begIter != endIter; ++begIter)
310 return insert(list.begin(), list.end());
336 if (vertex == first())
343 if (vertex == second())
353 template<
class InputIterator>
356 InputIterator begIter,
357 InputIterator endIter
362 const int maxChange = ((first() >= 0 ? 1 : 0) + (second() >= 0 ? 1 : 0));
365 for (; changed < maxChange && begIter != endIter; ++begIter)
376 return erase(list.begin(), list.end());
398 if (first() < 0 || second() < 0)
401 <<
"negative point index on edge " << *
this 406 return 0.5*(
pts[first()] +
pts[second()]);
413 if (first() < 0 || second() < 0)
416 <<
"negative point index on edge " << *
this 421 return pts[second()] -
pts[first()];
428 if (first() < 0 || second() < 0)
431 <<
"negative point index on edge " << *
this 437 (void) v.normalise(ROOTVSMALL);
444 return pts[first()].dist(
pts[second()]);
450 return pts[first()].distSqr(
pts[second()]);
458 if (first() < 0 || second() < 0)
461 <<
"negative point index on edge " << *
this 473 if (first() < 0 || second() < 0)
476 <<
"negative point index on edge " << *
this 496 return (i ? second() : first());
509 return (i ? second() : first());
label count() const
Return the number of unique, valid (non -1) vertex labels.
const T & first() const noexcept
Access the first element.
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)...
bool operator!=(const edge &other) const
Compare edges for non-equal content, ignoring orientation.
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.
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].
constexpr T & get(FixedList< T, N > &list) noexcept
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 operator==(const edge &other) const
Compare edges for equal content, ignoring orientation.
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...
const wordList edge
Standard (finite-area) edge field types (scalar, vector, tensor, etc)
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).
constexpr T & get() noexcept
Element access using compile-time indexing.
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.
static edge sorted(label from, label to)
Create (in ascending order) from two vertex labels.
iterator end() noexcept
Return an iterator to end traversing the UList.
const T & second() const noexcept
Access the second element.
label max() const noexcept
Return the largest vertex label used by the edge.
label min() const noexcept
Return the smallest vertex label used by the edge.
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.