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