Hello, I'm doing a simulation for BBH and I want to calculate the norm2 of the Hamiltonian constraints on different grid levels. Ideally i would like to calculate it first removing the first level of the grid, then removing it and the second one and so on...(the purpose is that i want to exclude the boundary contribution to the calculation). Do you know if there is a tool in the ET to do it?
Thanks
Elena De Paoli
Hello Elena,
if you schedule your function using:
options: level
instead of
options: global
then a call to Cactus' reduction interface will compute the reduction only over the current refinement level.
Note that the sum of the norm2 of all the levels will not be the same as the norm2 of all levels computed at once (because when computing only on a single level Carpet will not "cut out" regions where a finer grid exists).
The alternative is to introduce a helper grid function where you manually zero out the regions you do not care about then compute the norm of that grid function.
You can use Carpet's aliased function GetRefinementLevel to find out the current refinement level:
CCTK_INT FUNCTION \ GetRefinementLevels \ (CCTK_POINTER_TO_CONST IN cctkGH) PROVIDES FUNCTION GetRefinementLevels \ WITH Carpet_GetRefinementLevels \ LANGUAGE C
You can copy (or use) GenericFD's GenericFD_GetBoundaryInfo function to get information about whether a given face is a boundary and if so what kind of boundary.
See repos/Kranc/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c
Yours, Roland
Hello, I'm doing a simulation for BBH and I want to calculate the norm2 of the Hamiltonian constraints on different grid levels. Ideally i would like to calculate it first removing the first level of the grid, then removing it and the second one and so on...(the purpose is that i want to exclude the boundary contribution to the calculation). Do you know if there is a tool in the ET to do it?
Thanks
Elena De Paoli
On 15 Jun 2019, at 17:22, Haas, Roland <rhaas@illinois.edumailto:rhaas@illinois.edu> wrote:
The alternative is to introduce a helper grid function where you manually zero out the regions you do not care about then compute the norm of that grid function.
Perhaps a mask would be of use here?
-- Ian Hinder Research Software Engineer University of Manchester, UK
Hello Ian,
Perhaps a mask would be of use here?
You mean: being able to pass a mask to the reduce function in Cactus?
Would be nice, unfortunately as far as I know, the "old" reduction interface using CCTK_Reduce (http://einsteintoolkit.org/usersguide/UsersGuidech9.html#verbatim-64) which Carpet uses does not let you pass in a param_table_handle the way that CCTK_ReduceGridArrays (http://einsteintoolkit.org/referencemanual/ReferenceManualch2.html#x4-165000...) does.
So one would first have to convert Carpet to support the "new" reduction interface (which is probably simple as the differences seem minor to me).
Yours, Roland
On 15 Jun 2019, at 18:10, Haas, Roland <rhaas@illinois.edumailto:rhaas@illinois.edu> wrote:
Hello Ian,
Perhaps a mask would be of use here? You mean: being able to pass a mask to the reduce function in Cactus?
Would be nice, unfortunately as far as I know, the "old" reduction interface using CCTK_Reduce (http://einsteintoolkit.org/usersguide/UsersGuidech9.html#verbatim-64) which Carpet uses does not let you pass in a param_table_handle the way that CCTK_ReduceGridArrays (http://einsteintoolkit.org/referencemanual/ReferenceManualch2.html#x4-165000...) does.
So one would first have to convert Carpet to support the "new" reduction interface (which is probably simple as the differences seem minor to me).
I meant to use CarpetMask; isn't this a way to mask points from reductions?
-- Ian Hinder Research Software Engineer University of Manchester, UK
Hello Ian,
I meant to use CarpetMask; isn't this a way to mask points from reductions?
CarpetMask does not directly offe a "mask" grid function instead it has code (and parameters) to mark a spherical region or the interior of a spherical surface as to be ignored.
It does so by modifying the "weight" grid function in CarpetReduce which is used by all reductions, so modifying it for one thorn will make reductions behave unexpectedly for all thorns.
This may be sufficient for the original issue namely to "exclude the boundary contribution to the calculation". It will be remove that contribution from any and all reduction operations.
You could also modify CarpetReduce::weight directly by setting it to zero in regions you want to exclude.
Yours, Roland
users@lists.einsteintoolkit.org