Nektar++
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:
[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

◆ operator()()

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

Definition at line 152 of file Edge.h.

References Nektar::hash_combine().

153  {
154  const unsigned int id1 = p->m_n1->m_id;
155  const unsigned int id2 = p->m_n2->m_id;
156  return id1 < id2 ? hash_combine(id1, id2) : hash_combine(id2, id1);
157  }
void hash_combine(std::size_t &seed)
Definition: HashUtils.hpp:46