aboutsummaryrefslogtreecommitdiff
path: root/src/ICN.c
diff options
context:
space:
mode:
authorhawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2004-06-23 06:58:27 +0000
committerhawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2004-06-23 06:58:27 +0000
commitf2354d8e2968cdda27d7aacdea93fe205dc406b6 (patch)
tree1b6fc5d793ebe55bd72b0b992d92b8e986ec7e10 /src/ICN.c
parent8c508e75afcb8fc262e88e64e55331b069cbd525 (diff)
Make MoL independent of dimensions for GFs.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@70 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
Diffstat (limited to 'src/ICN.c')
-rw-r--r--src/ICN.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ICN.c b/src/ICN.c
index f6bbfd6..9966adb 100644
--- a/src/ICN.c
+++ b/src/ICN.c
@@ -102,7 +102,12 @@ void MoL_ICNAdd(CCTK_ARGUMENTS)
cctk_time);
#endif
- totalsize = cctk_lsh[0] * cctk_lsh[1] * cctk_lsh[2];
+ totalsize = 1;
+ for (arraydim = 0; arraydim < cctk_dim; arraydim++)
+ {
+ totalsize *= cctk_lsh[arraydim];
+ }
+
#ifdef MOLDEBUG
printf("MoL: the ICN routine says dt = %f.\n", CCTK_DELTA_TIME);
#endif
@@ -232,7 +237,12 @@ void MoL_ICNAverage(CCTK_ARGUMENTS)
cctk_time);
#endif
- totalsize = cctk_lsh[0] * cctk_lsh[1] * cctk_lsh[2];
+ totalsize = 1;
+ for (arraydim = 0; arraydim < cctk_dim; arraydim++)
+ {
+ totalsize *= cctk_lsh[arraydim];
+ }
+
#ifdef MOLDEBUG
printf("MoL: the ICN routine says dt = %f.\n", CCTK_DELTA_TIME);
#endif