Nektar++
Public Member Functions | List of all members
Nektar::Utilities::EdgeHash Struct Reference

Defines a hash function for edges. More...

#include <MeshElements.h>

Inheritance diagram for Nektar::Utilities::EdgeHash:
Inheritance graph
[legend]
Collaboration diagram for Nektar::Utilities::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 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.

333  {
334  std::size_t seed = 0;
335  unsigned int id1 = p->m_n1->m_id;
336  unsigned int id2 = p->m_n2->m_id;
337  boost::hash_combine(seed, id1 < id2 ? id1 : id2);
338  boost::hash_combine(seed, id2 < id1 ? id1 : id2);
339  return seed;
340  }