Skip to content

Commit

Permalink
Merge pull request #879 from DLR-AMR/fix-ghost_writing
Browse files Browse the repository at this point in the history
fix ghost writing for geometry with vertices
  • Loading branch information
holke authored Jan 18, 2024
2 parents 4b6e7f0 + d222047 commit d35ecc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/t8_cmesh/t8_cmesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ double *
t8_cmesh_get_tree_vertices (t8_cmesh_t cmesh, t8_locidx_t ltreeid)
{
T8_ASSERT (t8_cmesh_is_committed (cmesh));
T8_ASSERT (t8_cmesh_treeid_is_local_tree (cmesh, ltreeid));
T8_ASSERT (t8_cmesh_treeid_is_local_tree (cmesh, ltreeid) || t8_cmesh_treeid_is_ghost (cmesh, ltreeid));

return (double *) t8_cmesh_get_attribute (cmesh, t8_get_package_id (), T8_CMESH_VERTICES_ATTRIBUTE_KEY, ltreeid);
}
Expand Down
8 changes: 7 additions & 1 deletion src/t8_geometry/t8_geometry_with_vertices.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ t8_geometry_with_vertices::t8_geom_load_tree_data (t8_cmesh_t cmesh, t8_gloidx_t
/* Set active id and eclass */
t8_locidx_t ltreeid = t8_cmesh_get_local_id (cmesh, gtreeid);
active_tree = gtreeid;
active_tree_class = t8_cmesh_get_tree_class (cmesh, ltreeid);
const t8_locidx_t num_local_trees = t8_cmesh_get_num_local_trees (cmesh);
if (0 <= ltreeid && ltreeid < num_local_trees) {
active_tree_class = t8_cmesh_get_tree_class (cmesh, ltreeid);
}
else {
active_tree_class = t8_cmesh_get_ghost_class (cmesh, ltreeid - num_local_trees);
}
/* Load this trees vertices. */
active_tree_vertices = t8_cmesh_get_tree_vertices (cmesh, ltreeid);

Expand Down

0 comments on commit d35ecc1

Please sign in to comment.