Nektar++
Public Member Functions | List of all members
Nektar::SpatialDomains::GeometryHash Struct Reference

Unary function that constructs a hash of a Geometry object, based on the vertex IDs. More...

#include <Geometry.h>

Public Member Functions

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

Detailed Description

Unary function that constructs a hash of a Geometry object, based on the vertex IDs.

Definition at line 253 of file Geometry.h.

Member Function Documentation

◆ operator()()

std::size_t Nektar::SpatialDomains::GeometryHash::operator() ( GeometrySharedPtr const &  p) const
inline

Definition at line 255 of file Geometry.h.

256  {
257  int i;
258  size_t seed = 0;
259  int nVert = p->GetNumVerts();
260  std::vector<unsigned int> ids(nVert);
261 
262  for (i = 0; i < nVert; ++i)
263  {
264  ids[i] = p->GetVid(i);
265  }
266  std::sort(ids.begin(), ids.end());
267  hash_range(seed, ids.begin(), ids.end());
268 
269  return seed;
270  }
std::size_t hash_range(Iter first, Iter last)
Definition: HashUtils.hpp:68

References Nektar::hash_range(), and CellMLToNektar.cellml_metadata::p.