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

Defines a hash function for edges. More...

#include <Edge.h>

Inheritance diagram for Nektar::NekMeshUtils::EdgeHash:
Inheritance graph
[legend]
Collaboration diagram for Nektar::NekMeshUtils::EdgeHash:
Collaboration graph
[legend]

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 150 of file Edge.h.

Member Function Documentation

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

Definition at line 152 of file Edge.h.

153  {
154  std::size_t seed = 0;
155  unsigned int id1 = p->m_n1->m_id;
156  unsigned int id2 = p->m_n2->m_id;
157  boost::hash_combine(seed, id1 < id2 ? id1 : id2);
158  boost::hash_combine(seed, id2 < id1 ? id1 : id2);
159  return seed;
160  }