diff --git a/src/fclaw2d_to_3d.h b/src/fclaw2d_to_3d.h index 91bf17a6e..c2313d2d5 100644 --- a/src/fclaw2d_to_3d.h +++ b/src/fclaw2d_to_3d.h @@ -162,6 +162,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define fclaw2d_patch_transform_corner fclaw3d_patch_transform_corner #define fclaw2d_patch_transform_corner2 fclaw3d_patch_transform_corner2 #define fclaw2d_domain_set_refinement fclaw3d_domain_set_refinement +#define fclaw2d_domain_set_partitioning fclaw3d_domain_set_partitioning #define fclaw2d_patch_mark_refine fclaw3d_patch_mark_refine #define fclaw2d_patch_mark_coarsen fclaw3d_patch_mark_coarsen #define fclaw2d_domain_iterate_adapted fclaw3d_domain_iterate_adapted diff --git a/src/forestclaw2d.c b/src/forestclaw2d.c index 11bd67788..46c88511b 100644 --- a/src/forestclaw2d.c +++ b/src/forestclaw2d.c @@ -1396,6 +1396,15 @@ fclaw2d_domain_set_refinement (fclaw2d_domain_t * domain, p4est_wrap_set_coarsen_delay (wrap, coarsen_delay, 0); } +void +fclaw2d_domain_set_partitioning (fclaw2d_domain_t * domain, + int partition_for_coarsening) +{ + p4est_wrap_t *wrap = (p4est_wrap_t *) domain->pp; + + p4est_wrap_set_partitioning (wrap, partition_for_coarsening); +} + void fclaw2d_patch_mark_refine (fclaw2d_domain_t * domain, int blockno, int patchno) diff --git a/src/forestclaw2d.h b/src/forestclaw2d.h index 8fbbfe486..2fccb2e4f 100644 --- a/src/forestclaw2d.h +++ b/src/forestclaw2d.h @@ -667,6 +667,18 @@ void fclaw2d_domain_set_refinement (fclaw2d_domain_t * domain, int smooth_refine, int smooth_level, int coarsen_delay); +/** Set parameters of partitioning strategy in a domain. + * This function only needs to be called once, and only for the first domain + * created in the program. The values of the parameters are automatically + * transferred on adaptation and partitioning. + * \param [in,out] domain This domain's partitioning strategy is set. + * \param [in] partition_for_coarsening Boolean: If true, all future partitions + * of the domain allow one level of coarsening. + * Suggested default: 1. + */ +void fclaw2d_domain_set_partitioning (fclaw2d_domain_t * domain, + int partition_for_coarsening); + /** Mark a patch for refinement. * This must ONLY be called for local patches. * It is safe to call this function from an iterator callback except diff --git a/src/forestclaw3d.h b/src/forestclaw3d.h index a4e0dd647..92c7ecbf4 100644 --- a/src/forestclaw3d.h +++ b/src/forestclaw3d.h @@ -790,6 +790,18 @@ void fclaw3d_domain_set_refinement (fclaw3d_domain_t * domain, int smooth_refine, int smooth_level, int coarsen_delay); +/** Set parameters of partitioning strategy in a domain. + * This function only needs to be called once, and only for the first domain + * created in the program. The values of the parameters are automatically + * transferred on adaptation and partitioning. + * \param [in,out] domain This domain's partitioning strategy is set. + * \param [in] partition_for_coarsening Boolean: If true, all future partitions + * of the domain allow one level of coarsening. + * Suggested default: 1. + */ +void fclaw3d_domain_set_partitioning (fclaw3d_domain_t * domain, + int partition_for_coarsening); + /** Mark a patch for refinement. * This must ONLY be called for local patches. * It is safe to call this function from an iterator callback except