Template Class t8_default_scheme_common

Inheritance Relationships

Base Type

Class Documentation

template<t8_eclass_t TEclass, class TUnderlyingEclassScheme>
class t8_default_scheme_common : public t8_scheme_helpers<TEclass, TUnderlyingEclassScheme>

Common interface of the default schemes for each element shape.

Template Parameters:

TUnderlyingEclassScheme – The default scheme class of the element shape.

Public Functions

inline ~t8_default_scheme_common()

Destructor for all default schemes

inline t8_default_scheme_common(t8_default_scheme_common &&other) noexcept

Move constructor

inline t8_default_scheme_common &operator=(t8_default_scheme_common &&other) noexcept

Move assignment operator

inline t8_default_scheme_common(const t8_default_scheme_common &other)

Copy constructor

inline t8_default_scheme_common &operator=(const t8_default_scheme_common &other)

Copy assignment operator

inline size_t get_element_size(void) const

Return the size of any element of a given class.

Returns:

The size of an element of class ts. We provide a default implementation of this routine that should suffice for most use cases.

inline int element_get_num_corners([[maybe_unused]] const t8_element_t *elem) const

Compute the number of corners of a given element.

Note

This function is overwritten by the pyramid implementation.

Returns:

The number of corners of the element.

inline int get_max_num_children() const

Return the max number of children of an eclass.

Returns:

The max number of children of element.

inline void element_new(const int length, t8_element_t **elem) const

Allocate space for a bunch of elements.

Parameters:
  • length[in] The number of elements to allocate.

  • elem[out] The elements to allocate.

inline void element_destroy(const int length, t8_element_t **elem) const

Deallocate space for a bunch of elements.

inline void element_deinit([[maybe_unused]] int length, [[maybe_unused]] t8_element_t *elem) const

Deinitialize an array of allocated elements.

See also

element_init

Note

Call this function if you called element_init on the element pointers.

Parameters:
  • length[in] The number of elements to be deinitialized.

  • elem[inout] On input an array of length many allocated and initialized elements, on output an array of length many allocated, but not initialized elements.

inline t8_element_shape_t element_get_shape([[maybe_unused]] const t8_element_t *elem) const

Return the shape of an element

Note

This function is overwritten by the pyramid implementation.

Parameters:

elem[in] The element.

Returns:

The shape of the element.

inline t8_gloidx_t element_count_leaves(const t8_element_t *element, int level) const

Count how many leaf descendants of a given uniform level an element would produce.

Note

This function is overwritten by the pyramid implementation.

Parameters:
  • element[in] The element to be checked.

  • level[in] A refinement level.

Returns:

Suppose element is uniformly refined up to level level. The return value is the resulting number of elements (of the given level). Each default element (except pyramids) refines into 2^{dim * (level - level(t))} children.

inline bool element_is_refinable(const t8_element_t *elem) const

Indicates if an element is refinable. Possible reasons for being not refinable could be that the element has reached its max level.

Parameters:

elem[in] The element to check.

Returns:

True if the element is refinable.

inline int element_get_num_siblings([[maybe_unused]] const t8_element_t *elem) const

Compute the number of siblings of an element. That is the number of Children of its parent.

Note

This function is overwritten by the pyramid implementation.

Note

that this number is >= 1, since we count the element itself as a sibling.

Parameters:

elem[in] The element.

Returns:

The number of siblings of element.

inline t8_gloidx_t count_leaves_from_root(const int level) const

Count how many leaf descendants of a given uniform level the root element will produce.

Note

This function is overwritten by the pyramid implementation.

Parameters:

level[in] A refinement level.

Returns:

The value of t8_element_count_leaves if the input element is the root (level 0) element.

Protected Attributes

size_t element_size

The size in bytes of an element of class eclass

void *scheme_context

Anonymous implementation context.