<div dir="ltr"><div>Thanks for the tip Roland!</div><div>I tried this now and am getting new errors. Here is the block in my parameter file now:<br>ActiveThorns = "Trigger"<br>Trigger::Trigger_Debug = 1<br>Trigger::Trigger_Number =1<br>Trigger::Trigger_Checked_Variable[0]="GRHydro::GRHydro_rho_min"<br>Trigger::Trigger_Reduction [0]=""<br>Trigger::Trigger_Relation [0]="<"<br>Trigger::Trigger_Checked_Value [0]= 1.1<br>Trigger::Trigger_Reaction [0]="steerscalar"<br>Trigger::Trigger_Steered_Scalar [0] = "CarpetRegrid2::radii[0]"<br>Trigger::Trigger_Steered_Scalar_Index [0] = 6<br>Trigger::Trigger_Steered_Scalar_Value [0] = "19.32"</div><div><br></div><div>First it crashed because "the parameter CarpetRegrid2::radius_1[6] is not steerable". I then edited CarpetRegrid2 to make radius_1, then got the following error:</div><div><br></div><div> while executing schedule bin CCTK_ANALYSIS, routine Trigger::Trigger_Check<br> in thorn Trigger, file /gpfs/fs1/home/d/dsiegel/dhruv/repos/ET_Mayer/Cactus/arrangements/CactusUtils/Trigger/src/trigger.c:404:<br> ->^[[0m steered scalar is of type CCTK_INT</div><div><br></div><div>I am confused why it thinks this is an integer quantity, and I am having trouble printing/debugging too. I am not sure how exactly the functions in the trigger thorn determine the 'type' of the cactus quantity, but at least it seems to be finding the right quantity to change.<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 1, 2022 at 3:54 PM Roland Haas <<a href="mailto:rhaas@illinois.edu">rhaas@illinois.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Dhruv,<br>
<br>
At runtime you have to steer the grid scalars in CarpetRegrid2 rather<br>
than the parameters.<br>
<br>
See the gallery example for hmns:<br>
<a href="http://einsteintoolkit.org/gallery/bns/nsnstohmns.par" rel="noreferrer" target="_blank">http://einsteintoolkit.org/gallery/bns/nsnstohmns.par</a><br>
<br>
Trigger::Trigger_Checked_Variable[2]="SphericalSurface::sf_valid[2]"<br>
Trigger::Trigger_Reduction [2]=""<br>
Trigger::Trigger_Relation [2]=">"<br>
Trigger::Trigger_Checked_Value [2]=0.<br>
Trigger::Trigger_Reaction [2]="steerscalar"<br>
Trigger::Trigger_Steered_Scalar [2] = "CarpetRegrid2::num_levels[0]" # == num_levels_1<br>
Trigger::Trigger_Steered_Scalar_Value[2] = "1"<br>
<br>
and for the radii you can look up the Regrid2 docs <br>
<br>
<a href="http://einsteintoolkit.org/thornguide/Carpet/CarpetRegrid2/documentation.html" rel="noreferrer" target="_blank">http://einsteintoolkit.org/thornguide/Carpet/CarpetRegrid2/documentation.html</a><br>
<br>
Trigger::Trigger_Steered_Scalar[triggernum] =<br>
"carpetregrid2::radii[center]"<br>
<br>
from its interface.ccl (center = 0 in your case for radius_1).<br>
<br>
You also must set Trigger::Trigger_Steered_Scalar_Index[triggernum] to<br>
the level needed (6 in your case).<br>
<br>
Yours,<br>
Roland<br>
<br>
> Hello,<br>
> I am running a simulation with Daniel Siegel where we use a base level<br>
> plus 6 refinement levels, like the following:<br>
> CarpetRegrid2::radius_1[1] = 336.0 # dx/64<br>
> CarpetRegrid2::radius_1[2] = 168.0 # dx/64<br>
> CarpetRegrid2::radius_1[3] = 84.0 # dx/64<br>
> CarpetRegrid2::radius_1[4] = 42.0 # dx/64<br>
> CarpetRegrid2::radius_1[5] = 21.0 # dx/64<br>
> CarpetRegrid2::radius_1[6] = 10.5 # dx/64<br>
> <br>
> We ran simulations of a neutrino-driven wind from a Neutron star, out<br>
> to ~150 ms, and now we want to turn on a high magnetic field. We have<br>
> tried B-fields of varying strengths, but if we try a B-field strength<br>
> that is too high, we find errors generated on the innermost refinement<br>
> level boundary. We believe if we enlarge the innermost box size ie.<br>
> CarpetRegrid2::radius_1[6] = 10.5 --> ~19-20, these errors would<br>
> disappear. But we are having trouble doing this. In our attempt, we<br>
> activate the trigger thorn with the following settings:<br>
> <br>
> ActiveThorns = "Trigger"<br>
> Trigger::Trigger_Debug = 1<br>
> Trigger::Trigger_Once[0]=1<br>
> Trigger::Trigger_Number =1<br>
> Trigger::Trigger_Checked_Variable[0]="GRHydro::GRHydro_rho_min"<br>
> Trigger::Trigger_Reduction [0]=""<br>
> Trigger::Trigger_Relation [0]="<"<br>
> Trigger::Trigger_Checked_Value [0]= 1.1<br>
> Trigger::Trigger_Reaction [0]="steerparam"<br>
> Trigger::Trigger_Steered_Parameter_Value [0] = "19.32"<br>
> Trigger::Trigger_Steered_Parameter_Name [0] = "radius_1[6]"<br>
> Trigger::Trigger_Steered_Parameter_Thorn [0] = "CarpetRegrid2"<br>
> <br>
> (We use a trivially satisfied trigger condition so that the parameter<br>
> value is reset immediately upon restart.)<br>
> Since the CarpetRegrid2 variable "radius_1[6]" is not steerable, we<br>
> had to modify this to make it such. After turning debug on, we see the<br>
> following output:<br>
> <br>
> INFO (Trigger): Testing triggers<br>
> INFO (Trigger): last_checked: -1<br>
> INFO (Trigger): trigger nr. 0 fulfilled for GRHydro_rho_min<br>
> (0.000000<1.100000)<br>
> INFO (Trigger): Steering parameter<br>
> INFO (Trigger): Parameter steered<br>
> <br>
> Which supposedly successfully resets the value correctly. We believe<br>
> that even though this may be the case, the actual grid is not<br>
> changing. We plot the first 2 boundary levels and show them in the<br>
> attached file.<br>
> <br>
> There must be interpolation of the second innermost grid onto the<br>
> innermost grid, and we believe this is not actually handled<br>
> mid-simulation and thus doesn't not result in the change we expect.<br>
> <br>
> Is there any simple way of changing the inner grid easily?<br>
> Any help is much appreciated!<br>
> <br>
> [image: image(1).png]<br>
> <br>
> <br>
> Thanks,<br>
> Dhruv Desai<br>
<br>
<br>
<br>
-- <br>
My email is as private as my paper mail. I therefore support encrypting<br>
and signing email messages. Get my PGP key from <a href="http://keys.gnupg.net" rel="noreferrer" target="_blank">http://keys.gnupg.net</a>.<br>
</blockquote></div>