Hermes2D  3.0
Hermes::Hermes2D::HashTable Class Reference

Stores and searches node tables. More...

#include <hash.h>

+ Inheritance diagram for Hermes::Hermes2D::HashTable:

Public Member Functions

Nodeget_node (int id) const
 Retrieves a node by its id number.
 
int get_max_node_id () const
 Returns the maximum node id number plus one.
 
Nodepeek_vertex_node (int p1, int p2) const
 Returns a vertex node with parent id's p1 and p2 if it exists, nullptr otherwise.
 
Nodepeek_edge_node (int p1, int p2) const
 Returns an edge node with parent id's p1 and p2 if it exists, nullptr otherwise.
 
Array< Node > & get_nodes ()
 

Static Public Attributes

static const int H2D_DEFAULT_HASH_SIZE = 0x8000
 32K entries
 

Protected Member Functions

int get_num_nodes () const
 Returns the total number of nodes stored.
 
Nodeget_vertex_node (int p1, int p2)
 
Nodeget_edge_node (int p1, int p2)
 
void init (int size=H2D_DEFAULT_HASH_SIZE)
 
void copy (const HashTable *ht)
 Copies another hash table contents.
 
void rebuild ()
 Reconstructs the hashtable, after, e.g., the nodes have been loaded from a file.
 
void free ()
 Frees all memory used by the instance.
 
void remove_vertex_node (int id)
 Removes a vertex node with parent id's p1 and p2.
 
void remove_edge_node (int id)
 Removes an edge node with parent id's p1 and p2.
 

Protected Attributes

Array< Nodenodes
 Array storing all nodes.
 

Friends

struct Node
 
class MeshUtil
 
class MeshReaderH2D
 
template<typename Scalar >
class NeighborSearch
 
template<typename Scalar >
class Space
 
template<typename Scalar >
class H1Space
 
template<typename Scalar >
class L2Space
 
template<typename Scalar >
class HcurlSpace
 
template<typename Scalar >
class HdivSpace
 

Detailed Description

Stores and searches node tables.

HashTable is a base class for Mesh. It serves as a container for all nodes of a mesh. Moreover, it has node searching functions based on hash tables.

Definition at line 39 of file hash.h.

Member Function Documentation

Node * Hermes::Hermes2D::HashTable::get_edge_node ( int  p1,
int  p2 
)
protected

Central function: obtains an edge node pointer given the id numbers of its parents. If the edge node does not exist, it is created first.

Definition at line 170 of file hash.cpp.

Node * Hermes::Hermes2D::HashTable::get_vertex_node ( int  p1,
int  p2 
)
protected

Central function: obtains a vertex node pointer given the id numbers of its parents. If the vertex node does not exist, it is created first.

Definition at line 141 of file hash.cpp.

Referenced by Hermes::Hermes2D::Mesh::refine_quad().

void Hermes::Hermes2D::HashTable::init ( int  size = H2D_DEFAULT_HASH_SIZE)
protected

Initializes the hash table.

Parameters
size[in]Hash table size; must be a power of two.

Definition at line 34 of file hash.cpp.

Referenced by Hermes::Hermes2D::Mesh::init().


The documentation for this class was generated from the following files: