Template Class mesh

Class Documentation

template<class TMeshElement = element<>>
class mesh

Wrapper for a forest that enables it to be handled as a simple mesh object.

Template Parameters:

TMeshElement – The element class that should be used for the elements in the mesh class. This template parameter defines which element functionality is available and if it is cached or calculated.

Public Types

using mesh_const_iterator = typename std::vector<TMeshElement>::const_iterator

Constant iterator type for the mesh elements.

Public Functions

inline mesh(t8_forest_t input_forest)

Constructor for a mesh of the handle.

Parameters:

input_forest[in] The forest from which the mesh should be created.

inline t8_locidx_t get_num_local_elements() const

Getter for the number of local elements in the mesh.

Returns:

Number of local elements in the mesh.

inline mesh_const_iterator begin() const

Returns a constant iterator to the first (local) mesh element.

Returns:

Constant iterator to the first (local) mesh element.

inline mesh_const_iterator end() const

Returns a constant iterator to a mesh element following the last (local) element of the mesh.

Returns:

Constant iterator to the mesh element following the last (local) element of the mesh.

inline const TMeshElement &operator[](t8_locidx_t local_index) const

Getter for a mesh element given its local index.

Parameters:

local_index[in] The local index of the element to access.

Returns:

Reference to the mesh element.

inline t8_forest_t get_forest() const

Getter for the forest the mesh is defined for.

Returns:

The forest the mesh is defined for.

inline void set_forest(t8_forest_t input_forest)

Setter for the forest.

Parameters:

input_forest[in] The forest from which the mesh should be a wrapper.

Public Members

friend TMeshElement

Make the element class a friend to access private members of the mesh (e.g.

the forest).