Go to the documentation of this file.
81 inline edge(
const label from,
const label to);
90 inline edge(
const label from,
const label to,
const bool doSort);
111 using labelPair::first;
114 using labelPair::last;
121 inline label
start()
const;
124 inline label&
start();
127 inline label
end()
const;
148 inline bool valid()
const;
152 inline bool found(
const label pointLabel)
const;
156 inline label
which(
const label pointLabel)
const;
168 inline label
otherVertex(
const label pointLabel)
const;
183 inline label
count()
const;
186 inline bool empty()
const;
195 inline bool insert(
const label index);
198 template<
class InputIterator>
199 inline label
insert(InputIterator begIter, InputIterator endIter);
205 inline label
insert(std::initializer_list<label> list);
224 inline label
erase(
const label index);
227 template<
class InputIterator>
228 inline label
erase(InputIterator begIter, InputIterator endIter);
232 inline label
erase(std::initializer_list<label> list);
283 inline const label&
operator[](
const label i)
const;
289 inline unsigned hashval(
unsigned seed=0)
const
306 template<
class HashT=Foam::Hash<label>>
309 inline unsigned operator()(
const edge& obj,
unsigned seed=0)
const
331 return edge(
e.second(),
e.first());
341 return e.hashval(seed);
const label & 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...
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 label & other(const label &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.
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.