diff options
author | tradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a> | 2000-03-27 13:21:32 +0000 |
---|---|---|
committer | tradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a> | 2000-03-27 13:21:32 +0000 |
commit | 8a047f22532038b62432d6b6650881e4ba604236 (patch) | |
tree | 78a157a936f4af7f2219cab2083d52185f065437 /src | |
parent | c3b23447635cfcfffa21a1f461077771c1cdd258 (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.c | 12 | ||||
-rw-r--r-- | src/ioGH.h | 4 |
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 */ @@ -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; |