aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a>2000-03-27 13:21:32 +0000
committertradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a>2000-03-27 13:21:32 +0000
commit8a047f22532038b62432d6b6650881e4ba604236 (patch)
tree78a157a936f4af7f2219cab2083d52185f065437 /src
parentc3b23447635cfcfffa21a1f461077771c1cdd258 (diff)
Put the downsampling parameter values in IOUtil's GH extentsions into
a dynamic array rather than keep them fixed to only 3 dimensions (although IO provides parameters for only [x,y,z] at the moment). This simplifies the downsampling code for variables with arbitrary dimensions. code. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOUtil/trunk@51 b32723a9-ab3a-4a60-88e2-2e5d99d7c17a
Diffstat (limited to 'src')
-rw-r--r--src/GHExtension.c12
-rw-r--r--src/ioGH.h4
2 files changed, 10 insertions, 6 deletions
diff --git a/src/GHExtension.c b/src/GHExtension.c
index 197f0a3..5d10721 100644
--- a/src/GHExtension.c
+++ b/src/GHExtension.c
@@ -30,6 +30,7 @@ void *IOUtil_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH)
int IOUtil_InitGH(cGH *GH)
{
DECLARE_CCTK_PARAMETERS
+ int i;
ioGH *myGH;
myGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")];
@@ -80,9 +81,14 @@ int IOUtil_InitGH(cGH *GH)
/* save downsampling parameters in ioUtilGH because they are temporarily
reset during checkpointing */
- myGH->downsample_x = out3D_downsample_x;
- myGH->downsample_y = out3D_downsample_y;
- myGH->downsample_z = out3D_downsample_z;
+ myGH->downsample = (int *) malloc (CCTK_MaxDim () * sizeof (int));
+ /* for now we have only parameters for the first 3 dimensions
+ the rest is constantly initialized to 1 */
+ myGH->downsample [0] = out3D_downsample_x;
+ myGH->downsample [1] = out3D_downsample_y;
+ myGH->downsample [2] = out3D_downsample_z;
+ for (i = 3; i < CCTK_MaxDim (); i++)
+ myGH->downsample [i] = 1;
/* evaluate the out_single parameter only for Cactus compiled with
double precision */
diff --git a/src/ioGH.h b/src/ioGH.h
index 532314b..fc25b95 100644
--- a/src/ioGH.h
+++ b/src/ioGH.h
@@ -45,9 +45,7 @@ typedef struct IOGH {
int nioprocs; /* total number of IO processors */
int ioproc_every; /* output by every N'th processor */
int unchunked; /* if true generate unchunked output file */
- int downsample_x, /* downsampling parameters */
- downsample_y,
- downsample_z;
+ int *downsample; /* downsampling parameters array of size cctk_maxdim */
int out_single; /* if true output 3D data in single precision */
} ioGH;