It should suffice if this is a global storage allocation, i.e. if it is outside of any schedule statement.<div><br></div><div>-erik<br><br><div class="gmail_quote">On Wed, Dec 14, 2011 at 4:58 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, 2011-12-14 at 16:33 -0500, Erik Schnetter wrote:<br>
> Hal<br>
><br>
><br>
> This may mean that level_mask does not have storage at all times.<br>
> CarpetRegrid2 does not allocate storage for this variable -- maybe it<br>
> should, when CarpetRegrid2::adaptive_refinement is set to yes?<br>
<br>
</div>I agree that it should do that; but I am allocating storage for the<br>
variable right now (as I noted at the end of the e-mail) by adding to<br>
the end of my schedule file:<br>
STORAGE: CarpetRegrid2::level_mask<br>
<br>
Is that not enough?<br>
<br>
Thanks again,<br>
Hal<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> -erik<br>
><br>
> On Wed, Dec 14, 2011 at 4:07 PM, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:<br>
> � � � � On Thu, 2011-12-08 at 22:38 +0100, Eloisa Bentivegna wrote:<br>
> � � � � > Hello,<br>
> � � � � ><br>
> � � � � > I'd like to revive a discussion that went over the list a<br>
> � � � � few months ago, regarding Carpet's AMR capability.<br>
> � � � � ><br>
> � � � � > I understand that the refinement has to be triggered through<br>
> � � � � the level_mask grid function. The example that Hal gave is<br>
> � � � � below.<br>
> � � � � ><br>
> � � � � > On Aug 30, 2011, at 9:37 PM, Hal Finkel wrote:<br>
> � � � � ><br>
> � � � � > > lvlmskSet =<br>
> � � � � > > {<br>
> � � � � > > � � � �Name -> "SFBubble_SetLevelMask",<br>
> � � � � > > � � � �Schedule -> {"AT preregrid"},<br>
> � � � � > > � � � �Where -> Interior,<br>
> � � � � > > � � � �Shorthands -> { adchix, adchiy, adchiz },<br>
> � � � � > > � � � �Equations -><br>
> � � � � > > � � � �{<br>
> � � � � > > � � � � � � � �adchix -> fabs[dx PD[chi,1]],<br>
> � � � � > > � � � � � � � �adchiy -> fabs[dy PD[chi,2]],<br>
> � � � � > > � � � � � � � �adchiz -> fabs[dz PD[chi,3]],<br>
> � � � � > ><br>
> � � � � > > � � � � � � � �"level_mask" -> (<br>
> � � � � > > � � � � � � � � � � � �Max[<br>
> � � � � > > � � � � � � � � � � � � � � � �adchix, adchiy, adchiz<br>
> � � � � > > � � � � � � � � � � � �]/dchimax<br>
> � � � � > > � � � � � � � �) /. Max[a_, b_, c_] -> fmax[a, fmax[b, c]]<br>
> � � � � > > � � � �}<br>
> � � � � > > };<br>
><br>
><br>
> � � � � FWIW, it looks like some time over the last few months this<br>
> � � � � stopped<br>
> � � � � working: setting level_mask in this way does not lead to<br>
> � � � � regridding<br>
> � � � � (even if it is > n in some places), and outputting the result<br>
> � � � � using<br>
> � � � � CarpetIOScalar has an odd result:<br>
><br>
> � � � � carpetregrid2::level_mask.maximum.asc starts with:<br>
> � � � � 0 0 -1.79769313486232e+308<br>
> � � � � 1 1 1.30685299729774<br>
> � � � � 2 2 1.31094960089828<br>
> � � � � ...<br>
><br>
> � � � � carpetregrid2::level_mask.minimum.asc starts with:<br>
> � � � � 0 0 1.79769313486232e+308<br>
> � � � � 1 1 0<br>
> � � � � 2 2 0<br>
> � � � � ...<br>
><br>
> � � � � carpetregrid2::level_mask.average.asc has:<br>
> � � � � 0 0 -nan<br>
> � � � � 1 1 -nan<br>
> � � � � 2 2 -nan<br>
> � � � � ...<br>
><br>
> � � � � What is going on here?<br>
><br>
> � � � � It might also be worth noting, that to get level_mask to work<br>
> � � � � with Kranc<br>
> � � � � in the above example, I added the following after the call to<br>
> � � � � CreateKrancThornTT:<br>
><br>
> � � � � Module[{fp = OpenAppend[dirname <> "/schedule.ccl"]},<br>
> � � � � � � � �WriteString[fp, "\[NewLine]" <> "STORAGE:<br>
> � � � � CarpetRegrid2::level_mask"];<br>
> � � � � � � � �Close[fp]<br>
> � � � � ];<br>
><br>
> � � � � �-Hal<br>
><br>
> � � � � ><br>
> � � � � > My questions are:<br>
> � � � � ><br>
> � � � � > 1) Is preregrid the right location to set this function?<br>
> � � � � > 2) Does this suffice? I assume that once regridding is<br>
> � � � � triggered, the new levels will have to be populated (via<br>
> � � � � interpolation?). Is level_mask treated like all other grid<br>
> � � � � functions?<br>
> � � � � > 3) In the case above, the loop only goes over interior<br>
> � � � � points, since the mask is set to be the derivative of a grid<br>
> � � � � function. This implies that a sync is necessary before the<br>
> � � � � mask can be used for regridding. Is the user thorn a good<br>
> � � � � place to request this?<br>
> � � � � ><br>
> � � � � > Thanks,<br>
> � � � � > Eloisa<br>
><br>
><br>
> � � � � --<br>
> � � � � Hal Finkel<br>
> � � � � Postdoctoral Appointee<br>
> � � � � Leadership Computing Facility<br>
> � � � � Argonne National Laboratory<br>
><br>
><br>
> � � � � _______________________________________________<br>
> � � � � Users mailing list<br>
> � � � � <a href="mailto:Users@einsteintoolkit.org">Users@einsteintoolkit.org</a><br>
> � � � � <a href="http://lists.einsteintoolkit.org/mailman/listinfo/users" target="_blank">http://lists.einsteintoolkit.org/mailman/listinfo/users</a><br>
><br>
><br>
><br>
><br>
><br>
> --<br>
> Erik Schnetter <<a href="mailto:schnetter@cct.lsu.edu">schnetter@cct.lsu.edu</a>><br>
> <a href="http://www.cct.lsu.edu/~eschnett/" target="_blank">http://www.cct.lsu.edu/~eschnett/</a><br>
><br>
><br>
<br>
--<br>
Hal Finkel<br>
Postdoctoral Appointee<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Erik Schnetter <<a href="mailto:schnetter@cct.lsu.edu" target="_blank">schnetter@cct.lsu.edu</a>>�� <a href="http://www.cct.lsu.edu/~eschnett/" target="_blank">http://www.cct.lsu.edu/~eschnett/</a><br>
<br>
</div>