Function t8_element_is_valid
Defined in File t8_scheme.h
Function Documentation
-
int t8_element_is_valid(const t8_scheme_c *scheme, const t8_eclass_t tree_class, const t8_element_t *element)
Query whether a given element can be considered as ‘valid’ and it is safe to perform any of the above algorithms on it.
For example this could mean that all coordinates are in valid ranges and other membervariables do have meaningful values.
Note
An element that is constructed with t8_element_new must pass this test.
Note
An element for which t8_scheme::element_init was called must pass this test.
Note
This function is used for debugging to catch certain errors. These can for example occur when an element points to a region of memory which should not be interpreted as an element.
Note
We recommend to use the assertion T8_ASSERT (t8_element_is_valid (element)) in the implementation of each of the functions in this file.
- Parameters:
scheme – [in] The scheme of the forest.
tree_class – [in] The eclass of tree the elements are part of.
element – [in] The element to be checked.
- Returns:
True if element is safe to use. False otherwise.