[Users] CCTK_Reduce sum reduction
Erik Schnetter
schnetter at cct.lsu.edu
Wed Jul 19 08:55:02 CDT 2017
Jens
Carpet offers two versions of the "sum" reduction:
The regular "sum" reduction is scaled by the volume of the refinement
levels, i.e. each level is scaled by a factor of 1/8. This would affect the
total you are seeing. This is done because that is what people need most of
the time, e.g. to calculate the total mass of a neutron star.
There is also an "isum" reduction that is not scaled this way. This simply
adds all values from all grid points (but still excluding ghosts,
boundaries etc.).
If you only want the sum over the finest level, then you should call the
reduction operation in level mode, not in global mode. It will then return
the result only from the current level.
-erik
On Wed, Jul 19, 2017 at 3:52 AM, Jens Mahlmann <jensmahl at alumni.uv.es>
wrote:
> Dear all,
>
> I am currently encountering some strange behavior when using the
> CCTK_Reduce "sum" reduction. I observe that CCTK_Reduce would return a
> global "sum" (=0.06) which is between the global "minimum" (=0.0) and
> the global "maximum" (=6.6). In the global mode I am calling
>
> CCTK_Reduce(cctkGH, -1, CCTK_ReductionHandle("sum"), 1,
> CCTK_VARIABLE_REAL,
> target_var, 1,
> CCTK_VarIndex("Thorn::source_var"))
>
> Maybe somebody has an instant idea what I should look for to fix this to
> have the desired summation? Especially, I would be interested in summing
> up the values only on the finest refinement level. Is there a standard,
> best-practice way to do so?
>
> Thank you very much and my best
>
> Jens
>
> _______________________________________________
> Users mailing list
> Users at einsteintoolkit.org
> http://lists.einsteintoolkit.org/mailman/listinfo/users
>
--
Erik Schnetter <schnetter at cct.lsu.edu>
http://www.perimeterinstitute.ca/personal/eschnetter/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/users/attachments/20170719/39464355/attachment.html
More information about the Users
mailing list