aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@bfcf8e34-485d-4d46-a995-1fd6fa6fb178>2001-06-14 12:57:23 +0000
committertradke <tradke@bfcf8e34-485d-4d46-a995-1fd6fa6fb178>2001-06-14 12:57:23 +0000
commitf14c1dc24715f982cb36ff9cf8624e06df5f7e5b (patch)
tree981252da4bd5fc124731f0a197b8708f59e6d8e6
parent1aeea4170532a2b2f1c6cc5f030fb890af614cbd (diff)
Fixed compiler warnings and the problem with 'char * = const char *' assignments
which didn't compile on a T3E. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IsoSurfacer/trunk@49 bfcf8e34-485d-4d46-a995-1fd6fa6fb178
-rw-r--r--src/IsoSurfacer.c28
-rw-r--r--src/IsoSurfacerInit.c31
-rw-r--r--src/IsoSurfacerInit.h1
-rw-r--r--src/NuSurfacer.c4
-rw-r--r--src/Startup.c3
5 files changed, 41 insertions, 26 deletions
diff --git a/src/IsoSurfacer.c b/src/IsoSurfacer.c
index 6da43c7..366e552 100644
--- a/src/IsoSurfacer.c
+++ b/src/IsoSurfacer.c
@@ -156,13 +156,13 @@ static int IsoSurfacerHandleCommands(cGH *GH)
return 0;
}
-static int doIso(int index, cGH *GH, isosurfacerGH *myGH)
+static int doIso(int vindex, cGH *GH, isosurfacerGH *myGH)
{
char *fullname;
if(!myGH->RunIsoSurfacer) return 0;
- fullname = CCTK_FullName (index);
+ fullname = CCTK_FullName (vindex);
/* printf("Check doIso: fullname[%s]:[%s]",fullname,myGH->funcName);*/
if(CCTK_Equals(fullname,myGH->funcName)){
if(myGH->firstIteration<=GH->cctk_iteration &&
@@ -177,20 +177,20 @@ static int doIso(int index, cGH *GH, isosurfacerGH *myGH)
}
-static void computeIso(int index, cGH *GH, isosurfacerGH *myGH)
+static void computeIso(int vindex, cGH *GH, isosurfacerGH *myGH)
{
DECLARE_CCTK_PARAMETERS
/* is it really required to have this static here?? */
char* fullname;
- int i,j;
+ int i;
int nx,ny,nz;
CCTK_REAL *xcoords,*ycoords,*zcoords,*data;
int timelevel=0;
if(!myGH->RunIsoSurfacer) return; /* not running */
- fullname = CCTK_FullName (index);
- data = (CCTK_REAL *) GH->data [index][timelevel];
+ fullname = CCTK_FullName (vindex);
+ data = (CCTK_REAL *) GH->data [vindex][timelevel];
nx=GH->cctk_lsh[0]; ny=GH->cctk_lsh[1]; nz=GH->cctk_lsh[2];
/* get the data pointer to the current timelevel of GF X */
@@ -212,10 +212,10 @@ static void computeIso(int index, cGH *GH, isosurfacerGH *myGH)
int handle;
handle = CCTK_ReductionHandle ("minimum");
CCTK_Reduce (GH, 0,handle,1,CCTK_VARIABLE_REAL,
- &(myGH->minval),1, index);
+ &(myGH->minval),1, vindex);
handle = CCTK_ReductionHandle ("maximum");
CCTK_Reduce (GH, 0, handle, 1, CCTK_VARIABLE_REAL,
- &(myGH->maxval), 1, index);
+ &(myGH->maxval), 1, vindex);
}
if (CCTK_MyProc (GH) == 0){
@@ -438,6 +438,10 @@ void WriteSock(cGH *GH, polypatch *totals, isosurfacerGH *myGH,
CCTK_REAL4 *verts;
CCTK_INT4 tmppolys[3] = {0,0,0};
CCTK_REAL4 tmpverts[3] = {0.0,0.0,0.0};
+
+ isoindex = isoindex;
+ IsoValue = IsoValue;
+
/* Needs to collect min/max here */
sprintf(tmpstring," :%s[0]=%f,%u range=%f:%f",
fullname,myGH->isovalue,
@@ -474,8 +478,8 @@ static void WriteHDF5(cGH *GH, polypatch *totals, isosurfacerGH *myGH,
strlen (PUGH_pGH (GH)->identity_string) + 20);
sprintf (filename, "%s/%s%s.iso.h5", outdir, fullname,
PUGH_pGH (GH)->identity_string);
-#if 0 /* disabled for now */
/* needs to extract min/max value for GF with CCTK_Reduction op*/
+#if 0 /* disabled for now */
IOHDF5_WriteIsosurface (GH, filename, fullname,
(CCTK_INT) GH->cctk_iteration,
(CCTK_INT) GridAll.timelevel,
@@ -490,6 +494,12 @@ static void WriteHDF5(cGH *GH, polypatch *totals, isosurfacerGH *myGH,
CCTK_WARN (1, "No HDF5 isosurface output because CactusPUGHIO/IOHDF5 was not compiled in !");
#endif
+ GH = GH;
+ totals = totals;
+ myGH = myGH;
+ fullname = fullname;
+ isoindex = isoindex;
+ IsoValue = IsoValue;
}
/***************************************************************************/
diff --git a/src/IsoSurfacerInit.c b/src/IsoSurfacerInit.c
index c0d4329..5b34c91 100644
--- a/src/IsoSurfacerInit.c
+++ b/src/IsoSurfacerInit.c
@@ -17,12 +17,20 @@
static const char *rcsid = "$Id$";
CCTK_FILEVERSION(CactusPUGHIO_IsoSurfacer_IsoSurfacerInit_c)
+void IsoSurfaceEnd(cGH *GH);
+static int IsoSurfacer_ParseIsoString(const char *isostring,isosurfacerGH *myGH);
+
/***************************************************************/
void *IsoSurfacer_SetupGH (tFleshConfig *config,
int convergence_level,
cGH *GH){
isosurfacerGH *myGH=(isosurfacerGH*)malloc(sizeof(isosurfacerGH));
+
/* initialize values */
+ config = config;
+ convergence_level = convergence_level;
+ GH = GH;
+
myGH->funcName=0;
myGH->formats=0;
myGH->outfreq=0;
@@ -50,8 +58,7 @@ int IsoSurfacer_InitGH (cGH *GH){
*/
int n,i;
isosurfacerGH *myGH;
- int Iso_SetupServer(cGH *GH, isosurfacerGH *myGH,
- int dataport, int clientport, int queue_size, int hunt);
+ int Iso_SetupServer(cGH *, isosurfacerGH *, int , int , int , int );
myGH = (isosurfacerGH *) GH->extensions [CCTK_GHExtensionHandle ("IsoSurfacer")];
@@ -78,7 +85,7 @@ int IsoSurfacer_InitGH (cGH *GH){
for(i=0,n=CCTK_NumVars();i<n;i++){
char *fullname = CCTK_FullName (i);
if(CCTK_Equals (fullname, output_var))
- myGH->funcName=output_var;
+ myGH->funcName=fullname;
/* Maybe even set the GF here ? */
free(fullname);
}
@@ -92,7 +99,7 @@ int IsoSurfacer_InitGH (cGH *GH){
/* OK, now we test to see if the 'isosurfacer' string
overrides everything set up by the new params */
- IsoSurfacer_ParseIsoString(isosurfacer,GH,myGH);
+ IsoSurfacer_ParseIsoString(isosurfacer,myGH);
if(myGH->funcName==0 || myGH->formats==0)
myGH->RunIsoSurfacer = 0;
@@ -121,11 +128,6 @@ void IsoSurfaceEnd(cGH *GH)
return;
}
-/* What the hell??? */
-int IsoSurfacer_rfrTraverseGH (cGH *GH, int rfrpoint)
-{
- return 0;
-}
/* Parse string from original isosurfacer.
Typical string is
"{(wavetoy::phi) (0.35) (SOCK) (1,1,1,1)}"
@@ -135,14 +137,15 @@ int IsoSurfacer_rfrTraverseGH (cGH *GH, int rfrpoint)
at this point. We can ignore the other params since they are
redundant (already functionally covered by IOBase params)
*/
-int IsoSurfacer_ParseIsoString(char *isostring,cGH *GH,isosurfacerGH *myGH){
- char *s,*snext,*si;
+static int IsoSurfacer_ParseIsoString(const char *isostring,isosurfacerGH *myGH){
+ char *s,*snext,*si,*free_me;
int len;
+
if(!isostring) return 0;
if((len=strlen(isostring))<4) return 0; /* nothing to write home about here... */
s = (char *)malloc(len+1);
strcpy(s,isostring); /* we are going to do some destructive parsing here */
- isostring = s; /* remember this string for when we free it */
+ free_me = s; /* remember this string for when we free it */
/* Now we parse */
snext=strchr(s,'('); /* move to first '(' */
@@ -151,7 +154,7 @@ int IsoSurfacer_ParseIsoString(char *isostring,cGH *GH,isosurfacerGH *myGH){
si=strchr(s,',');
if(si && si<snext) *si='\0';
else if(snext) *snext='\0';
- else {free(isostring); return 0; } /* parse failure */
+ else {free(free_me); return 0; } /* parse failure */
myGH->funcName=(char*)malloc(strlen(s)+1);
strcpy(myGH->funcName,s); /* got the varname for the output var */
/* printf("****************IsoSurf[%s]\n",myGH->funcName); */
@@ -180,7 +183,7 @@ int IsoSurfacer_ParseIsoString(char *isostring,cGH *GH,isosurfacerGH *myGH){
/* we are all done now. The rest is ignored because it contains
redundant or obsolete information which doesnt really fit into
the new parser model */
- free(isostring); /* free our temporary storage */
+ free(free_me); /* free our temporary storage */
return 1; /* parse was successful */
}
diff --git a/src/IsoSurfacerInit.h b/src/IsoSurfacerInit.h
index 6cde6f3..0a710e2 100644
--- a/src/IsoSurfacerInit.h
+++ b/src/IsoSurfacerInit.h
@@ -16,7 +16,6 @@
void *IsoSurfacer_SetupGH (tFleshConfig *config, int convergence_level,cGH *GH);
int IsoSurfacer_InitGH (cGH *GH);
int IsoSurfacer (cGH *GH);
-int IsoSurfacer_ParseIsoString(char *isostring,cGH *GH,isosurfacerGH *myGH);
int IsoSurfacer_TriggerOutput (cGH *GH, int);
int IsoSurfacer_TimeForOutput (cGH *GH, int);
diff --git a/src/NuSurfacer.c b/src/NuSurfacer.c
index f7a0870..d8377f1 100644
--- a/src/NuSurfacer.c
+++ b/src/NuSurfacer.c
@@ -412,6 +412,7 @@ static int cellOffset[8]={0,0,0,0,0,0,0,0};
6 = 1+ GH->cctk_lsh [0] + GH->cctk_lsh [0]*GH->cctk_lsh [1]
7 = GH->cctk_lsh [0] + GH->cctk_lsh [0]*GH->cctk_lsh [1]
*/
+void InitCellArrays(int nx,int ny);
static int isoCellOffset[12]={0,0,0,0, /* -zy,-z,-z,-zx, */
0,0,0,0, /* -y,0,0,-x, */
0,0,0,0};/* -yx,-y,-x,0 */
@@ -421,7 +422,7 @@ static int isoCellVindex[12]={1,0,1,0,
/* cell vector orientation? */
-void InitCellArrays(nx,ny){
+void InitCellArrays(int nx,int ny){
int i,j;
int ix=1,iy=nx,iz=nx*ny;
cellslice = New(IsoCell,2*nx*ny); /* 2 slices */
@@ -456,7 +457,6 @@ void NuFindSurface(CCTK_REAL *data,
TRIANGLE_CASES *triCase;
EDGE_LIST *edge;
int i,j,k,imax,jmax,kmax;
- int timelevel;
int idx,nverts=0; /* vertex and triangle counters for offsets */
int slicesize,slicemodulo;
diff --git a/src/Startup.c b/src/Startup.c
index 78fb187..1353bd4 100644
--- a/src/Startup.c
+++ b/src/Startup.c
@@ -22,6 +22,8 @@
static const char *rcsid = "$Id$";
CCTK_FILEVERSION(CactusPUGHIO_IsoSurfacer_Startup_c)
+int IsoSurfacer_Startup(void);
+void IsoSurfacer_Worker(CCTK_ARGUMENTS);
/*int Iso_SetupServer(int dataport, int clientport, int queue_size, int hunt);
Iso_SetupServer(7051, 7050, 5, 1); needs to move into InitGH */
@@ -40,6 +42,7 @@ int IsoSurfacer_Startup(void)
CCTK_RegisterIOMethodTimeToOutput (IOMethod, IsoSurfacer_TimeForOutput);
CCTK_RegisterIOMethodTriggerOutput (IOMethod, IsoSurfacer_TriggerOutput);
+ return (0);
}
int Iso_Poll(cGH *cctkGH, long sec, long usec);