Hermes2D
3.0
|
Stores and searches node tables. More...
#include <hash.h>
Public Member Functions | |
Node * | get_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. | |
Node * | peek_vertex_node (int p1, int p2) const |
Returns a vertex node with parent id's p1 and p2 if it exists, nullptr otherwise. | |
Node * | peek_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. | |
Node * | get_vertex_node (int p1, int p2) |
Node * | get_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< Node > | nodes |
Array storing all nodes. | |
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.
|
protected |
|
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().
|
protected |
Initializes the hash table.
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().