Currently, when building a partitioned cmesh from stash, the ghost attributes are not added correctly.
Before adding tree/ghost attributes, all attributes are sorted regarding their global id.
In the ghost data structure, ghost neighbors are added as soon as a faceconnection from one of the local trees is found, so they do not need to be in the same order as the attributes.
This makes it more complicated to figure out the offsets needed to jump from the beginning of the first attribute info to the beginning of the data of the current attribute.
attr_info->attribute_offset needs to be set in t8_cmesh_trees_add_ghost_attribute
where attribute_offset is the offset in bytes from the first attribute info of this ghost to the actual data of the current attribute in the linear char array of the part. (see macros below)
/* Given a tree and an attribute info return the attribute */
#define T8_TREE_ATTR(t, ai) (T8_TREE_FIRST_ATT (t) + (ai)->attribute_offset)
These offset variables are continuously updated for the next attribute when adding the tree attributes, but this is not possible for the ghost attributes, since the next attribute info in the row does not need to match the next attribute that is added.
In order to compute the offset from the beginning of the first ghost attribute info to the beginning of the data, we could memorize the offset to the end of the attribute infos (maybe in the same hashmaps as the facejoins) and only accumulate the data sizes in t8_cmesh_trees_add_ghost_attribute
Currently, when building a partitioned cmesh from stash, the ghost attributes are not added correctly.
Before adding tree/ghost attributes, all attributes are sorted regarding their global id. In the ghost data structure, ghost neighbors are added as soon as a faceconnection from one of the local trees is found, so they do not need to be in the same order as the attributes.
This makes it more complicated to figure out the offsets needed to jump from the beginning of the first attribute info to the beginning of the data of the current attribute.
attr_info->attribute_offset
needs to be set int8_cmesh_trees_add_ghost_attribute
whereattribute_offset
is the offset in bytes from the first attribute info of this ghost to the actual data of the current attribute in the linear char array of thepart
. (see macros below)These offset variables are continuously updated for the next attribute when adding the tree attributes, but this is not possible for the ghost attributes, since the next attribute info in the row does not need to match the next attribute that is added.
In order to compute the offset from the beginning of the first ghost attribute info to the beginning of the data, we could memorize the offset to the end of the attribute infos (maybe in the same hashmaps as the facejoins) and only accumulate the data sizes in
t8_cmesh_trees_add_ghost_attribute
Prevents https://github.com/DLR-AMR/t8code/pull/1105 from being merged