Context-aware element iterators #1320
Labels
C++
enhancement
Enhances already existing code
priority: low
Should be solved eventually
workload: high
Would take longer than a week
workload: medium
Would take a week or less
When introducing element iterators, we can give them context-awareness, so that they add functionality to the elements.
What do I mean by that?
It would be nice to do this
instead of this:
How do we achieve that (without a memory overhead)?
An option would be to equip each element with a pointer to the forests scheme and their local tree id, so that they can relay the element functions to the scheme. But this would imply another pointer and
t8_locidx_t
inside an element. This is not an option.But since an element iterator would basically loop over all trees and all elements in that tree, it has to keep track of the local tree and element ids. Furthermore, the element iterator would be provided by the forest. So it can also contain a pointer to the forest or its scheme. This way the iterator keeps track off everything and relays the function calls to the scheme and the only memory overhead would be one pointer in the iterator, which exists only once per process.
The text was updated successfully, but these errors were encountered: