From 5dbbb70bb9834ed7e67470fe0938df813e756071 Mon Sep 17 00:00:00 2001 From: schnetter Date: Mon, 13 Oct 2003 18:07:50 +0000 Subject: Introduce the new Cactus variable type CCTK_INT1. Extend routines to handle the new type. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHReduce/trunk@44 d60812e6-3970-4df4-986e-c251b06effeb --- src/Reduction.c | 12 ++++++++++++ src/ReductionAvg.c | 8 ++++++++ src/ReductionMax.c | 8 ++++++++ src/ReductionMin.c | 8 ++++++++ src/ReductionNorm1.c | 8 ++++++++ src/ReductionNorm2.c | 8 ++++++++ src/ReductionNorm3.c | 8 ++++++++ src/ReductionNorm4.c | 8 ++++++++ src/ReductionNormInf.c | 8 ++++++++ src/ReductionSum.c | 8 ++++++++ 10 files changed, 84 insertions(+) diff --git a/src/Reduction.c b/src/Reduction.c index 30ddfd5..7ca59a0 100644 --- a/src/Reduction.c +++ b/src/Reduction.c @@ -569,6 +569,18 @@ static int copy_real_to_outtype (int num_elems, _outarray[i] = (CCTK_INT) inarray[i]; } } +#ifdef CCTK_INT1 + else if (outtype == CCTK_VARIABLE_INT1) + { + CCTK_INT1 *_outarray = (CCTK_INT1 *) outarray; + + + for (i = 0; i < num_elems; i++) + { + _outarray[i] = (CCTK_INT1) inarray[i]; + } + } +#endif #ifdef CCTK_INT2 else if (outtype == CCTK_VARIABLE_INT2) { diff --git a/src/ReductionAvg.c b/src/ReductionAvg.c index a2bc35d..07f2968 100644 --- a/src/ReductionAvg.c +++ b/src/ReductionAvg.c @@ -246,6 +246,14 @@ static int ReductionAvg (const cGH *GH, CCTK_INT, outvals, num_outvals, total_outvals); break; +#ifdef CCTK_INT1 + case CCTK_VARIABLE_INT1: + ITERATE_ARRAY (CCTK_INT1, num_dims, inarrays[i], + from, to, iterator, points_per_dim, + CCTK_INT1, outvals, num_outvals, total_outvals); + break; +#endif + #ifdef CCTK_INT2 case CCTK_VARIABLE_INT2: ITERATE_ARRAY (CCTK_INT2, num_dims, inarrays[i], diff --git a/src/ReductionMax.c b/src/ReductionMax.c index a1fceb8..2ae7e48 100644 --- a/src/ReductionMax.c +++ b/src/ReductionMax.c @@ -247,6 +247,14 @@ static int ReductionMaxVal (const cGH *GH, CCTK_INT, outvals, num_outvals, total_outvals); break; +#ifdef CCTK_INT1 + case CCTK_VARIABLE_INT1: + ITERATE_ARRAY (CCTK_INT1, num_dims, inarrays[i], + from, to, iterator, points_per_dim, + CCTK_INT1, outvals, num_outvals, total_outvals); + break; +#endif + #ifdef CCTK_INT2 case CCTK_VARIABLE_INT2: ITERATE_ARRAY (CCTK_INT2, num_dims, inarrays[i], diff --git a/src/ReductionMin.c b/src/ReductionMin.c index ab76dfc..001e00d 100644 --- a/src/ReductionMin.c +++ b/src/ReductionMin.c @@ -248,6 +248,14 @@ static int ReductionMinVal (const cGH *GH, CCTK_INT, outvals, num_outvals, total_outvals); break; +#ifdef CCTK_INT1 + case CCTK_VARIABLE_INT1: + ITERATE_ARRAY (CCTK_INT1, num_dims, inarrays[i], + from, to, iterator, points_per_dim, + CCTK_INT1, outvals, num_outvals, total_outvals); + break; +#endif + #ifdef CCTK_INT2 case CCTK_VARIABLE_INT2: ITERATE_ARRAY (CCTK_INT2, num_dims, inarrays[i], diff --git a/src/ReductionNorm1.c b/src/ReductionNorm1.c index 1394a4a..8aa4d72 100644 --- a/src/ReductionNorm1.c +++ b/src/ReductionNorm1.c @@ -251,6 +251,14 @@ static int ReductionNorm1 (const cGH *GH, CCTK_INT, outvals, num_outvals, total_outvals); break; +#ifdef CCTK_INT1 + case CCTK_VARIABLE_INT1: + ITERATE_ARRAY (CCTK_INT1, num_dims, inarrays[i], + from, to, iterator, points_per_dim, + CCTK_INT1, outvals, num_outvals, total_outvals); + break; +#endif + #ifdef CCTK_INT2 case CCTK_VARIABLE_INT2: ITERATE_ARRAY (CCTK_INT2, num_dims, inarrays[i], diff --git a/src/ReductionNorm2.c b/src/ReductionNorm2.c index 35d65f8..eaf3cc9 100644 --- a/src/ReductionNorm2.c +++ b/src/ReductionNorm2.c @@ -250,6 +250,14 @@ static int ReductionNorm2 (const cGH *GH, CCTK_INT, outvals, num_outvals, total_outvals); break; +#ifdef CCTK_INT1 + case CCTK_VARIABLE_INT1: + ITERATE_ARRAY (CCTK_INT1, num_dims, inarrays[i], + from, to, iterator, points_per_dim, + CCTK_INT1, outvals, num_outvals, total_outvals); + break; +#endif + #ifdef CCTK_INT2 case CCTK_VARIABLE_INT2: ITERATE_ARRAY (CCTK_INT2, num_dims, inarrays[i], diff --git a/src/ReductionNorm3.c b/src/ReductionNorm3.c index f5036af..56b53b0 100644 --- a/src/ReductionNorm3.c +++ b/src/ReductionNorm3.c @@ -249,6 +249,14 @@ static int ReductionNorm3 (const cGH *GH, CCTK_INT, outvals, num_outvals, total_outvals); break; +#ifdef CCTK_INT1 + case CCTK_VARIABLE_INT1: + ITERATE_ARRAY (CCTK_INT1, num_dims, inarrays[i], + from, to, iterator, points_per_dim, + CCTK_INT1, outvals, num_outvals, total_outvals); + break; +#endif + #ifdef CCTK_INT2 case CCTK_VARIABLE_INT2: ITERATE_ARRAY (CCTK_INT2, num_dims, inarrays[i], diff --git a/src/ReductionNorm4.c b/src/ReductionNorm4.c index 8132aa2..331b67e 100644 --- a/src/ReductionNorm4.c +++ b/src/ReductionNorm4.c @@ -247,6 +247,14 @@ static int ReductionNorm4 (const cGH *GH, CCTK_INT, outvals, num_outvals, total_outvals); break; +#ifdef CCTK_INT1 + case CCTK_VARIABLE_INT1: + ITERATE_ARRAY (CCTK_INT1, num_dims, inarrays[i], + from, to, iterator, points_per_dim, + CCTK_INT1, outvals, num_outvals, total_outvals); + break; +#endif + #ifdef CCTK_INT2 case CCTK_VARIABLE_INT2: ITERATE_ARRAY (CCTK_INT2, num_dims, inarrays[i], diff --git a/src/ReductionNormInf.c b/src/ReductionNormInf.c index fa4ea97..906070d 100644 --- a/src/ReductionNormInf.c +++ b/src/ReductionNormInf.c @@ -263,6 +263,14 @@ static int ReductionNormInf (const cGH *GH, CCTK_INT, outvals, num_outvals, total_outvals); break; +#ifdef CCTK_INT1 + case CCTK_VARIABLE_INT1: + ITERATE_ARRAY (CCTK_INT1, num_dims, inarrays[i], + from, to, iterator, points_per_dim, + CCTK_INT1, outvals, num_outvals, total_outvals); + break; +#endif + #ifdef CCTK_INT2 case CCTK_VARIABLE_INT2: ITERATE_ARRAY (CCTK_INT2, num_dims, inarrays[i], diff --git a/src/ReductionSum.c b/src/ReductionSum.c index 1610f35..ce21d71 100644 --- a/src/ReductionSum.c +++ b/src/ReductionSum.c @@ -246,6 +246,14 @@ static int ReductionSum (const cGH *GH, CCTK_INT, outvals, num_outvals, total_outvals); break; +#ifdef CCTK_INT1 + case CCTK_VARIABLE_INT1: + ITERATE_ARRAY (CCTK_INT1, num_dims, inarrays[i], + from, to, iterator, points_per_dim, + CCTK_INT1, outvals, num_outvals, total_outvals); + break; +#endif + #ifdef CCTK_INT2 case CCTK_VARIABLE_INT2: ITERATE_ARRAY (CCTK_INT2, num_dims, inarrays[i], -- cgit v1.2.3