Halloo Bruno,
The adapt_wavelet function will work correctly, but i doubt if that corresponds to what you want.
Assuming you use them in the sequence they appear in your post the following will happen:
The adapt_wavelet function will coarsen the cells in a "certain zone" if they do not need to be at the maximum level of refinement.
Next, the refine function will refine the coarsened cells and it will generally fail to reconstruct the original solution exactly.
Meaning that you are in fact introducing additional errors (of the order of the refinement criterion) by the subsequent coarsening and refinement each time step. This will have a smoothening effect and the compound effects of these additional errors are not necessarily small.
If you are really convinced that the wavelet algorithm is not smart enough for your purpose, I propose 3 solutions:
1) Define a noisy artificial field in your "certain zone" and do the wavelet-estimated-error refinement upon that (easiest).
2) Modify Ceasars pairetti's "location dependent maxlevel" to also consider a minimum level of refinement in your zone of interest.
3) Neatest: create a cell flag that tells a modified version of the "coarsen_cell"-function not to coarsen flagged cells.
Antoon