Dear all, I would like to restart a simulation from a checkpoint enlarging the finest refinement level in my grid. In particular, I would like to change CarpetRegrid2::radius_1[5] = 20.1 to CarpetRegrid2::radius_1[5] = 25. I tried to do that by making the parameter CarpetRegrid2::radius_1 always steerable and adding the following lines to my parameter file:
ActiveThorns = "Trigger" Trigger::Trigger_Number = 1
Trigger::Trigger_Checked_Variable[0] = "hydrobase::rho" Trigger::Trigger_Relation[0] = ">" Trigger::Trigger_Checked_Value[0] = 1.e-4 Trigger::Trigger_Reduction[0] = "maximum"
Trigger::Trigger_Reaction[0] = "steerparam" Trigger::Trigger_Steered_Parameter_Thorn[0] = "CarpetRegrid2" Trigger::Trigger_Steered_Parameter_Name[0] = "radius_1[5]" Trigger::Trigger_Steered_Parameter_Value[0] = "25." #New value of the above parameter Trigger::Trigger_Once[0] = 1 #It means "yes" Trigger::Trigger_Debug = 1 #It means "yes"
In this way, the trigger should act immediately, as the maximum of rho is ~1e-3 in my case. Indeed, it looks like the trigger is working fine, as the standard output says
[...] INFO (Trigger): Testing triggers INFO (Trigger): last_checked: -1 INFO (Trigger): reducing trigger 0 red_handle 2 varindex 428 INFO (Trigger): reducing was ok INFO (Trigger): trigger nr. 0 fullfilled for rho (0.000804>0.000100) INFO (Trigger): Steering parameter INFO (Trigger): Parameter steered [...]
but unfortunately, looking at the 2D output with VisIt, the finest refinement level does not get enlarged (i.e. radius_1[5] does not appear to have been steered at all). Do you have any suggestions on how to get this trigger to work? Or, are you aware of other ways of obtaining the same result without using the thorn Trigger?
I attach the parameter file in case you need it.
Thank you very much in advance for your help.
Sincerely, Lorenzo Ennoggi
Hi,
On Mon, Jun 14, 2021 at 11:45:37AM +0200, Lorenzo Ennoggi wrote:
I would like to restart a simulation from a checkpoint enlarging the finest refinement level in my grid. In particular, I would like to change CarpetRegrid2::radius_1[5] = 20.1 to CarpetRegrid2::radius_1[5] = 25. I tried to do that by making the parameter CarpetRegrid2::radius_1 always steerable
if nothing changed, making the parameter steerable is the problem. It is not steerable, because the thorn CarpetRegrid2 only ever looks at the parameter at the beginning. You can make it steerable, but it won't do anything to your simulation, as you observe.
What you can do instead, is to change one of the variables (not parameters) that Carpetregrid2 uses, e.g. (not adapted to your case, but that should be similar):
Trigger::Trigger_Checked_Variable[2]="ADMBase::alp" Trigger::Trigger_Reduction [2]="minimum" Trigger::Trigger_Relation [2]="<" Trigger::Trigger_Checked_Value [2]=0.1 Trigger::Trigger_Reaction [2]="steerscalar" Trigger::Trigger_Steered_Scalar [2] = "CarpetRegrid2::radius[2]" Trigger::Trigger_Steered_Scalar_Index[2] = 4 Trigger::Trigger_Steered_Scalar_Value[2] = "3.75"
Frank
Dear Frank, thank you very much for your help and explanation, I will try this out.
Sincerely, Lorenzo
Il giorno lun 14 giu 2021 alle ore 12:18 Frank Loeffler < frank.loeffler@uni-jena.de> ha scritto:
Hi,
On Mon, Jun 14, 2021 at 11:45:37AM +0200, Lorenzo Ennoggi wrote:
I would like to restart a simulation from a checkpoint enlarging the finest refinement level in my grid. In particular, I would like to change CarpetRegrid2::radius_1[5] = 20.1 to CarpetRegrid2::radius_1[5] = 25. I tried to do that by making the parameter CarpetRegrid2::radius_1 always steerable
if nothing changed, making the parameter steerable is the problem. It is not steerable, because the thorn CarpetRegrid2 only ever looks at the parameter at the beginning. You can make it steerable, but it won't do anything to your simulation, as you observe.
What you can do instead, is to change one of the variables (not parameters) that Carpetregrid2 uses, e.g. (not adapted to your case, but that should be similar):
Trigger::Trigger_Checked_Variable[2]="ADMBase::alp" Trigger::Trigger_Reduction [2]="minimum" Trigger::Trigger_Relation [2]="<" Trigger::Trigger_Checked_Value [2]=0.1 Trigger::Trigger_Reaction [2]="steerscalar" Trigger::Trigger_Steered_Scalar [2] = "CarpetRegrid2::radius[2]" Trigger::Trigger_Steered_Scalar_Index[2] = 4 Trigger::Trigger_Steered_Scalar_Value[2] = "3.75"
Frank
On Mon, Jun 14, 2021 at 5:45 AM Lorenzo Ennoggi lorenzo.ennoggi@gmail.com wrote:
Dear all, I would like to restart a simulation from a checkpoint enlarging the finest refinement level in my grid. In particular, I would like to change CarpetRegrid2::radius_1[5] = 20.1 to CarpetRegrid2::radius_1[5] = 25. I tried to do that by making the parameter CarpetRegrid2::radius_1 always steerable and adding the following lines to my parameter file:
ActiveThorns = "Trigger" Trigger::Trigger_Number = 1
Trigger::Trigger_Checked_Variable[0] = "hydrobase::rho" Trigger::Trigger_Relation[0] = ">" Trigger::Trigger_Checked_Value[0] = 1.e-4 Trigger::Trigger_Reduction[0] = "maximum"
Trigger::Trigger_Reaction[0] = "steerparam" Trigger::Trigger_Steered_Parameter_Thorn[0] = "CarpetRegrid2" Trigger::Trigger_Steered_Parameter_Name[0] = "radius_1[5]" Trigger::Trigger_Steered_Parameter_Value[0] = "25." #New value of the above parameter Trigger::Trigger_Once[0] = 1 #It means "yes" Trigger::Trigger_Debug = 1 #It means "yes"
In this way, the trigger should act immediately, as the maximum of rho is ~1e-3 in my case. Indeed, it looks like the trigger is working fine, as the standard output says
[...] INFO (Trigger): Testing triggers INFO (Trigger): last_checked: -1 INFO (Trigger): reducing trigger 0 red_handle 2 varindex 428 INFO (Trigger): reducing was ok INFO (Trigger): trigger nr. 0 fullfilled for rho (0.000804>0.000100) INFO (Trigger): Steering parameter INFO (Trigger): Parameter steered [...]
but unfortunately, looking at the 2D output with VisIt, the finest refinement level does not get enlarged (i.e. radius_1[5] does not appear to have been steered at all). Do you have any suggestions on how to get this trigger to work? Or, are you aware of other ways of obtaining the same result without using the thorn Trigger?
Changing these parameters has no effect, even if they were steerable.
CarpetRegrid2 uses these parameters to set up the initial grid structure, by setting the grid scalars "positions", "radius", etc. During regridding, only these grid scalars are examined; the parameters are ignored. Other mechanisms to update the grid structure (e.g. by tracking horizons or punctures) update these grid scalars, which then determines the grid structure during regridding. These grid scalars are checkpointed and recovered, as all grid variables are.
To modify the grid structure you need to modify these grid scalars. You can do this e.g. via Python by doing surgery on the checkpoint files, or by scheduling a function that runs right after recovery. Carpet performs a regridding step after recovering, before the first evolution step.
-erik
Dear Erik, thank you very much. I am now trying the way Frank suggested before and, if again the finest refinement level does not get enlarged, I will probably try to edit the checkpoint files.
Sincerely, Lorenzo
Il giorno lun 14 giu 2021 alle ore 15:45 Erik Schnetter < schnetter@cct.lsu.edu> ha scritto:
On Mon, Jun 14, 2021 at 5:45 AM Lorenzo Ennoggi lorenzo.ennoggi@gmail.com wrote:
Dear all, I would like to restart a simulation from a checkpoint enlarging the
finest refinement level in my grid. In particular, I would like to change CarpetRegrid2::radius_1[5] = 20.1 to CarpetRegrid2::radius_1[5] = 25. I tried to do that by making the parameter CarpetRegrid2::radius_1 always steerable and adding the following lines to my parameter file:
ActiveThorns = "Trigger" Trigger::Trigger_Number = 1
Trigger::Trigger_Checked_Variable[0] = "hydrobase::rho" Trigger::Trigger_Relation[0] = ">" Trigger::Trigger_Checked_Value[0] = 1.e-4 Trigger::Trigger_Reduction[0] = "maximum"
Trigger::Trigger_Reaction[0] = "steerparam" Trigger::Trigger_Steered_Parameter_Thorn[0] = "CarpetRegrid2" Trigger::Trigger_Steered_Parameter_Name[0] = "radius_1[5]" Trigger::Trigger_Steered_Parameter_Value[0] = "25." #New value of the
above parameter
Trigger::Trigger_Once[0] = 1 #It means "yes" Trigger::Trigger_Debug = 1 #It means "yes"
In this way, the trigger should act immediately, as the maximum of rho
is ~1e-3 in my case. Indeed, it looks like the trigger is working fine, as the standard output says
[...] INFO (Trigger): Testing triggers INFO (Trigger): last_checked: -1 INFO (Trigger): reducing trigger 0 red_handle 2 varindex 428 INFO (Trigger): reducing was ok INFO (Trigger): trigger nr. 0 fullfilled for rho (0.000804>0.000100) INFO (Trigger): Steering parameter INFO (Trigger): Parameter steered [...]
but unfortunately, looking at the 2D output with VisIt, the finest
refinement level does not get enlarged (i.e. radius_1[5] does not appear to have been steered at all). Do you have any suggestions on how to get this trigger to work? Or, are you aware of other ways of obtaining the same result without using the thorn Trigger?
Changing these parameters has no effect, even if they were steerable.
CarpetRegrid2 uses these parameters to set up the initial grid structure, by setting the grid scalars "positions", "radius", etc. During regridding, only these grid scalars are examined; the parameters are ignored. Other mechanisms to update the grid structure (e.g. by tracking horizons or punctures) update these grid scalars, which then determines the grid structure during regridding. These grid scalars are checkpointed and recovered, as all grid variables are.
To modify the grid structure you need to modify these grid scalars. You can do this e.g. via Python by doing surgery on the checkpoint files, or by scheduling a function that runs right after recovery. Carpet performs a regridding step after recovering, before the first evolution step.
-erik
-- Erik Schnetter schnetter@cct.lsu.edu http://www.perimeterinstitute.ca/personal/eschnetter/
Hello Lorenzo,
in both the method Frank suggested and the one Erik suggested, the change will only take place at the next regrid (CarpetRegrid2::regrid_every or so) so you may also want to steer that parameter to 1 or so to force an immediate (well almost, I guess it could be 1 step) regrid (dangerous though since the steered parameter stays 1 until you steer it back to its original value).
Yours, Roland
Dear Erik, thank you very much. I am now trying the way Frank suggested before and, if again the finest refinement level does not get enlarged, I will probably try to edit the checkpoint files.
Sincerely, Lorenzo
Il giorno lun 14 giu 2021 alle ore 15:45 Erik Schnetter < schnetter@cct.lsu.edu> ha scritto:
On Mon, Jun 14, 2021 at 5:45 AM Lorenzo Ennoggi lorenzo.ennoggi@gmail.com wrote:
Dear all, I would like to restart a simulation from a checkpoint enlarging the
finest refinement level in my grid. In particular, I would like to change CarpetRegrid2::radius_1[5] = 20.1 to CarpetRegrid2::radius_1[5] = 25. I tried to do that by making the parameter CarpetRegrid2::radius_1 always steerable and adding the following lines to my parameter file:
ActiveThorns = "Trigger" Trigger::Trigger_Number = 1
Trigger::Trigger_Checked_Variable[0] = "hydrobase::rho" Trigger::Trigger_Relation[0] = ">" Trigger::Trigger_Checked_Value[0] = 1.e-4 Trigger::Trigger_Reduction[0] = "maximum"
Trigger::Trigger_Reaction[0] = "steerparam" Trigger::Trigger_Steered_Parameter_Thorn[0] = "CarpetRegrid2" Trigger::Trigger_Steered_Parameter_Name[0] = "radius_1[5]" Trigger::Trigger_Steered_Parameter_Value[0] = "25." #New value of the
above parameter
Trigger::Trigger_Once[0] = 1 #It means "yes" Trigger::Trigger_Debug = 1 #It means "yes"
In this way, the trigger should act immediately, as the maximum of rho
is ~1e-3 in my case. Indeed, it looks like the trigger is working fine, as the standard output says
[...] INFO (Trigger): Testing triggers INFO (Trigger): last_checked: -1 INFO (Trigger): reducing trigger 0 red_handle 2 varindex 428 INFO (Trigger): reducing was ok INFO (Trigger): trigger nr. 0 fullfilled for rho (0.000804>0.000100) INFO (Trigger): Steering parameter INFO (Trigger): Parameter steered [...]
but unfortunately, looking at the 2D output with VisIt, the finest
refinement level does not get enlarged (i.e. radius_1[5] does not appear to have been steered at all). Do you have any suggestions on how to get this trigger to work? Or, are you aware of other ways of obtaining the same result without using the thorn Trigger?
Changing these parameters has no effect, even if they were steerable.
CarpetRegrid2 uses these parameters to set up the initial grid structure, by setting the grid scalars "positions", "radius", etc. During regridding, only these grid scalars are examined; the parameters are ignored. Other mechanisms to update the grid structure (e.g. by tracking horizons or punctures) update these grid scalars, which then determines the grid structure during regridding. These grid scalars are checkpointed and recovered, as all grid variables are.
To modify the grid structure you need to modify these grid scalars. You can do this e.g. via Python by doing surgery on the checkpoint files, or by scheduling a function that runs right after recovery. Carpet performs a regridding step after recovering, before the first evolution step.
-erik
-- Erik Schnetter schnetter@cct.lsu.edu https://urldefense.com/v3/__http://www.perimeterinstitute.ca/personal/eschne...
Hi Lorenzo,
In my experience, it is not enough to change the value of the parameter: you also need to regrid. If you don't regrid, the grid configuration will not change. (At least, this is what I found using Trigger to change the number of refinement levels.) In your par file you regrid every 32 iterations, have you tried checking the output after regridding?
Gabriele
On Mon, Jun 14, 2021 at 8:37 AM Lorenzo Ennoggi lorenzo.ennoggi@gmail.com wrote:
Dear Erik, thank you very much. I am now trying the way Frank suggested before and, if again the finest refinement level does not get enlarged, I will probably try to edit the checkpoint files.
Sincerely, Lorenzo
Il giorno lun 14 giu 2021 alle ore 15:45 Erik Schnetter < schnetter@cct.lsu.edu> ha scritto:
On Mon, Jun 14, 2021 at 5:45 AM Lorenzo Ennoggi lorenzo.ennoggi@gmail.com wrote:
Dear all, I would like to restart a simulation from a checkpoint enlarging the
finest refinement level in my grid. In particular, I would like to change CarpetRegrid2::radius_1[5] = 20.1 to CarpetRegrid2::radius_1[5] = 25. I tried to do that by making the parameter CarpetRegrid2::radius_1 always steerable and adding the following lines to my parameter file:
ActiveThorns = "Trigger" Trigger::Trigger_Number = 1
Trigger::Trigger_Checked_Variable[0] = "hydrobase::rho" Trigger::Trigger_Relation[0] = ">" Trigger::Trigger_Checked_Value[0] = 1.e-4 Trigger::Trigger_Reduction[0] = "maximum"
Trigger::Trigger_Reaction[0] = "steerparam" Trigger::Trigger_Steered_Parameter_Thorn[0] = "CarpetRegrid2" Trigger::Trigger_Steered_Parameter_Name[0] = "radius_1[5]" Trigger::Trigger_Steered_Parameter_Value[0] = "25." #New value of the
above parameter
Trigger::Trigger_Once[0] = 1 #It means "yes" Trigger::Trigger_Debug = 1 #It means "yes"
In this way, the trigger should act immediately, as the maximum of rho
is ~1e-3 in my case. Indeed, it looks like the trigger is working fine, as the standard output says
[...] INFO (Trigger): Testing triggers INFO (Trigger): last_checked: -1 INFO (Trigger): reducing trigger 0 red_handle 2 varindex 428 INFO (Trigger): reducing was ok INFO (Trigger): trigger nr. 0 fullfilled for rho (0.000804>0.000100) INFO (Trigger): Steering parameter INFO (Trigger): Parameter steered [...]
but unfortunately, looking at the 2D output with VisIt, the finest
refinement level does not get enlarged (i.e. radius_1[5] does not appear to have been steered at all). Do you have any suggestions on how to get this trigger to work? Or, are you aware of other ways of obtaining the same result without using the thorn Trigger?
Changing these parameters has no effect, even if they were steerable.
CarpetRegrid2 uses these parameters to set up the initial grid structure, by setting the grid scalars "positions", "radius", etc. During regridding, only these grid scalars are examined; the parameters are ignored. Other mechanisms to update the grid structure (e.g. by tracking horizons or punctures) update these grid scalars, which then determines the grid structure during regridding. These grid scalars are checkpointed and recovered, as all grid variables are.
To modify the grid structure you need to modify these grid scalars. You can do this e.g. via Python by doing surgery on the checkpoint files, or by scheduling a function that runs right after recovery. Carpet performs a regridding step after recovering, before the first evolution step.
-erik
-- Erik Schnetter schnetter@cct.lsu.edu http://www.perimeterinstitute.ca/personal/eschnetter/
Users mailing list Users@einsteintoolkit.org http://lists.einsteintoolkit.org/mailman/listinfo/users
Dear Roland, Gabriele, thank you, that's a good point. Indeed, I let the system evolve for well more than 32 iterations after the refinement level to be enlarged pops out (at the time of checkpoint, before merger, that level is not yet present; it appears at the time of merger). But the level was not enlarged by simply steering the parameter with Trigger::Trigger_Reaction[0]="steerparam".
One thing that may be important (but I am not sure) is, as I just mentioned, that the refinement level I want to enlarge is not yet present at the time of checkpoint, it appears after ~2000 iterations.
Sincerely, Lorenzo
Il giorno lun 14 giu 2021 alle ore 18:02 Gabriele Bozzola < bozzola.gabriele@gmail.com> ha scritto:
Hi Lorenzo,
In my experience, it is not enough to change the value of the parameter: you also need to regrid. If you don't regrid, the grid configuration will not change. (At least, this is what I found using Trigger to change the number of refinement levels.) In your par file you regrid every 32 iterations, have you tried checking the output after regridding?
Gabriele
On Mon, Jun 14, 2021 at 8:37 AM Lorenzo Ennoggi lorenzo.ennoggi@gmail.com wrote:
Dear Erik, thank you very much. I am now trying the way Frank suggested before and, if again the finest refinement level does not get enlarged, I will probably try to edit the checkpoint files.
Sincerely, Lorenzo
Il giorno lun 14 giu 2021 alle ore 15:45 Erik Schnetter < schnetter@cct.lsu.edu> ha scritto:
On Mon, Jun 14, 2021 at 5:45 AM Lorenzo Ennoggi lorenzo.ennoggi@gmail.com wrote:
Dear all, I would like to restart a simulation from a checkpoint enlarging the
finest refinement level in my grid. In particular, I would like to change CarpetRegrid2::radius_1[5] = 20.1 to CarpetRegrid2::radius_1[5] = 25. I tried to do that by making the parameter CarpetRegrid2::radius_1 always steerable and adding the following lines to my parameter file:
ActiveThorns = "Trigger" Trigger::Trigger_Number = 1
Trigger::Trigger_Checked_Variable[0] = "hydrobase::rho" Trigger::Trigger_Relation[0] = ">" Trigger::Trigger_Checked_Value[0] = 1.e-4 Trigger::Trigger_Reduction[0] = "maximum"
Trigger::Trigger_Reaction[0] = "steerparam" Trigger::Trigger_Steered_Parameter_Thorn[0] = "CarpetRegrid2" Trigger::Trigger_Steered_Parameter_Name[0] = "radius_1[5]" Trigger::Trigger_Steered_Parameter_Value[0] = "25." #New value of the
above parameter
Trigger::Trigger_Once[0] = 1 #It means "yes" Trigger::Trigger_Debug = 1 #It means "yes"
In this way, the trigger should act immediately, as the maximum of rho
is ~1e-3 in my case. Indeed, it looks like the trigger is working fine, as the standard output says
[...] INFO (Trigger): Testing triggers INFO (Trigger): last_checked: -1 INFO (Trigger): reducing trigger 0 red_handle 2 varindex 428 INFO (Trigger): reducing was ok INFO (Trigger): trigger nr. 0 fullfilled for rho (0.000804>0.000100) INFO (Trigger): Steering parameter INFO (Trigger): Parameter steered [...]
but unfortunately, looking at the 2D output with VisIt, the finest
refinement level does not get enlarged (i.e. radius_1[5] does not appear to have been steered at all). Do you have any suggestions on how to get this trigger to work? Or, are you aware of other ways of obtaining the same result without using the thorn Trigger?
Changing these parameters has no effect, even if they were steerable.
CarpetRegrid2 uses these parameters to set up the initial grid structure, by setting the grid scalars "positions", "radius", etc. During regridding, only these grid scalars are examined; the parameters are ignored. Other mechanisms to update the grid structure (e.g. by tracking horizons or punctures) update these grid scalars, which then determines the grid structure during regridding. These grid scalars are checkpointed and recovered, as all grid variables are.
To modify the grid structure you need to modify these grid scalars. You can do this e.g. via Python by doing surgery on the checkpoint files, or by scheduling a function that runs right after recovery. Carpet performs a regridding step after recovering, before the first evolution step.
-erik
-- Erik Schnetter schnetter@cct.lsu.edu http://www.perimeterinstitute.ca/personal/eschnetter/
Users mailing list Users@einsteintoolkit.org http://lists.einsteintoolkit.org/mailman/listinfo/users
Hello Lorenzo,
this has been mentioned already but just to be sure:
"steerparam" cannot be used to change any of the CarpetRegrid2 parameters since it only uses the values of the parameters to create the initial set of boxes at t=0. Afterwards it uses (similarly named) grid scalars (so "steerscalar") and you can see how that is done eg in the gallery example for bns http://einsteintoolkit.org/gallery/bns/nsnstohmns.par near the end:
ActiveThorns = "Trigger" Trigger::Trigger_Number = 4
Trigger::Trigger_Checked_Variable[0]="Hydro_Analysis::Hydro_Analysis_rho_max_origin_distance" Trigger::Trigger_Reduction [0]="" Trigger::Trigger_Relation [0]="<" Trigger::Trigger_Checked_Value [0]=10 Trigger::Trigger_Reaction [0]="steerscalar" Trigger::Trigger_Steered_Scalar [0] = "CarpetRegrid2::num_levels[2]" # == num_levels_3 Trigger::Trigger_Steered_Scalar_Value[0] = "7"
Yours, Roland
Dear Roland, Gabriele, thank you, that's a good point. Indeed, I let the system evolve for well more than 32 iterations after the refinement level to be enlarged pops out (at the time of checkpoint, before merger, that level is not yet present; it appears at the time of merger). But the level was not enlarged by simply steering the parameter with Trigger::Trigger_Reaction[0]="steerparam".
One thing that may be important (but I am not sure) is, as I just mentioned, that the refinement level I want to enlarge is not yet present at the time of checkpoint, it appears after ~2000 iterations.
Sincerely, Lorenzo
Il giorno lun 14 giu 2021 alle ore 18:02 Gabriele Bozzola < bozzola.gabriele@gmail.com> ha scritto:
Hi Lorenzo,
In my experience, it is not enough to change the value of the parameter: you also need to regrid. If you don't regrid, the grid configuration will not change. (At least, this is what I found using Trigger to change the number of refinement levels.) In your par file you regrid every 32 iterations, have you tried checking the output after regridding?
Gabriele
On Mon, Jun 14, 2021 at 8:37 AM Lorenzo Ennoggi lorenzo.ennoggi@gmail.com wrote:
Dear Erik, thank you very much. I am now trying the way Frank suggested before and, if again the finest refinement level does not get enlarged, I will probably try to edit the checkpoint files.
Sincerely, Lorenzo
Il giorno lun 14 giu 2021 alle ore 15:45 Erik Schnetter < schnetter@cct.lsu.edu> ha scritto:
On Mon, Jun 14, 2021 at 5:45 AM Lorenzo Ennoggi lorenzo.ennoggi@gmail.com wrote:
Dear all, I would like to restart a simulation from a checkpoint enlarging the
finest refinement level in my grid. In particular, I would like to change CarpetRegrid2::radius_1[5] = 20.1 to CarpetRegrid2::radius_1[5] = 25. I tried to do that by making the parameter CarpetRegrid2::radius_1 always steerable and adding the following lines to my parameter file:
ActiveThorns = "Trigger" Trigger::Trigger_Number = 1
Trigger::Trigger_Checked_Variable[0] = "hydrobase::rho" Trigger::Trigger_Relation[0] = ">" Trigger::Trigger_Checked_Value[0] = 1.e-4 Trigger::Trigger_Reduction[0] = "maximum"
Trigger::Trigger_Reaction[0] = "steerparam" Trigger::Trigger_Steered_Parameter_Thorn[0] = "CarpetRegrid2" Trigger::Trigger_Steered_Parameter_Name[0] = "radius_1[5]" Trigger::Trigger_Steered_Parameter_Value[0] = "25." #New value of the
above parameter
Trigger::Trigger_Once[0] = 1 #It means "yes" Trigger::Trigger_Debug = 1 #It means "yes"
In this way, the trigger should act immediately, as the maximum of rho
is ~1e-3 in my case. Indeed, it looks like the trigger is working fine, as the standard output says
[...] INFO (Trigger): Testing triggers INFO (Trigger): last_checked: -1 INFO (Trigger): reducing trigger 0 red_handle 2 varindex 428 INFO (Trigger): reducing was ok INFO (Trigger): trigger nr. 0 fullfilled for rho (0.000804>0.000100) INFO (Trigger): Steering parameter INFO (Trigger): Parameter steered [...]
but unfortunately, looking at the 2D output with VisIt, the finest
refinement level does not get enlarged (i.e. radius_1[5] does not appear to have been steered at all). Do you have any suggestions on how to get this trigger to work? Or, are you aware of other ways of obtaining the same result without using the thorn Trigger?
Changing these parameters has no effect, even if they were steerable.
CarpetRegrid2 uses these parameters to set up the initial grid structure, by setting the grid scalars "positions", "radius", etc. During regridding, only these grid scalars are examined; the parameters are ignored. Other mechanisms to update the grid structure (e.g. by tracking horizons or punctures) update these grid scalars, which then determines the grid structure during regridding. These grid scalars are checkpointed and recovered, as all grid variables are.
To modify the grid structure you need to modify these grid scalars. You can do this e.g. via Python by doing surgery on the checkpoint files, or by scheduling a function that runs right after recovery. Carpet performs a regridding step after recovering, before the first evolution step.
-erik
-- Erik Schnetter schnetter@cct.lsu.edu https://urldefense.com/v3/__http://www.perimeterinstitute.ca/personal/eschne...
Users mailing list Users@einsteintoolkit.org https://urldefense.com/v3/__http://lists.einsteintoolkit.org/mailman/listinf...
Dear Roland, thank you. Indeed, steering the scalar worked fine for me.
Sincerely, Lorenzo
Il Ven 18 Giu 2021, 17:43 Roland Haas rhaas@illinois.edu ha scritto:
Hello Lorenzo,
this has been mentioned already but just to be sure:
"steerparam" cannot be used to change any of the CarpetRegrid2 parameters since it only uses the values of the parameters to create the initial set of boxes at t=0. Afterwards it uses (similarly named) grid scalars (so "steerscalar") and you can see how that is done eg in the gallery example for bns http://einsteintoolkit.org/gallery/bns/nsnstohmns.par near the end:
ActiveThorns = "Trigger" Trigger::Trigger_Number = 4
Trigger::Trigger_Checked_Variable[0]="Hydro_Analysis::Hydro_Analysis_rho_max_origin_distance" Trigger::Trigger_Reduction [0]="" Trigger::Trigger_Relation [0]="<" Trigger::Trigger_Checked_Value [0]=10 Trigger::Trigger_Reaction [0]="steerscalar" Trigger::Trigger_Steered_Scalar [0] = "CarpetRegrid2::num_levels[2]" # == num_levels_3 Trigger::Trigger_Steered_Scalar_Value[0] = "7"
Yours, Roland
Dear Roland, Gabriele, thank you, that's a good point. Indeed, I let the system evolve for well more than 32 iterations after the refinement level to be enlarged pops
out
(at the time of checkpoint, before merger, that level is not yet present; it appears at the time of merger). But the level was not enlarged by
simply
steering the parameter with Trigger::Trigger_Reaction[0]="steerparam".
One thing that may be important (but I am not sure) is, as I just mentioned, that the refinement level I want to enlarge is not yet present at the time of checkpoint, it appears after ~2000 iterations.
Sincerely, Lorenzo
Il giorno lun 14 giu 2021 alle ore 18:02 Gabriele Bozzola < bozzola.gabriele@gmail.com> ha scritto:
Hi Lorenzo,
In my experience, it is not enough to change the value of the
parameter:
you also need to regrid. If you don't regrid, the grid configuration
will
not change. (At least, this is what I found using Trigger to change the
number
of refinement levels.) In your par file you regrid every 32 iterations, have you tried checking the output after regridding?
Gabriele
On Mon, Jun 14, 2021 at 8:37 AM Lorenzo Ennoggi <
lorenzo.ennoggi@gmail.com>
wrote:
Dear Erik, thank you very much. I am now trying the way Frank suggested before
and,
if again the finest refinement level does not get enlarged, I will
probably
try to edit the checkpoint files.
Sincerely, Lorenzo
Il giorno lun 14 giu 2021 alle ore 15:45 Erik Schnetter < schnetter@cct.lsu.edu> ha scritto:
On Mon, Jun 14, 2021 at 5:45 AM Lorenzo Ennoggi lorenzo.ennoggi@gmail.com wrote:
Dear all, I would like to restart a simulation from a checkpoint enlarging
the
finest refinement level in my grid. In particular, I would like to
change
CarpetRegrid2::radius_1[5] = 20.1 to CarpetRegrid2::radius_1[5] =
- I
tried to do that by making the parameter CarpetRegrid2::radius_1
always
steerable and adding the following lines to my parameter file:
ActiveThorns = "Trigger" Trigger::Trigger_Number = 1
Trigger::Trigger_Checked_Variable[0] = "hydrobase::rho" Trigger::Trigger_Relation[0] = ">" Trigger::Trigger_Checked_Value[0] = 1.e-4 Trigger::Trigger_Reduction[0] = "maximum"
Trigger::Trigger_Reaction[0] = "steerparam" Trigger::Trigger_Steered_Parameter_Thorn[0] = "CarpetRegrid2" Trigger::Trigger_Steered_Parameter_Name[0] = "radius_1[5]" Trigger::Trigger_Steered_Parameter_Value[0] = "25." #New value of
the
above parameter
Trigger::Trigger_Once[0] = 1 #It means "yes" Trigger::Trigger_Debug = 1 #It means "yes"
In this way, the trigger should act immediately, as the maximum of
rho
is ~1e-3 in my case. Indeed, it looks like the trigger is working
fine, as
the standard output says
[...] INFO (Trigger): Testing triggers INFO (Trigger): last_checked: -1 INFO (Trigger): reducing trigger 0 red_handle 2 varindex 428 INFO (Trigger): reducing was ok INFO (Trigger): trigger nr. 0 fullfilled for rho
(0.000804>0.000100)
INFO (Trigger): Steering parameter INFO (Trigger): Parameter steered [...]
but unfortunately, looking at the 2D output with VisIt, the
finest
refinement level does not get enlarged (i.e. radius_1[5] does not
appear to
have been steered at all). Do you have any suggestions on how to get
this
trigger to work? Or, are you aware of other ways of obtaining the
same
result without using the thorn Trigger?
Changing these parameters has no effect, even if they were steerable.
CarpetRegrid2 uses these parameters to set up the initial grid structure, by setting the grid scalars "positions", "radius", etc. During regridding, only these grid scalars are examined; the parameters are ignored. Other mechanisms to update the grid structure (e.g. by tracking horizons or punctures) update these grid scalars, which then determines the grid structure during regridding. These
grid
scalars are checkpointed and recovered, as all grid variables are.
To modify the grid structure you need to modify these grid scalars. You can do this e.g. via Python by doing surgery on the checkpoint files, or by scheduling a function that runs right after recovery. Carpet performs a regridding step after recovering, before the first evolution step.
-erik
-- Erik Schnetter schnetter@cct.lsu.edu
https://urldefense.com/v3/__http://www.perimeterinstitute.ca/personal/eschne...
Users mailing list Users@einsteintoolkit.org
https://urldefense.com/v3/__http://lists.einsteintoolkit.org/mailman/listinf...
-- My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from http://pgp.mit.edu .
Hello Lorenzo,
thank you. Indeed, steering the scalar worked fine for me.
Glad to that this worked.
Yours, Roland
users@lists.einsteintoolkit.org