Go to the documentation of this file.
110 return (first() < second() ? first() : second());
116 return (first() > second() ? first() : second());
122 return (first() != second() && first() >= 0 && second() >= 0);
132 && (pointLabel == first() || pointLabel == second())
142 if (pointLabel == first())
146 if (pointLabel == second())
158 return (other.
found(first()) || other.
found(second()));
164 if (other.
found(first()))
168 if (other.
found(second()))
180 if (pointLabel == first())
184 if (pointLabel == second())
201 if (first() == second() || second() < 0)
217 return edge(second(), first());
231 if (first() == second() || second() < 0)
246 return (first() < 0 && second() < 0);
261 if (index != second())
267 else if (second() < 0)
270 if (index != first())
281 template<
class InputIterator>
284 InputIterator begIter,
285 InputIterator endIter
290 const int maxChange = ((first() < 0 ? 1 : 0) + (second() < 0 ? 1 : 0));
293 for (; changed < maxChange && begIter != endIter; ++begIter)
307 return insert(list.begin(), list.end());
333 if (index == first())
340 if (index == second())
350 template<
class InputIterator>
353 InputIterator begIter,
354 InputIterator endIter
359 const int maxChange = ((first() >= 0 ? 1 : 0) + (second() >= 0 ? 1 : 0));
362 for (; changed < maxChange && begIter != endIter; ++begIter)
364 changed +=
erase(*begIter);
373 return erase(list.begin(), list.end());
395 if (first() < 0 || second() < 0)
398 <<
"negative point index on edge " << *
this
403 return 0.5*(pts[first()] + pts[second()]);
410 if (first() < 0 || second() < 0)
413 <<
"negative point index on edge " << *
this
418 return pts[second()] - pts[first()];
425 if (first() < 0 || second() < 0)
428 <<
"negative point index on edge " << *
this
433 const vector v = (pts[second()] - pts[first()]);
436 return s < ROOTVSMALL ?
Zero : v/
s;
449 if (first() < 0 || second() < 0)
452 <<
"negative point index on edge " << *
this
472 return (i ? second() : first());
485 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.
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 begin()
Return an iterator to begin traversing the FixedList.
scalar mag(const UList< point > &pts) const
Return scalar magnitude of the edge.
static constexpr const zero Zero
Global zero.
linePointRef line(const UList< point > &pts) const
Return edge line.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
edge()
Construct null 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)
iterator begin()
Return an iterator to begin traversing the UList.
bool connects(const edge &other) const
Do the edges share a common vertex index?
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.
static int compare(const Pair< T > &a, const Pair< T > &b)
Compare Pairs.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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)
iterator end()
Return an iterator to end traversing the FixedList.
label otherVertex(const label pointLabel) const
Given the point label for one vertex, return the other one.
line< point, const point & > linePointRef
Line using referred points.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static int compare(const edge &a, const edge &b)
Compare edges.
An ordered pair of two objects of type <T> with first() and second() elements.
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>.
iterator end()
Return an iterator to end traversing the UList.
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.