Function t8_forest_split_array

Function Documentation

void t8_forest_split_array(const t8_element_t *element, const t8_element_array_t *leaf_elements, size_t *offsets)

Split an array of elements according to the children of a given element E.

In other words for each child C of E, find the index i, j, such that all descendants of C are elements[i], …, elements[j-1].

Parameters:
  • element[in] An element.

  • leaf_elements[in] An array of leaf elements of element. Thus, all elements must be descendants. Sorted by linear index.

  • offsets[inout] On input an allocated array of num_children_of_E

    + 1 entries.

    On output entry i indicates the position in

    leaf_elements where the descandents of the i-th child of E start.