[Users] Problem with CarpetRegrid2/AMR

Hal Finkel hfinkel at anl.gov
Wed Dec 14 17:53:57 CST 2011


On Wed, 2011-12-14 at 18:27 -0500, Erik Schnetter wrote:
> You are not setting any values on the boundary. Is that intentional?

Currently, this is because I am using neighboring values in the
calculation, so I can't do that on the boundary. Should I do that some
other way?

> 
> 
> Can you look at the mask everywhere, to ensure that no value is a nan?

There are NaNs on the grid. They exist whereever any coordinate has its
highest value (not for 0, just for the highest value). Looks almost like
an off-by-one error somewhere.

>  The max and min intrinsics may not pick up nans.

It seems that they don't ;)

> 
> 
> To get things working for initial data, you may need to set the mask
> in the preregridinitial bin as well, or you need to ensure that carpet
> doesn't use the AMR mechanism at this time, or that another refinement
> mechanism sets up a sufficiently refined grid structure. (Once the
> grid structure is too coarse, things go wrong, and calculating
> derivative may lead to nans, so that level_mask cannot be calculated
> any more...)

Currently, no regridding is happening at all, but this may be a function
of the NaNs.

> 
> 
> Maybe you need a secondary mechanism while setting level_mask, to
> ensure there is a minimum amount of refinement present around certain
> features? I can't tell, this depends on your physical system.

The NaNs are not, as far as I can tell, coming from a calculation, but
rather they're coming from uninitialized data.

Thanks again,
Hal

> 
> 
> -erik
> 
> On Wed, Dec 14, 2011 at 4:07 PM, Hal Finkel <hfinkel at anl.gov> wrote:
>         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
>         
>         
>         _______________________________________________
>         Users mailing list
>         Users at einsteintoolkit.org
>         http://lists.einsteintoolkit.org/mailman/listinfo/users
>         
> 
> 
> 
> 
> -- 
> Erik Schnetter <schnetter at cct.lsu.edu>
> http://www.cct.lsu.edu/~eschnett/
> 
> 

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



More information about the Users mailing list