librelist archives

« back to archive

Balance trees up to second neighbours

Balance trees up to second neighbours

From:
Date:
2015-05-04 @ 07:49
Hi,

I am balancing my domain 2:1 with P4EST_CONNECT_FULL. Currently the 
balance algorithm (pest_balance_ext) only enforces 2:1 to direct 
neighbours, can this directive be extended for the second neighbours too? 

Kind regards,
Sten

Re: [p4est] Balance trees up to second neighbours

From:
Carsten Burstedde
Date:
2015-05-04 @ 08:48
Sten,

> I am balancing my domain 2:1 with P4EST_CONNECT_FULL. Currently the 
balance algorithm (pest_balance_ext) only enforces 2:1 to direct 
neighbours, can this directive be extended for the second neighbours too? 

not directly, but there are workarounds.  One would be to use
p4est_iterate to go through all the neighbors you are interested in
(face/edge/corner), to check out the relative sizes of the elements, and
to set your own refinement and coarsening flags from the iterator
callbacks.  Then call refine/coarsen and balance again.

If you want to propagate refinement flags/parameters to neighbors, then
the local part can be done using p4est_iterate and the parallel part by
p4est_ghost_exchange.  You can iterate this for as many indirect
neighbors as you like.

Hth,

Carsten

Re: [p4est] Balance trees up to second neighbours

From:
Tobin Isaac
Date:
2015-05-04 @ 13:17
I would also suggest that a simple thing to do is have each
p4est_quadrant_t stand for a family of quadrants.
Or, if you want 1:1 correspondence between  each p4est_quadrant_t and
a quadrant in your simulation, uniformly refine a 2:1 balanced forest
once.

  Toby

On Mon, May 04, 2015 at 10:48:43AM +0200, Carsten Burstedde wrote:
> Sten,
> 
> > I am balancing my domain 2:1 with P4EST_CONNECT_FULL. Currently the 
balance algorithm (pest_balance_ext) only enforces 2:1 to direct 
neighbours, can this directive be extended for the second neighbours too? 
> 
> not directly, but there are workarounds.  One would be to use
> p4est_iterate to go through all the neighbors you are interested in
> (face/edge/corner), to check out the relative sizes of the elements, and
> to set your own refinement and coarsening flags from the iterator
> callbacks.  Then call refine/coarsen and balance again.
> 
> If you want to propagate refinement flags/parameters to neighbors, then
> the local part can be done using p4est_iterate and the parallel part by
> p4est_ghost_exchange.  You can iterate this for as many indirect
> neighbors as you like.
> 
> Hth,
> 
> Carsten

Re: [p4est] Balance trees up to second neighbours

From:
Date:
2015-05-04 @ 22:12
Dear Toby,

>I would also suggest that a simple thing to do is have each
>p4est_quadrant_t stand for a family of quadrants.
>Or, if you want 1:1 correspondence between  each p4est_quadrant_t and
>a quadrant in your simulation, uniformly refine a 2:1 balanced forest
>once.

I like this idea a lot, however I need to reprogram some of the parts of 
my forest iterators. Also the MPI communication gets a little bit more 
overhead, but I think this is manageable. Thanks for this solution!

Sten