From f6e79a62b0c6dc81ac209acc8117b699e95e205b Mon Sep 17 00:00:00 2001 From: Hannes Brandt Date: Thu, 1 Aug 2024 12:08:25 +0200 Subject: [PATCH] feature-wrap-partition: add tree offset to newly_adapted indices --- src/p4est_wrap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p4est_wrap.c b/src/p4est_wrap.c index da6342206..506e1bae2 100644 --- a/src/p4est_wrap.c +++ b/src/p4est_wrap.c @@ -821,14 +821,14 @@ p4est_wrap_adapt (p4est_wrap_t * pp) if (quadrant->level > *level) { /* quadrant was newly refined, store its index in the new p4est */ lqid = (p4est_locidx_t *) sc_array_push (pp->newly_refined); - *lqid = (p4est_locidx_t) zz; + *lqid = (p4est_locidx_t) zz + tree->quadrants_offset; zz += P4EST_CHILDREN; qz++; } else if (quadrant->level < *level) { /* quadrant was newly coarsened, store its index in the new p4est */ lqid = (p4est_locidx_t *) sc_array_push (pp->newly_coarsened); - *lqid = (p4est_locidx_t) zz; + *lqid = (p4est_locidx_t) zz + tree->quadrants_offset; zz++; qz += P4EST_CHILDREN; }