diff options
author | tradke <tradke@7daa882c-dc44-4453-834e-278d26b18e6a> | 2008-03-26 11:39:07 +0000 |
---|---|---|
committer | tradke <tradke@7daa882c-dc44-4453-834e-278d26b18e6a> | 2008-03-26 11:39:07 +0000 |
commit | 0d357d0ec9a323db8a794b14832719f813fc5e70 (patch) | |
tree | db0e0148dc702264ef52d5ccb96c7cf0049acee4 /src/Norm4Functions.c | |
parent | 66d21077ed2e3427d824691e0f36f650759d2039 (diff) |
fix calculation of L2/L3/L4 norms for grid variables of datatype CCTK_COMPLEX
to a result datatype CCTK_REAL
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/LocalReduce/trunk@76 7daa882c-dc44-4453-834e-278d26b18e6a
Diffstat (limited to 'src/Norm4Functions.c')
-rw-r--r-- | src/Norm4Functions.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Norm4Functions.c b/src/Norm4Functions.c index 33f0dda..2114b41 100644 --- a/src/Norm4Functions.c +++ b/src/Norm4Functions.c @@ -2808,15 +2808,15 @@ int LocalReduce_Norm4_COMPLEX(int i, int weight_on, const void * const weight, C #ifdef CCTK_REAL_PRECISION_4 #undef REDUCTION_PREOP_CAST #define REDUCTION_PREOP_CAST(inval, typed_vdata,sum_indices, out_type) \ - inval = (CCTK_REAL4) POWER2((POWER2((typed_vdata[sum_indices]).Re)+POWER2((typed_vdata[sum_indices]).Im))); + inval = (CCTK_REAL4) CCTK_CmplxAbs(typed_vdata[sum_indices]); #elif CCTK_REAL_PRECISION_8 #undef REDUCTION_PREOP_CAST #define REDUCTION_PREOP_CAST(inval, typed_vdata,sum_indices, out_type) \ - inval = (CCTK_REAL8) POWER2((POWER2((typed_vdata[sum_indices]).Re)+POWER2((typed_vdata[sum_indices]).Im))); + inval = (CCTK_REAL8) CCTK_CmplxAbs(typed_vdata[sum_indices]); #elif CCTK_REAL_PRECISION_16 #undef REDUCTION_PREOP_CAST #define REDUCTION_PREOP_CAST(inval, typed_vdata,sum_indices, out_type) \ - inval = (CCTK_REAL16) POWER2((POWER2((typed_vdata[sum_indices]).Re)+POWER2((typed_vdata[sum_indices]).Im))); + inval = (CCTK_REAL16) CCTK_CmplxAbs(typed_vdata[sum_indices]); #endif #define REDUCTION_OPERATION(Norm4, scalar) Norm4 = Norm4 + POWER4(scalar); |