Go to the documentation of this file.
104 using labelPair::first;
107 using labelPair::last;
141 inline bool valid()
const;
145 inline bool found(
const label pointLabel)
const;
179 inline bool empty()
const;
191 template<
class InputIterator>
192 inline label insert(InputIterator begIter, InputIterator endIter);
198 inline label insert(std::initializer_list<label> list);
220 template<
class InputIterator>
221 inline label erase(InputIterator begIter, InputIterator endIter);
225 inline label erase(std::initializer_list<label> list);
282 inline unsigned hashval(
unsigned seed=0)
const
299 template<
class HashT=Foam::Hash<label>>
302 inline unsigned operator()(
const edge& obj,
unsigned seed=0)
const
324 return edge(
e.second(),
e.first());
334 return e.hashval(seed);
const T & second() const noexcept
Return second element, which is also the last element.
void reverse(UList< T > &list, const label n)
label minVertex() const
Return the smallest point label used by the edge.
static const char *const typeName
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.
edge reverseEdge() const
Return reverse edge as copy.
scalar mag(const UList< point > &pts) const
Return scalar magnitude of the edge.
linePointRef line(const UList< point > &pts) const
Return edge line.
unsigned operator()(const edge &e, unsigned seed=0) const
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)
unsigned operator()(const T &obj, unsigned seed=0) const
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)
A template class to specify if a data type is composed solely of Foam::label elements.
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.
Hash function class. The default definition is for primitives, non-primitives used to hash entries on...
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'.
Hashing function class for edge (commutative)
label end() const
Return end (last/second) vertex label.
unsigned hashval(unsigned seed=0) const
The (commutative) hash-value for edge.
label which(const label pointLabel) const
Return local index (0,1) of point label in edge -1 on failure.
const T & other(const T &a) const
Return other element.
label otherVertex(const label pointLabel) const
Given the point label for one vertex, return the other one.
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.
A 1D vector of objects of type <T> with a fixed length <N>.
unsigned operator()(const edge &obj, unsigned seed=0) const
const dimensionedScalar e
Elementary charge.
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.
A template class to specify that a data type can be considered as being contiguous in memory.
label & operator[](const label i)
Return edge element. Index should be limited to 0/1.