diff options
Diffstat (limited to 'src/IsoSurfacerInit.c')
-rw-r--r-- | src/IsoSurfacerInit.c | 80 |
1 files changed, 18 insertions, 62 deletions
diff --git a/src/IsoSurfacerInit.c b/src/IsoSurfacerInit.c index 3c2dcf9..c74698f 100644 --- a/src/IsoSurfacerInit.c +++ b/src/IsoSurfacerInit.c @@ -12,17 +12,23 @@ #include <cctk.h> #include <cctk_Parameters.h> -#include "IsoSurfacerGH.h" #include "IsoSurfacerInit.h" -isotimes_st isotimes; /* JMS: should not be a global */ -isotimes_st cdtimes; - /***************************************************************/ void *IsoSurfacer_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH){ isosurfacerGH *myGH=(isosurfacerGH*)malloc(sizeof(isosurfacerGH)); + /* initialize values */ + myGH->funcName=0; + myGH->formats=0; + myGH->outfreq=0; + myGH->firstIteration=0; + myGH->isovalue=0.0; + myGH->perprocessor.verts = myGH->totals.verts = NULL; + myGH->perprocessor.nverts = myGH->totals.nverts = 0; + myGH->perprocessor.polys = myGH->totals.polys = NULL; + myGH->perprocessor.npolys = myGH->totals.npolys = 0; return myGH; } @@ -36,7 +42,7 @@ int IsoSurfacer_InitGH (cGH *GH){ int outer_boundary_cutoff char *outdir */ - int n,i; + int n,i; isosurfacerGH *myGH; myGH = (isosurfacerGH *) GH->extensions [CCTK_GHExtensionHandle ("IsoSurfacer")]; @@ -46,9 +52,13 @@ int IsoSurfacer_InitGH (cGH *GH){ myGH->formats=0; myGH->outfreq=output_frequency; myGH->firstIteration=output_start; - myGH->resolution=1; - myGH->uniq_verts=1; myGH->isovalue=isovalue; + myGH->perprocessor.verts = myGH->totals.verts = NULL; + myGH->perprocessor.nverts = myGH->totals.nverts = 0; + myGH->perprocessor.polys = myGH->totals.polys = NULL; + myGH->perprocessor.npolys = myGH->totals.npolys = 0; + myGH->minval=0.0; + myGH->maxval=1.0; for(i=0,n=CCTK_NumVars();i<n;i++){ char *fullname = CCTK_FullName (i); @@ -78,8 +88,6 @@ int IsoSurfacer_InitGH (cGH *GH){ free (cmd); } /* otherwise, the outdir need not be created if it is '.' */ - memset(&isotimes, 0, sizeof(isotimes)); - memset(&cdtimes, 0, sizeof(cdtimes)); return 1; } @@ -91,61 +99,9 @@ void IsoSurfaceEnd(cGH *GH) myGH = (isosurfacerGH *) GH->extensions [CCTK_GHExtensionHandle ("IsoSurfacer")]; if( myGH->RunIsoSurfacer == 0 ) return; - -#if 0 - - - myGH = (isosurfacerGH *) GH->extensions [CCTK_GHExtensionHandle ("IsoSurfacer")]; - - /* Close Data Connections (If open) */ - if(myGH->datasocket) { - CCTK_INT4 i=0; - SendData(myGH->datasocket,"done",1,INT32,&i); - delete static_cast<DataSender*>(myGH->datasocket); - } - if(myGH->commandsocket) - delete static_cast<CommandReceiver*>(myGH->commandsocket); - -#endif // EXTERNAL_REMOTEIO - - printf("IsoSurfacer timing \n"); - printf("\n Total number of calls to the IsoSurfacer: %d\n", isotimes.ncalls); - printf(" Time spent in IsoSurfacer:\n"); - printf(" Total real time : %.4f s\n", - isotimes.realtime_total * 1.0 / CLK_TCK); -#ifndef _WIN32 - printf(" Total user time : %.4f s\n", - isotimes.tms_total.tms_utime * 1.0 / CLK_TCK); - printf(" Total system time : %.4f s\n", - isotimes.tms_total.tms_stime * 1.0 / CLK_TCK); - printf(" Average real time per call : %.4f s\n", - isotimes.realtime_total * 1.0 / CLK_TCK / isotimes.ncalls); - printf(" Average user time per call : %.4f s\n", - isotimes.tms_total.tms_utime * 1.0 / CLK_TCK / isotimes.ncalls); - printf(" Average system time per call : %.4f s\n", - isotimes.tms_total.tms_stime * 1.0 / CLK_TCK / isotimes.ncalls); -#endif - printf("\n Total number of calls to CollectData: %d\n", cdtimes.ncalls); - printf(" Time spent in CollectData:\n"); - printf(" Total real time : %.4f s\n", - cdtimes.realtime_total * 1.0 / CLK_TCK); -#ifndef _WIN32 - printf(" Total user time : %.4f s\n", - cdtimes.tms_total.tms_utime * 1.0 / CLK_TCK); - printf(" Total system time : %.4f s\n", - cdtimes.tms_total.tms_stime * 1.0 / CLK_TCK); -#endif - printf(" Average real time per call : %.4f s\n", - cdtimes.realtime_total * 1.0 / CLK_TCK / cdtimes.ncalls); -#ifndef _WIN32 - printf(" Average user time per call : %.4f s\n", - cdtimes.tms_total.tms_utime * 1.0 / CLK_TCK / cdtimes.ncalls); - printf(" Average system time per call : %.4f s\n", - cdtimes.tms_total.tms_stime * 1.0 / CLK_TCK / cdtimes.ncalls); - printf("--------------------------------------------------\n"); -#endif } +/* What the hell??? */ int IsoSurfacer_rfrTraverseGH (cGH *GH, int rfrpoint) { return 0; |