41 return (from < to) ?
edge(from, to) :
edge(to, from);
60 (pair.
get<0>() < pair.
get<1>())
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)
264 if (vertex != second())
270 else if (second() < 0)
273 if (vertex != first())
284template<
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())
353template<
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
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());
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.
iterator end() noexcept
Return an iterator to end traversing the FixedList.
iterator begin() noexcept
Return an iterator to begin traversing the FixedList.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An ordered pair of two objects of type <T> with first() and second() elements.
const label & other(const label &a) const
static int compare(const Pair< label > &a, const Pair< label > &b)
const T & first() const noexcept
Access the first element.
const T & second() const noexcept
Access the second element.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
iterator begin() noexcept
Return an iterator to begin traversing the UList.
iterator end() noexcept
Return an iterator to end traversing the UList.
Vector< Cmpt > & normalise(const scalar tol=ROOTVSMALL)
Inplace normalise the vector by its magnitude.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
label b() const noexcept
The second vertex.
static int compare(const edge &a, const edge &b)
Compare edges.
Pair< point > box(const UList< point > &pts) const
The enclosing (bounding) box for the edge.
bool empty() const noexcept
Return true if edge has no valid vertex labels.
bool insert(const label vertex)
Fill any open slot with the vertex label (if not previously contained in the edge).
label max() const noexcept
Return the largest vertex label used by the edge.
edge reverseEdge() const
Return reverse edge as copy.
point centre(const UList< point > &pts) const
Return centre point (centroid) of the edge.
bool connected(const edge &other) const
True if the edge has at least one vertex in common with other.
bool good() const noexcept
True if the vertices are unique and non-negative.
scalar magSqr(const UList< point > &pts) const
The length (L2-norm) squared of the edge vector.
vector unitVec(const UList< point > &pts) const
Return the unit vector (from first to second).
bool contains(const label vertex) const noexcept
Return true if the vertex label is contained in the edge.
label which(const label vertex) const
Return local index (0,1) of vertex label in edge -1 on failure.
label a() const noexcept
The first vertex.
edge()
Default construct, with invalid vertex labels (-1).
vector vec(const UList< point > &pts) const
Return the vector (from first to second).
linePointRef line(const UList< point > &pts) const
Return edge line.
label min() const noexcept
Return the smallest vertex label used by the edge.
label collapse()
'Collapse' edge by marking duplicate vertex labels as '-1', the lower vertex is retained.
scalar mag(const UList< point > &pts) const
The length (L2-norm) of the edge vector.
label erase(const label vertex)
Remove an existing vertex from the edge and set its location to '-1'. A negative vertex label never r...
label commonVertex(const edge &other) const
Return vertex common with other edge or -1 on failure.
label & operator[](const label i)
Return edge element. Index should be limited to 0/1.
void clear()
'Clears' edge by setting both ends to invalid vertex labels.
static edge sorted(label from, label to)
Create (in ascending order) from two vertex labels.
label count() const
Return the number of unique, valid (non -1) vertex labels.
label otherVertex(const label vertex) const
Given one vertex label, return the other one.
Pair< point > box() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool operator!=(const eddy &a, const eddy &b)
Pair< label > labelPair
A pair of labels.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
line< point, const point & > linePointRef
A line using referred points.
errorManip< error > abort(error &err)
vector point
Point is a vector.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
UList< label > labelUList
A UList of labels.
nonInt insert("surfaceSum(((S|magSf)*S)")