[Dune] Maximal level difference
Carsten Gräser
graeser at math.fu-berlin.de
Mon Nov 29 15:43:35 CET 2010
Hi Martin,
Am 29.11.2010 15:19, schrieb Martin Nolte:
> Hi Carsten,
>
> from my point of view, there is not reason not to add this to dune/grid/utility.
>
> I'm not sure, though, that this code really enforces the requested maximum
> difference between neighbor levels. The reason is that marking for coarsening
> is only an indicator; the grid does not have to coarsen the element. Marking
> for refinement force the grid to refine, but, due to implicit rules within the
> grid, the element might actually be refined multiple times, resulting in a
> potentially higher difference than requested.
Of course implicit and mulitple refinement in the grid manager are a show stopper
for this functionality. However its not intended to be used in this case. The main
purpose is to add the level constraints to a grid manager with 'raw' refinement
like UGGrid with closureType==None or Subgrid.
> For the above mentioned problems, it might be better to put the code into
> UGGrid directly. Then you definitely know what the grid does with your markers.
That's a good point. Indeed you have to know what's going on inside the
grid to be sure that it will work. Hence it should be used internally.
On the other hand third-party grid managers might also want to use this.
Regards,
Carsten
>
> Best,
>
> Martin
>
> On 11/29/2010 02:44 PM, Carsten Gräser wrote:
>> Sorry, I forgot another issue regarding this:
>>
>> Am 29.11.2010 14:35, schrieb Carsten Gräser:
>>> Dear dune,
>>> in dune-subgrid we implemented a simple method to automatically
>>> add refinement marks and remove coarsening marks such that
>>> the level of neighboring elements differs at most by a user
>>> defined number. (ALUGrid e.g. does this internally).
>>>
>>> As someone asked for this functionality in UGGrid I extracted
>>> this using the grid interface only. This might also be helpfull
>>> for other third party grid implementations.
>>>
>>> Are there any objections to add this to dune/grid/utility?
>>
>> We could also add a method
>>
>> setMaxLevelDifference(unsigned int level)
>>
>> to UGGrid and call the utility-function from within
>> UGGrid::preAdapt() internally. On the one hand this
>> would make it a little easier to write portable code,
>> on the other hand it's essentially syntactic candy
>> that blows up the UGGrid interface (by one method).
>>
>> Furthermore I'm not sure if the name is good. Currently
>> the function is called
>>
>> template<class GridType>
>> static void enforceNeighborLevelDifference(GridType& grid, int maxLevelDiff);
>>
>> Any opinions?
>>
>> Regards,
>> Carsten
>>
>> PS: You can find the full implementation attached.
More information about the Dune
mailing list