diff options
Diffstat (limited to 'src/ReductionNorm3.c')
-rw-r--r-- | src/ReductionNorm3.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ReductionNorm3.c b/src/ReductionNorm3.c index 65af154..86191d4 100644 --- a/src/ReductionNorm3.c +++ b/src/ReductionNorm3.c @@ -313,15 +313,19 @@ static int ReductionNorm3 (const cGH *GH, #endif case CCTK_VARIABLE_COMPLEX: +#define CUBE(x) ((x) * (x) * (x)) #undef REDUCTION_OPERATION -#define REDUCTION_OPERATION(norm3, scalar) norm3 += CUBE_ABS ((scalar).Re) +\ - CUBE_ABS ((scalar).Im) +#define REDUCTION_OPERATION(norm1, scalar) \ + norm1 += CUBE (CCTK_CmplxAbs (scalar)) ITERATE_ARRAY (CCTK_COMPLEX, num_dims, inarrays[i], from, to, iterator, points_per_dim, CCTK_REAL, outvals, num_outvals, total_outvals); break; #ifdef CCTK_REAL4 +#undef REDUCTION_OPERATION +#define REDUCTION_OPERATION(norm1, scalar) \ + norm1 += CUBE (CCTK_Cmplx8Abs (scalar)) ITERATE_ARRAY (CCTK_COMPLEX8, num_dims, inarrays[i], from, to, iterator, points_per_dim, CCTK_REAL4, outvals, num_outvals, total_outvals); @@ -329,6 +333,9 @@ static int ReductionNorm3 (const cGH *GH, #endif #ifdef CCTK_REAL8 +#undef REDUCTION_OPERATION +#define REDUCTION_OPERATION(norm1, scalar) \ + norm1 += CUBE (CCTK_Cmplx16Abs (scalar)) ITERATE_ARRAY (CCTK_COMPLEX16, num_dims, inarrays[i], from, to, iterator, points_per_dim, CCTK_REAL8, outvals, num_outvals, total_outvals); @@ -336,6 +343,9 @@ static int ReductionNorm3 (const cGH *GH, #endif #ifdef CCTK_REAL16 +#undef REDUCTION_OPERATION +#define REDUCTION_OPERATION(norm1, scalar) \ + norm1 += CUBE (CCTK_Cmplx32Abs (scalar)) ITERATE_ARRAY (CCTK_COMPLEX32, num_dims, inarrays[i], from, to, iterator, points_per_dim, CCTK_REAL16, outvals, num_outvals, total_outvals); |