aboutsummaryrefslogtreecommitdiff
path: root/src/ReductionNormInf.c
diff options
context:
space:
mode:
authortradke <tradke@d60812e6-3970-4df4-986e-c251b06effeb>2003-04-14 09:56:53 +0000
committertradke <tradke@d60812e6-3970-4df4-986e-c251b06effeb>2003-04-14 09:56:53 +0000
commit877563c30139297e78b0b41bc4d4727828958fc6 (patch)
tree1bc9a76c6872ddfc9c0dc227303f371cbecd2016 /src/ReductionNormInf.c
parentf69684d7aba78edce0e0465e8ba338ae19a1e4b7 (diff)
Handle all complex variable datatypes (not just the standard CCTK_COMPLEX).
This closes PR CactusPUGH/1475. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHReduce/trunk@36 d60812e6-3970-4df4-986e-c251b06effeb
Diffstat (limited to 'src/ReductionNormInf.c')
-rw-r--r--src/ReductionNormInf.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/ReductionNormInf.c b/src/ReductionNormInf.c
index c304477..363ca5b 100644
--- a/src/ReductionNormInf.c
+++ b/src/ReductionNormInf.c
@@ -217,7 +217,7 @@ static int ReductionNormInf (const cGH *GH,
{
int i, total_outvals;
#ifdef CCTK_MPI
- pGH *pughGH;
+ const pGH *pughGH;
CCTK_REAL *local_outvals;
#endif
@@ -322,6 +322,33 @@ static int ReductionNormInf (const cGH *GH,
CCTK_REAL, outvals, num_outvals, total_outvals);
break;
+#ifdef CCTK_REAL4
+#undef REDUCTION_OPERATION
+#define REDUCTION_OPERATION(norm_inf, scalar) norm_inf = MAX(norm_inf, CCTK_Cmplx8Abs(scalar))
+ ITERATE_ARRAY (CCTK_COMPLEX8, num_dims, inarrays[i],
+ from, to, iterator, points_per_dim,
+ CCTK_REAL4, outvals, num_outvals, total_outvals);
+ break;
+#endif
+
+#ifdef CCTK_REAL8
+#undef REDUCTION_OPERATION
+#define REDUCTION_OPERATION(norm_inf, scalar) norm_inf = MAX(norm_inf, CCTK_Cmplx16Abs(scalar))
+ ITERATE_ARRAY (CCTK_COMPLEX16, num_dims, inarrays[i],
+ from, to, iterator, points_per_dim,
+ CCTK_REAL8, outvals, num_outvals, total_outvals);
+ break;
+#endif
+
+#ifdef CCTK_REAL16
+#undef REDUCTION_OPERATION
+#define REDUCTION_OPERATION(norm_inf, scalar) norm_inf = MAX(norm_inf, CCTK_Cmplx32Abs(scalar))
+ ITERATE_ARRAY (CCTK_COMPLEX32, num_dims, inarrays[i],
+ from, to, iterator, points_per_dim,
+ CCTK_REAL16, outvals, num_outvals, total_outvals);
+ break;
+#endif
+
default:
CCTK_WARN (1, "PUGH_ReductionNormInf: Unknown variable type");
return (-1);