t8  1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
Typedefs | Functions
t8_forest_iterate.h File Reference

We define variuos routines to iterate through (parts of) a forest and execute callback functions on the leaf elements,. More...

#include <t8.h>
#include <t8_forest.h>

Go to the source code of this file.

Typedefs

typedef int(* t8_forest_iterate_face_fn) (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face, void *user_data, t8_locidx_t tree_leaf_index)
 
typedef int(* t8_forest_search_query_fn) (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, const int is_leaf, t8_element_array_t *leaf_elements, t8_locidx_t tree_leaf_index, void *query, size_t query_index)
 

Functions

void t8_forest_split_array (const t8_element_t *element, t8_element_array_t *leaf_elements, size_t *offsets)
 
void t8_forest_iterate_faces (t8_forest_t forest, t8_locidx_t ltreeid, const t8_element_t *element, int face, t8_element_array_t *leaf_elements, void *user_data, t8_locidx_t tree_lindex_of_first_leaf, t8_forest_iterate_face_fn callback)
 
void t8_forest_search (t8_forest_t forest, t8_forest_search_query_fn search_fn, t8_forest_search_query_fn query_fn, sc_array_t *queries)
 
void t8_forest_iterate_replace (t8_forest_t forest_new, t8_forest_t forest_old, t8_forest_replace_t replace_fn)
 Given two forest where the elemnts in one forest are either direct children or parents of the elements in the other forest compare the two forests and for each refined element or coarsened family in the old one, call a callback function providing the local indices of the old and new elements. More...
 

Detailed Description

We define variuos routines to iterate through (parts of) a forest and execute callback functions on the leaf elements,.

Function Documentation

◆ t8_forest_iterate_replace()

void t8_forest_iterate_replace ( t8_forest_t  forest_new,
t8_forest_t  forest_old,
t8_forest_replace_t  replace_fn 
)

Given two forest where the elemnts in one forest are either direct children or parents of the elements in the other forest compare the two forests and for each refined element or coarsened family in the old one, call a callback function providing the local indices of the old and new elements.

Parameters
[in]forest_newA forest, each element is a parent or child of an element in forest_old.
[in]forest_oldThe initial forest.
[in]replace_fnA replace callback function.
Note
To pass a user pointer to replace_fn use t8_forest_set_user_data and t8_forest_get_user_data.