aboutsummaryrefslogtreecommitdiff
path: root/src/ParseGeometry.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ParseGeometry.c')
-rw-r--r--src/ParseGeometry.c129
1 files changed, 0 insertions, 129 deletions
diff --git a/src/ParseGeometry.c b/src/ParseGeometry.c
deleted file mode 100644
index 556c69d..0000000
--- a/src/ParseGeometry.c
+++ /dev/null
@@ -1,129 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "cctk.h"
-#include "cctk_Arguments.h"
-#include "cctk_Parameters.h"
-
-#include "util_String.h"
-#include "IOJpeg.h"
-#include "CactusBase/IOASCII/src/ioASCIIGH.h"
-
-static const char *rcsid = "$Header$";
-
-CCTK_FILEVERSION(CactusIO_IOJpeg_ParseGeometry_c)
-
-void IOJpeg_DefaultGeo(const cGH *GH, int sdim, IOJpegGeo_t *geo) {
- DECLARE_CCTK_PARAMETERS
-
- asciiioGH *asGH;
- int idim,ti;
- const char *tmp_origin, *tmp_downs, *tmp_length;
- const char *token;
-
- asGH = (asciiioGH *) GH->extensions
- [CCTK_GHExtensionHandle ("IOASCII")];
-
- geo->vdim = -1;
- geo->sdim = sdim;
-
- for (idim=0;idim<SLABSKEL_MAXDIM;idim++) {
- geo->direction[idim] = idim;
- geo->slab_start[idim]= 0;
- geo->length[idim] =-1;
- geo->actlen[idim] =-1;
- geo->downs[idim] = 1;
- }
-
- /* FIXME: we use spxyz, which is hardcoded to 3D */
- for (idim=0;idim<3;idim++)
- geo->slab_start[idim]=asGH->spxyz[2][(idim+1)%3][idim];
-
- /* Parse the parameter of the requested dimension */
- switch (sdim) {
- case 2:
- tmp_origin = origin2D;
- tmp_downs = downsampling2D;
- tmp_length = length2D;
- break;
- default:
- tmp_origin = origin2D;
- tmp_downs = downsampling2D;
- tmp_length = length2D;
- break;
- }
-
- /* Origin, set from parameter only if parameter value .ne. -1 */
- idim=0;
- while((token = Util_StrSep(&tmp_origin,","))) {
- ti=atoi(token);
- if (ti>-1) geo->slab_start[idim++] = ti;
- }
- ti = atoi(tmp_origin);
- if (ti>-1) geo->slab_start[idim] = ti;
-
- /* Downsample */
- idim=0;
- while((token = Util_StrSep(&tmp_downs,","))) {
- geo->downs[idim++]=atoi(token);
- }
- geo->downs[idim] = atoi(tmp_downs);
-
- /* Length */
- idim=0;
- while((token = Util_StrSep(&tmp_length,","))) {
- geo->length[idim++]=atoi(token);
- }
- geo->length[idim] = atoi(tmp_length);
-}
-
-
-int IOJpeg_SetDirection (IOJpegGeo_t *geometry, int direction)
-{
- int retval = 0;
-
-
- if (geometry->vdim == 3)
- {
- if (geometry->sdim == 2)
- {
- switch (direction)
- {
- case 0: geometry->direction[0]=0; geometry->direction[1]=1; break;
- case 1: geometry->direction[0]=0; geometry->direction[1]=2; break;
- case 2: geometry->direction[0]=1; geometry->direction[1]=2; break;
- }
- }
- else if (geometry->sdim == 1)
- {
- switch (direction)
- {
- case 0: geometry->direction[0]=0; break;
- case 1: geometry->direction[0]=1; break;
- case 2: geometry->direction[0]=2; break;
- }
- }
- }
- else if (geometry->vdim==2)
- {
- if (geometry->sdim == 2)
- {
- geometry->direction[0]=0; geometry->direction[1]=1;
- }
- else if (geometry->sdim == 1)
- {
- switch (direction)
- {
- case 0: geometry->direction[0]=0; break;
- case 1: geometry->direction[0]=1; break;
- }
- }
- }
- else
- {
- retval = -1;
- }
-
- return (retval);
-}