GridRefinement::refine_and_coarsen_optimize

61 views
Skip to first unread message

j.l.bol...@gmail.com

unread,
Aug 15, 2017, 11:54:04 AM8/15/17
to deal.II User Group
We struggle to find out how to use GridRefinement::refine_and_coarsen_optimize (documentation) appropriately. We couldn't find an application in one of the deal.ii tutorials, so we felt free to contact this mailing list.

So far, we have assumed it's supposed to be used as a follow-up to another refinement strategy, e.g. GridRefinement::refine_and_coarsen_fixed_number to optimize the new refinement.
However, this approach resulted in an error when it tried to refine a cell previously flagged for coarsening:
An error occurred in line <3085> of file
</home/zam/boltersd/jufire_April/bundled/dealii/include/deal.II/grid/tria_accessor.templates.h>
in function

void dealii::CellAccessor<dim,
spacedim>::set_refine_flag(dealii::RefinementCase<dim>) const [with int
dim = 2; int spacedim = 2]

The violated condition was:

!coarsen_flag_set()

Additional information:

(none)


Looking at its source code, the function does not set coarsen flags at all despite being named refine_and_coarsen_optimize, so we initially thought it mighty only be applicable as an iterative procedure to find a suitable mesh like in tutorial step-6. However, if we understood correctly, Thomas Richter implemented this algorithm for his PhD thesis on time-dependent problems, which, in our opinion, would also require mesh coarsening during simulations.

We'd be hugely grateful if someone with more experience could tell us how to use refine_and_coarsen_optimize correctly.

Jean-Paul Pelteret

unread,
Aug 15, 2017, 12:51:40 PM8/15/17
to deal.II User Group
Hi,

I can't claim to know anything about this function, but I can point you towards a coupled of unit tests (here and here) that might you understand its intended usage. But I recognise that they do not illustrate a nested strategy. I see that in the original changelog entry there is a mention of it performing coarsening (well, setting coarsening flags), but like you I don't see such a call in the function itself (only a call to refine). 

Hopefully someone with more knowledge can give you more insight as to how its supposed to be used.

Regards,
Jean-Paul
Reply all
Reply to author
Forward
0 new messages