Skip to content

Commit

Permalink
feature-pfc: add partition_for_coarsening to wrap_params
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesbrandt committed Jan 25, 2024
1 parent e2d2d58 commit f6e4d89
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/p4est_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ p4est_wrap_params_init (p4est_wrap_params_t *params)
params->replace_fn = NULL;
params->coarsen_delay = 0;
params->coarsen_affect = 0;
params->partition_for_coarsening = 1;
params->user_pointer = NULL;
}

Expand Down Expand Up @@ -299,6 +300,8 @@ p4est_wrap_new_copy (p4est_wrap_t * source, size_t data_size,

pp = P4EST_ALLOC_ZERO (p4est_wrap_t, 1);

/* copy the sources wrap paramters; however the copy will is hollow */
pp->params = source->params;
pp->params.hollow = 1;

sc_refcount_init_invalid (&pp->conn_rc);
Expand All @@ -310,7 +313,6 @@ p4est_wrap_new_copy (p4est_wrap_t * source, size_t data_size,
pp->p4est_half = P4EST_HALF;
pp->p4est_faces = P4EST_FACES;
pp->p4est_children = P4EST_CHILDREN;
pp->params.mesh_params.btype = source->params.mesh_params.btype;
pp->params.replace_fn = replace_fn;
pp->p4est = p4est_copy (source->p4est, 0);
if (data_size > 0) {
Expand Down Expand Up @@ -811,7 +813,7 @@ p4est_wrap_partition (p4est_wrap_t * pp, int weight_exponent,
P4EST_ASSERT (weight_exponent == 0 || weight_exponent == 1);
pp->weight_exponent = weight_exponent;
changed =
p4est_partition_ext (pp->p4est, 1,
p4est_partition_ext (pp->p4est, pp->params.partition_for_coarsening,
weight_exponent ? partition_weight : NULL) > 0;

if (changed) {
Expand Down
4 changes: 4 additions & 0 deletions src/p4est_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ typedef struct
coarsening not only after refinement,
but also between subsequent
coarsenings of the same quadrant. */
int partition_for_coarsening; /**< If true, the partition is
modified to allow one level
of coarsening when calling
\ref p4est_wrap_partition. */
void *user_pointer; /**< Set the user pointer in
\ref p4est_wrap_t. Subsequently, we
will never access it. */
Expand Down
4 changes: 4 additions & 0 deletions src/p8est_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ typedef struct
coarsening not only after refinement,
but also between subsequent
coarsenings of the same quadrant. */
int partition_for_coarsening; /**< If true, the partition is
modified to allow one level
of coarsening when calling
\ref p8est_wrap_partition. */
void *user_pointer; /**< Set the user pointer in
\ref p8est_wrap_t. Subsequently, we
will never access it. */
Expand Down

0 comments on commit f6e4d89

Please sign in to comment.