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