[Users] Problem with CarpetRegrid2/AMR

Hal Finkel hfinkel at anl.gov
Wed Dec 14 15:07:35 CST 2011


On Thu, 2011-12-08 at 22:38 +0100, Eloisa Bentivegna wrote:
> Hello,
> 
> I'd like to revive a discussion that went over the list a few months ago, regarding Carpet's AMR capability.
> 
> I understand that the refinement has to be triggered through the level_mask grid function. The example that Hal gave is below.
> 
> On Aug 30, 2011, at 9:37 PM, Hal Finkel wrote:
> 
> > lvlmskSet =
> > {
> >        Name -> "SFBubble_SetLevelMask",
> >        Schedule -> {"AT preregrid"},
> >        Where -> Interior,
> >        Shorthands -> { adchix, adchiy, adchiz },
> >        Equations ->
> >        {
> >                adchix -> fabs[dx PD[chi,1]],
> >                adchiy -> fabs[dy PD[chi,2]],
> >                adchiz -> fabs[dz PD[chi,3]],
> > 
> >                "level_mask" -> (
> >                        Max[
> >                                adchix, adchiy, adchiz
> >                        ]/dchimax
> >                ) /. Max[a_, b_, c_] -> fmax[a, fmax[b, c]]
> >        }
> > };

FWIW, it looks like some time over the last few months this stopped
working: setting level_mask in this way does not lead to regridding
(even if it is > n in some places), and outputting the result using
CarpetIOScalar has an odd result:

carpetregrid2::level_mask.maximum.asc starts with:
0 0 -1.79769313486232e+308
1 1 1.30685299729774
2 2 1.31094960089828
...

carpetregrid2::level_mask.minimum.asc starts with:
0 0 1.79769313486232e+308
1 1 0
2 2 0
...

carpetregrid2::level_mask.average.asc has:
0 0 -nan
1 1 -nan
2 2 -nan
...

What is going on here?

It might also be worth noting, that to get level_mask to work with Kranc
in the above example, I added the following after the call to
CreateKrancThornTT:

Module[{fp = OpenAppend[dirname <> "/schedule.ccl"]},
        WriteString[fp, "\[NewLine]" <> "STORAGE:
CarpetRegrid2::level_mask"];
        Close[fp]
];

 -Hal

> 
> My questions are:
> 
> 1) Is preregrid the right location to set this function?
> 2) Does this suffice? I assume that once regridding is triggered, the new levels will have to be populated (via interpolation?). Is level_mask treated like all other grid functions?
> 3) In the case above, the loop only goes over interior points, since the mask is set to be the derivative of a grid function. This implies that a sync is necessary before the mask can be used for regridding. Is the user thorn a good place to request this?
> 
> Thanks,
> Eloisa

-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory



More information about the Users mailing list