[Dune] Local Refinement in a DUNE Grid

S. Swayamjyoti swayam.151 at gmail.com
Wed Dec 29 11:47:23 CET 2010


If you don't mind, can you please send me a demo code snippet on how to do
the successive refinement? How do I access the leaf descendants after I have
marked and refined once, I find difficulty in constructing the correct loop.
My current code looks like this:

*for (ElementLeafIterator it = leafView.template begin<0>();
it!=leafView.template end<0>(); ++it)
{
int indexi = mapper.map(*it);
  if(indexi>135 && indexi<142) grid.mark(1,*it)
}
        grid.preAdapt();
        grid.adapt();
        grid.postAdapt();*

How do I assign ids to the leaf descendants of 135 < indexi < 142 elements,
and how do I mark/refine them again?
*
*

On Wed, Dec 29, 2010 at 12:31 AM, Carsten Gräser
<graeser at math.fu-berlin.de>wrote:

> Dear Swayam,
>
>
> Am 29.12.2010 00:23, schrieb S. Swayamjyoti:
> > If I know that a certain element can be refined n (n>1) times uniformly,
> I
> > can also tell that to* grid.mark( )* by calling *
> > grid.mark(n, element). *
> >
> > Now, does this not hold true for UGGrid? Because when I try to mark my
> grid
> > by grid.mark(4, *it), I get an error while execution (not during
> > compilation) saying,
> >
> > *DUNE ERROR: GridError: UGGrid only supports refCount values -1, 0, and 1
> > for mark( )!
> > *
> > Is it not implemented for UGGrid or is there a work-a-round?
> it is as the error message says: No, it's not supported by UGGrid.
>
> *The workaround is to do several refinement successive refinements
> of the grid. You could e.g. store ids of the elements you want to
> refine more then once, refine the grid and then mark all leaf
> descendants of the elements the these ids and refine again.*
>
> Best,
> Carsten
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20101229/2b852e43/attachment.htm>


More information about the Dune mailing list