Struct t8_cmesh_vertex_conn_vertex_to_tree

Struct Documentation

struct t8_cmesh_vertex_conn_vertex_to_tree

This class stores the vertex to tree lookup for global vertex indices for a cmesh.

Thus, given a global vertex id the class provides information about the trees the vertex belongs to and the corresponding local vertex ids inside these trees.

In particular, this class stores the lookup

global_vertex_id -> List of (tree, tree_local_vertex)

for a cmesh. It is the opposite lookup as t8_cmesh_vertex_conn_tree_to_vertex.hxx

The global vertex ids must not be contiguous, that is, we have some set

{I_0 < I_1 < …< I_N} of natural numbers corresponding to the N+1 vertices.

I_0 does not have to be 0 and I_N does not have to be N.

So we need lookup: I_i -> i store this in a hash table.

datatypes:

global id: t8_gloidx_t (tree_id, tree_vertex): std::pair<t8_locidx_t, int> = TV_PAIR List of (tree_id, tree_vertex): std::vector<PAIR> = TV_LIST Table global_id -> TV_LIST: std::unordered_map<t8_gloidx_t, TV_LIST>

Public Types

typedef vtt_storage_type::const_iterator const_iterator

Typedef for the iterator type.

Public Functions

inline t8_cmesh_vertex_conn_vertex_to_tree()

Standard constructor.

Initializes the class and allows setting vertex entries via add_vertex_to_tree

void build_from_ttv(const t8_cmesh_t cmesh, t8_cmesh_vertex_conn_tree_to_vertex &ttv)

Function to fill vtt from cmesh and ttv information.

Sets all global ids and associated tree vertices from the given input class. Afterwards, the class is set to committed and can be used.

Parameters:
  • cmesh[in] A committed cmesh with set tree to vertex entries.

  • ttv[in] A filled tree to vertex list for cmesh.

void set_vertex_to_tree_list(const t8_cmesh_t cmesh)

Given a cmesh, build up the vertex_to_tree.

Parameters:

cmesh[in] An initialized but not yet committed cmesh. The cmesh must not be committed, but all tree information and neighbor information must have been set. Currently, cmesh has to be replicated.

inline const tree_vertex_list &get_tree_list_of_vertex(const t8_gloidx_t global_vertex_id) const

Get the list of global trees and local vertex ids a global vertex is connected to.

Parameters:

global_vertex_id[in] The global id of a vertex in the cmesh.

Returns:

The list of local tree ids and local vertex ids of global_vertex_id.

inline int get_state() const

Get the state of the vertex to tree object.

An object is either initialized (before commit) or committed (ready to use).

Returns:

INITIALIZED or COMMITTED

void add_vertex_to_tree(const t8_cmesh_t cmesh, const t8_gloidx_t global_vertex_id, const t8_locidx_t ltreeid, const int tree_vertex)

A single (tree, local vertex) value connected to a global vertex is added to the vertex_to_tree_list.

Parameters:
  • cmesh[in] must be committed.

  • global_vertex_id[in] The global id of the vertex to be added.

  • ltreeid[in] The local tree id of a tree that global_vertex_id is connected to.

  • tree_vertex[in] The local vertex id of ltreeid that global_vertex_id is connected to.

void commit(const t8_cmesh_t cmesh)

Mark as ready for commit.

Meaning that all global vertex ids have been added. After commit, no vertex ids can be added anymore.

Parameters:

cmesh[in] A committed cmesh to which the global vertex ids are associated.

inline bool is_committed() const

Check whether this instance is committed.

Returns:

True if committed. Thus all entries have been set.

inline int is_equal(const t8_cmesh_vertex_conn_vertex_to_tree &other) const

Compare with another instance of this class.

Parameters:

other[in] The other list to compare.

Returns:

True if and only if the stored vertex indices match.

inline bool operator==(const t8_cmesh_vertex_conn_vertex_to_tree &other) const

Equality operator.

Parameters:

other[in] The other list to compare.

Returns:

True if and only if the stored vertex indices match.

inline const_iterator begin() const

Iterator begin.

inline const_iterator end() const

Iterator end.

Friends

friend struct t8_cmesh_vertex_connectivity