Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Nektar::Utilities::EdgeHash Struct Reference

Defines a hash function for edges. More...

#include <MeshElements.h>

Public Member Functions

std::size_t operator() (EdgeSharedPtr const &p) const

Detailed Description

Defines a hash function for edges.

The hash of an edge is defined using the IDs of the two nodes which define it. First the minimum ID is hashed, then the maximum ID, which takes the two possible orientations into account.

Definition at line 330 of file MeshElements.h.

Member Function Documentation

std::size_t Nektar::Utilities::EdgeHash::operator() ( EdgeSharedPtr const &  p) const
inline

Definition at line 332 of file MeshElements.h.

{
std::size_t seed = 0;
unsigned int id1 = p->m_n1->m_id;
unsigned int id2 = p->m_n2->m_id;
boost::hash_combine(seed, id1 < id2 ? id1 : id2);
boost::hash_combine(seed, id2 < id1 ? id1 : id2);
return seed;
}