Skip to content

Commit

Permalink
Merge pull request #252 from tim-griesbach/feature-wrap-data-size
Browse files Browse the repository at this point in the history
Adjust data size handling in wrap_new_p4est
  • Loading branch information
cburstedde committed Oct 26, 2023
2 parents 4631ce3 + 2b9c28b commit c988da1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/p4est_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ p4est_wrap_new_p4est (p4est_t * p4est, int hollow, p4est_connect_type_t btype,
pp->mesh = p4est_mesh_new_ext (pp->p4est, pp->ghost, 1, 1, pp->btype);
}

/* reset the data size since changing the p4est_wrap will affect p.user_int */
p4est_reset_data (pp->p4est, 0, NULL, NULL);

pp->p4est->user_pointer = pp;
pp->user_pointer = user_pointer;

Expand Down
2 changes: 2 additions & 0 deletions src/p4est_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ p4est_wrap_t *p4est_wrap_new_conn (sc_MPI_Comm mpicomm,
* \param [in,out] p4est Valid p4est object that we will own.
* We take ownership of its connectivity too.
* Its user pointer must be NULL and will be changed.
* Its data size will be set to 0 and the quadrant
* data will be freed.
* \param [in] hollow Do not allocate flags, ghost, and mesh members.
* \param [in] btype The neighborhood used for balance, ghost, mesh.
* \param [in] replace_fn Callback to replace quadrants during refinement,
Expand Down

0 comments on commit c988da1

Please sign in to comment.