[cig-commits] r14262 - in long/3D/SNAC/trunk/Snac: libSnac/src plugins/hillSlope plugins/restarter snac2restart snac2vtk

cstark at geodynamics.org cstark at geodynamics.org
Sun Mar 8 15:38:48 PDT 2009


Author: cstark
Date: 2009-03-08 15:38:48 -0700 (Sun, 08 Mar 2009)
New Revision: 14262

Modified:
   long/3D/SNAC/trunk/Snac/libSnac/src/Context.c
   long/3D/SNAC/trunk/Snac/plugins/hillSlope/CreateWeakPoints.c
   long/3D/SNAC/trunk/Snac/plugins/hillSlope/InitialConditions.c
   long/3D/SNAC/trunk/Snac/plugins/restarter/InitialConditions.c
   long/3D/SNAC/trunk/Snac/plugins/restarter/InitialConditions.h
   long/3D/SNAC/trunk/Snac/plugins/restarter/Register.c
   long/3D/SNAC/trunk/Snac/snac2restart/snac2restart.c
   long/3D/SNAC/trunk/Snac/snac2vtk/snac2vtk.c
Log:
Restarter: major bug fixes and structural changes

1) Changed snac2restart.c to make work with restarter plugin
2) Changed restarter plugin code to sync with these changes
3) Changed hillSlope plugin initial conditions to allow restart
4) Debugging report line added to libSnac Context.c to aid checking of above

Details:

1a) Cut processing of plStrainTensor since this state var is never output by Snac
1b) Changed isoForce to force since that's the way Snac outputs this state var now
1c) Standardized and improved names of velocity (velo -> vel) and stress tensor files (strTensor -> stressTensor).
1d) Made filenames more consistent (e.g. time step stamp same on each now)
1e) Significantly improved quality of reporting of processing steps
1f) Changed command line handling so that input (read) path specified instead of output path
1g) Default output path to cwd - ie implemented different input & output paths, since we don't want the startup files in the same dir as the Snac output

2a) Changed names of restart files to make consistent with (1)
2b) Improved reporting and added debug report lines
2c) Experimented with changes in Register.c before realizing they were unnecessary
2d) Noted: reading of initial coords is misleadingly named - both initial and later coords are output by snac2restart but restarter's InitialConditions.c erroneously suggests it reads in initial (t=0) which is *not* what we want.

3a) Added plugin processing to hillslope's InitialConditions.c to detect if restarter has been loaded; if so, bail
3b) Added report in this module to make clear if InitialConditions (mesh distortion) are being executed or not

4a) Debug-only printing added to Snac_Context_TimeStepZero to make clear restart time steps - both relative to previous run and actual

TO DO: Printing at each time step gives erroneous total time steps in restart mode since maxTimeSteps is not communicated to StGermain.  This "bug" is in AbstractContext.c.  Not at all clear how to resolve it.





Modified: long/3D/SNAC/trunk/Snac/libSnac/src/Context.c
===================================================================
--- long/3D/SNAC/trunk/Snac/libSnac/src/Context.c	2009-03-08 20:02:11 UTC (rev 14261)
+++ long/3D/SNAC/trunk/Snac/libSnac/src/Context.c	2009-03-08 22:38:48 UTC (rev 14262)
@@ -59,6 +59,8 @@
 	#define PATH_MAX 1024
 #endif
 
+#define DEBUG
+
 /* Textual name of this class */
 const Type Snac_Context_Type = "Snac_Context";
 
@@ -896,6 +898,10 @@
 	if( self->restartStep > 0 )
 		self->timeStep = self->restartStep;
 
+#ifdef DEBUG
+	fprintf(stderr, "TimeStepZero:  restartStep=%d,  timeStep=%d\n", self->restartStep, self->timeStep);
+#endif
+
 	_Snac_Context_InitDump( self );
 
 

Modified: long/3D/SNAC/trunk/Snac/plugins/hillSlope/CreateWeakPoints.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/hillSlope/CreateWeakPoints.c	2009-03-08 20:02:11 UTC (rev 14261)
+++ long/3D/SNAC/trunk/Snac/plugins/hillSlope/CreateWeakPoints.c	2009-03-08 22:38:48 UTC (rev 14262)
@@ -103,35 +103,18 @@
     int                         index, index_I,index_J,index_K;
     IJK				ijk;
 
-    /* 	int				restart = 0; */
-    /* 	Dictionary_Entry_Value	 	*pluginsList, *plugin; */
-    /* #ifdef DEBUG */
-    /* 	int imax=0; */
-    /* #endif */
-    /* 	pluginsList = PluginsManager_GetPluginsList( context->dictionary ); */
-    /* 	if (pluginsList) { */
-    /* 		plugin = Dictionary_Entry_Value_GetFirstElement(pluginsList); */
-    /* 		while ( plugin ) { */
-    /* 			if ( 0 == strcmp( Dictionary_Entry_Value_AsString( plugin ), */
-    /* 					  "SnacRestart" ) ) { */
-    /* 				restart = 1; */
-    /* 				break; */
-    /* 			} */
-    /* 			plugin = plugin->next; */
-    /* 		} */
-    /* 	} */
-    /* 	if( restart ) */
-    /* 		return; */
 
-
-
     /*
      *  Bail now if initial elastic equilibrium has not been reached on all threads
      *
      *  Also bail if we're solving elastic eqm only
      */
     if(!contextExt->consensusElasticStabilizedFlag || contextExt->seedingCompletedFlag
-       || (contextExt->solveElasticEqmOnlyFlag)) return;
+       || (contextExt->solveElasticEqmOnlyFlag)) {
+/* 	fprintf(stderr,"Bailing from CWP: consensusElasticStabilized=%d, seedingCompletedFlag=%d, solveElasticEqmOnlyFlag=%d\n", */
+/* 		contextExt->consensusElasticStabilizedFlag, contextExt->seedingCompletedFlag, contextExt->solveElasticEqmOnlyFlag); */
+	return;
+    }
 
     //    fprintf(stderr, "CWP\n");
 

Modified: long/3D/SNAC/trunk/Snac/plugins/hillSlope/InitialConditions.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/hillSlope/InitialConditions.c	2009-03-08 20:02:11 UTC (rev 14261)
+++ long/3D/SNAC/trunk/Snac/plugins/hillSlope/InitialConditions.c	2009-03-08 22:38:48 UTC (rev 14262)
@@ -88,27 +88,29 @@
     const double		smoothFactor = contextExt->rampFlatSmoothFactor;
 
 
-    /* 	int				restart = 0; */
-    /* 	Dictionary_Entry_Value	 	*pluginsList, *plugin; */
-    /* #ifdef DEBUG */
-    /* 	int imax=0; */
-    /* #endif */
-    /* 	pluginsList = PluginsManager_GetPluginsList( context->dictionary ); */
-    /* 	if (pluginsList) { */
-    /* 		plugin = Dictionary_Entry_Value_GetFirstElement(pluginsList); */
-    /* 		while ( plugin ) { */
-    /* 			if ( 0 == strcmp( Dictionary_Entry_Value_AsString( plugin ), */
-    /* 					  "SnacRestart" ) ) { */
-    /* 				restart = 1; */
-    /* 				break; */
-    /* 			} */
-    /* 			plugin = plugin->next; */
-    /* 		} */
-    /* 	} */
-    /* 	if( restart ) */
-    /* 		return; */
+    int				restart = 0;
+    Dictionary_Entry_Value	 	*pluginsList, *plugin;
+#ifdef DEBUG
+    int imax=0;
+#endif
+    pluginsList = PluginsManager_GetPluginsList( context->dictionary );
+    if (pluginsList) {
+	plugin = Dictionary_Entry_Value_GetFirstElement(pluginsList);
+	while ( plugin ) {
+	    if ( 0 == strcmp( Dictionary_Entry_Value_AsString( plugin ),
+			      "SnacRestart" ) ) {
+		restart = 1;
+		break;
+	    }
+	    plugin = plugin->next;
+	}
+    }
+    if( restart ) {
+	fprintf(stderr, "Restarting: thus bailing from hillSlope/InitialConditions.c to avoid overwriting the mesh geometry\n");
+	return;
+    }
 
-
+    
 #ifdef DEBUG
     printf( "In: %s\n", __func__ );
 #endif

Modified: long/3D/SNAC/trunk/Snac/plugins/restarter/InitialConditions.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/restarter/InitialConditions.c	2009-03-08 20:02:11 UTC (rev 14261)
+++ long/3D/SNAC/trunk/Snac/plugins/restarter/InitialConditions.c	2009-03-08 22:38:48 UTC (rev 14262)
@@ -41,13 +41,18 @@
 	#define PATH_MAX 1024
 #endif
 
+#define DEBUG
+
 void _SnacRestart_resetMinLengthScale( void* _context, void* data ) {
 
 	Snac_Context*			context = (Snac_Context*)_context;
 	FILE* fp;
 	char fname[PATH_MAX];
+#ifdef DEBUG
+	fprintf(stderr,"Restarter:  reading min length scale\n");
+#endif
 	sprintf( fname, "%s/snac.minLengthScale.restart", context->outputPath );
-	Journal_Firewall( (fp = fopen( fname, "r" )), "Failed to open %s!!\n", fname );
+	Journal_Firewall( (fp = fopen( fname, "r" )), "Failed to open %s\n", fname );
 	fscanf(fp,"%le",&(context->initMinLengthScale));
 	fclose( fp );
 
@@ -61,23 +66,29 @@
 
 	Journal_Printf( context->snacInfo, "In: %s\n", __func__ );
 
+#ifdef DEBUG
+	fprintf(stderr,"Restarter:  loading mesh coordinates\n");
+#endif
 	sprintf(path, "%s/snac.coord.%d.%06d.restart",context->outputPath,context->rank,context->restartStep);
-	Journal_Firewall( ( (fp=fopen(path,"r")) != NULL), context->snacError, "Can't find %s", path );
+	Journal_Firewall( ( (fp=fopen(path,"r")) != NULL), context->snacError, "Can't find %s - is the parameter \"restartStep\" set correctly in the input xml?\n", path );
 
 	/* read in restart file to construct the initial mesh */
 	for( node_lI = 0; node_lI < context->mesh->nodeLocalCount; node_lI++ ) {
-		Coord*				coord = Snac_NodeCoord_P( context, node_lI );
-		double				x,y,z;
+		Coord*		coord = Snac_NodeCoord_P( context, node_lI );
+		double		x,y,z;
 		fscanf( fp, "%le %le %le", &x,&y,&z);
 
 		(*coord)[0] = x;
 		(*coord)[1] = y;
 		(*coord)[2] = z;
+#ifdef DEBUG
+/* 		fprintf(stderr,"Node %d:  %g, %g, %g\n", node_lI, x,y,z); */
+#endif
 	}
 	fclose( fp );
 }
 
-void _SnacRestart_InitialVelo( void* _context, void* data ) {
+void _SnacRestart_InitialVelocities( void* _context, void* data ) {
 	Snac_Context*			context = (Snac_Context*)_context;
 	FILE*				fp;
 	Node_LocalIndex			node_lI;
@@ -85,8 +96,11 @@
 
 	Journal_Printf( context->snacInfo, "In: %s\n", __func__ );
 
-	sprintf(path, "%s/snac.velo.%d.%06d.restart",context->outputPath,context->rank,context->restartStep);
-	Journal_Firewall( (fp = fopen(path,"r")) != NULL, "Can't find %s", path );
+#ifdef DEBUG
+	fprintf(stderr,"Restarter:  loading mesh velocities\n");
+#endif
+	sprintf(path, "%s/snac.vel.%d.%06d.restart",context->outputPath,context->rank,context->restartStep);
+	Journal_Firewall( (fp = fopen(path,"r")) != NULL, "Can't find %s - is the parameter \"restartStep\" set correctly in the input xml?\n", path );
 
 	/* read in restart file to construct the initial mesh */
 	for( node_lI = 0; node_lI < context->mesh->nodeLocalCount; node_lI++ ) {
@@ -108,9 +122,12 @@
 	char				path[PATH_MAX];
 
 	Journal_Printf( context->snacInfo, "In: %s\n", __func__ );
-	sprintf(path, "%s/snac.strTensor.%d.%06d.restart",context->outputPath,context->rank,context->restartStep);
-	Journal_Firewall( (fp = fopen(path,"r")) != NULL, "Can't find %s", path );
+	sprintf(path, "%s/snac.stressTensor.%d.%06d.restart",context->outputPath,context->rank,context->restartStep);
+	Journal_Firewall( (fp = fopen(path,"r")) != NULL, "Can't find %s - is the parameter \"restartStep\" set correctly in the input xml?\n", path );
 
+#ifdef DEBUG
+	fprintf(stderr,"Restarter:  loading stress tensors\n");
+#endif
 	/* read in restart file to assign initial stress field. */
 	for( element_lI = 0; element_lI < context->mesh->elementLocalCount; element_lI++ ) {
 		Snac_Element*			element = Snac_Element_At( context, element_lI );

Modified: long/3D/SNAC/trunk/Snac/plugins/restarter/InitialConditions.h
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/restarter/InitialConditions.h	2009-03-08 20:02:11 UTC (rev 14261)
+++ long/3D/SNAC/trunk/Snac/plugins/restarter/InitialConditions.h	2009-03-08 22:38:48 UTC (rev 14262)
@@ -48,7 +48,7 @@
 
 	void _SnacRestart_resetMinLengthScale( void* _context, void* data );
 	void _SnacRestart_InitialCoords( void* _context, void* data );
-	void _SnacRestart_InitialVelo( void* _context, void* data );
+	void _SnacRestart_InitialVelocities( void* _context, void* data );
 	void _SnacRestart_InitialStress( void* _context, void* data );
 
 #endif /* __SnacRestart_InitialConditions_h__ */

Modified: long/3D/SNAC/trunk/Snac/plugins/restarter/Register.c
===================================================================
--- long/3D/SNAC/trunk/Snac/plugins/restarter/Register.c	2009-03-08 20:02:11 UTC (rev 14261)
+++ long/3D/SNAC/trunk/Snac/plugins/restarter/Register.c	2009-03-08 22:38:48 UTC (rev 14262)
@@ -41,6 +41,8 @@
 	#define PATH_MAX 1024
 #endif
 
+#define DEBUG
+
 /* Textual name of this class */
 const Type SnacRestart_Type = "SnacRestart";
 
@@ -77,13 +79,16 @@
 	/* Retrieve context. */
 	context = (Snac_Context*)Stg_ComponentFactory_ConstructByName( cf, "context", Snac_Context, True, data ); 
 
-	#ifdef DEBUG
-		printf( "In: _SnacRestart_Register( void* )\n" );
-	#endif
+#ifdef DEBUG
+	printf( "In: _SnacRestart_Register( void* )\n" );
+#endif
 
 	if( context->rank == 0 ) {
 		sprintf( fname, "%s/coord.%d", context->outputPath, context->rank );
-		Journal_Firewall( ( ( fp = fopen( fname, "r") ) == NULL ), context->snacError, "\n\n ###### RESTARTER ERROR ######\n Do NOT restart in %s!!\n All the existing outputs will be overwritten !!\n If absolutely sure, remove the existing outputs first.\n #############################\n\n", context->outputPath );
+		Journal_Firewall( ( ( fp = fopen( fname, "r") ) == NULL ), 
+				  context->snacError, 
+				  "\n\n ###### RESTARTER ERROR ######\n Do NOT restart in %s!!\n All the existing outputs will be overwritten !!\n If absolutely sure, remove the existing outputs first.\n #############################\n\n", 
+				  context->outputPath );
 	}
 
 	EntryPoint_InsertBefore(
@@ -102,7 +107,7 @@
 		Context_GetEntryPoint( context, AbstractContext_EP_Initialise ),
 		"SnacTimeStepZero",
 		SnacRestart_Type,
-		_SnacRestart_InitialVelo,
+		_SnacRestart_InitialVelocities,
 		SnacRestart_Type );
 	EntryPoint_InsertBefore(
 		Context_GetEntryPoint( context, AbstractContext_EP_Initialise ),
@@ -110,4 +115,9 @@
 		SnacRestart_Type,
 		_SnacRestart_InitialStress,
 		SnacRestart_Type );
+
+/* 	_SnacRestart_resetMinLengthScale(context,data); */
+/* 	_SnacRestart_InitialCoords(context,data); */
+/* 	_SnacRestart_InitialVelocities(context,data); */
+/* 	_SnacRestart_InitialStress(context,data); */
 }

Modified: long/3D/SNAC/trunk/Snac/snac2restart/snac2restart.c
===================================================================
--- long/3D/SNAC/trunk/Snac/snac2restart/snac2restart.c	2009-03-08 20:02:11 UTC (rev 14261)
+++ long/3D/SNAC/trunk/Snac/snac2restart/snac2restart.c	2009-03-08 22:38:48 UTC (rev 14262)
@@ -50,15 +50,16 @@
 
 void ConvertTimeStep( int rank, unsigned int dumpIteration, unsigned int simTimeStep, double time );
 
-char		path[PATH_MAX];
-FILE*		strTensorIn;
+char		readPath[PATH_MAX];
+char		writePath[PATH_MAX];
+FILE*		stressTensorIn;
 FILE*		coordIn;
 FILE*		velIn;
 FILE*		tempIn;
 FILE*		apsIn;
-FILE*		tetApsIn;
+/* FILE*		tetApsIn; */
 FILE*		minLengthIn;
-FILE*		isoForceIn;
+FILE*		forceIn;
 
 unsigned int	elementLocalSize[3];
 unsigned int 	doTemp = 1;
@@ -66,328 +67,355 @@
 unsigned int 	restartStep = -1;
 
 
-void checkArgumentType( int argNum, char* arglist[] )
-{
-	if( argNum == 1 ) {
-		sprintf( path, "./" );
-		fprintf(stderr,"\nWill try to create restart files for the last time step in %s.\n",path);
+void checkArgumentType( int argNum, char* arglist[] ) {
+    if( argNum == 1 ) {
+	sprintf( readPath, "." );
+	sprintf( writePath, "." );
+	fprintf(stderr,"Reading Snac state files for the last time step from %s/\n",readPath);
+	fprintf(stderr,"Writing Snac restart files to %s/\n",writePath);
+	return;
+    }
+    else if( argNum == 2 ) {
+	if( atoi(arglist[1]) ) {
+	    restartStep = atoi(arglist[1]);
+	    sprintf( readPath, "." );
+	    sprintf( writePath, "." );
+	    fprintf(stderr,"Reading Snac state files for time step ts=%d from %s/\n",restartStep,readPath);
+	    fprintf(stderr,"Writing Snac restart files to %s/\n",writePath);
+	    return;
+	}
+	else {
+	    char zeroChar[PATH_MAX];
+	    sprintf(zeroChar,"0");
+	    if( !strcmp( arglist[1], zeroChar) ) {
+		fprintf(stderr,"\nDon't try to restart from 0th time step. Just rerun the case!!\n\n");
+		exit(0);
+	    }
+	    else {
+		sprintf( readPath, "%s", arglist[1]);
+		sprintf( writePath, "." );
+		fprintf(stderr,"Reading Snac state files for the last time step from %s/\n",readPath);
+		fprintf(stderr,"Writing Snac restart files to %s/\n",writePath);
 		return;
+	    }
 	}
-	else if( argNum == 2 ) {
-		if( atoi(arglist[1]) ) {
-			restartStep = atoi(arglist[1]);
-			sprintf( path, "./" );
-			fprintf(stderr,"\nWill try to create restart files for time step %d in %s.\n",restartStep,path);
-			return;
-		}
-		else {
-			char zeroChar[PATH_MAX];
-			sprintf(zeroChar,"0");
-			if( !strcmp( arglist[1], zeroChar) ) {
-				fprintf(stderr,"\nDon't try to restart from 0th time step. Just rerun the case!!\n\n");
-				exit(0);
-			}
-			else {
-				sprintf( path, "%s", arglist[1]);
-				fprintf(stderr,"\nWill try to create restart files for the last time step in %s.\n",path);
-				return;
-			}
-		}
+    }
+    else if( argNum == 3 ) {
+	if( atoi(arglist[1])  && !atoi(arglist[2]) ) {
+	    restartStep = atoi(arglist[1]);
+	    sprintf( readPath, "%s", arglist[2]);
+	    fprintf(stderr,"Reading Snac state files for time step ts=%d from %s/\n",restartStep,readPath);
+	    fprintf(stderr,"Writing Snac restart files to %s/\n",writePath);
+	    return;
 	}
-	else if( argNum == 3 ) {
-		if( atoi(arglist[1])  && !atoi(arglist[2]) ) {
-			restartStep = atoi(arglist[1]);
-			sprintf( path, "%s", arglist[2]);
-			fprintf(stderr,"\nWill try to create restart files for time step %d in %s.\n",restartStep,path);
-			return;
-		}
-		else {
-			fprintf(stderr,"Wrong argument type!!\n\tUSAGE: %s [integer timeStep] [path to output directory]\n",arglist[0]);
-			exit(0);
-		}
+	else {
+	    fprintf(stderr,"Wrong argument type\n\tUsage: %s [integer timeStep] [input file path]\n",arglist[0]);
+	    exit(0);
 	}
-	else if( argNum > 3 ) {
-		fprintf(stderr,"Wrong number of arguments!!\n\tUSAGE: %s [timeStep] [output directory]\n",arglist[0]);
-		exit(0);
-	}
+    }
+    else if( argNum > 3 ) {
+	fprintf(stderr,"Wrong number of arguments\n\tUsage: %s [timeStep] [input file path]\n",arglist[0]);
+	exit(0);
+    }
 }
 
 int main( int argc, char* argv[] ) {
-	char		tmpBuf[PATH_MAX];
-	FILE*		simIn;
-	FILE*		timeStepIn;
-	unsigned int	rank;
-	unsigned int	simTimeStep;
-	unsigned int	dumpIteration;
-	double		time;
-	double		dt;
+    char		tmpBuf[PATH_MAX];
+    FILE*		simIn;
+    FILE*		timeStepIn;
+    unsigned int	rank;
+    unsigned int	simTimeStep;
+    unsigned int	dumpIteration;
+    double		time;
+    double		dt;
 
-	/* safety check and assign restartStep and path */
-	checkArgumentType( argc, argv );
+    /* safety check and assign restartStep and path */
+    checkArgumentType( argc, argv );
 
-	rank = 0;
-	while( 1 ) {
-		/* open the input files */
-		sprintf( tmpBuf, "%s/sim.%u", path, rank );
-		fprintf(stderr,"%s\n",tmpBuf);
-		if( (simIn = fopen( tmpBuf, "r" )) == NULL ) {
-			if( rank == 0 ) {
-				assert( simIn /* failed to open file for reading */ );
-			}
-			else {
-				break;
-			}
-		}
-		sprintf( tmpBuf, "%s/timeStep.%u", path, rank );
-		if( (timeStepIn = fopen( tmpBuf, "r" )) == NULL ) {
-			assert( timeStepIn /* failed to open file for reading */ );
-		}
-		sprintf( tmpBuf, "%s/stressTensor.%u", path, rank );
-		fprintf(stderr,"filename=%s\n",tmpBuf);
-		if( (strTensorIn = fopen( tmpBuf, "r" )) == NULL ) {
-			assert( strTensorIn /* failed to open file for reading */ );
-		}
-		sprintf( tmpBuf, "%s/coord.%u", path, rank );
-		if( (coordIn = fopen( tmpBuf, "r" )) == NULL ) {
-			assert( coordIn /* failed to open file for reading */ );
-		}
-		sprintf( tmpBuf, "%s/vel.%u", path, rank );
-		if( (velIn = fopen( tmpBuf, "r" )) == NULL ) {
-			assert( velIn /* failed to open file for reading */ );
-		}
-		sprintf( tmpBuf, "%s/minLengthScale.0", path );
-		if( (minLengthIn = fopen( tmpBuf, "r" )) == NULL ) {
-			assert( minLengthIn /* failed to open file for reading */ );
-		}
-		sprintf( tmpBuf, "%s/isoForce.%u", path, rank );
-		if( (isoForceIn = fopen( tmpBuf, "r" )) == NULL ) {
-			assert( isoForceIn /* failed to open file for reading */ );
-		}
-		sprintf( tmpBuf, "%s/temperature.%u", path, rank );
-		if( (tempIn = fopen( tmpBuf, "r" )) == NULL ) {
-			printf( "Warning, no temperature.%u found... assuming temperature plugin not used.\n", rank );
-			doTemp = 0;
-		}
-		sprintf( tmpBuf, "%s/plStrainTensor.%u", path, rank );
-		if( (tetApsIn = fopen( tmpBuf, "r" )) == NULL ) {
-			printf( "Warning, no plstrain.%u found... assuming plastic plugin not used.\n", rank );
-			doAps = 0;
-		}
-		sprintf( tmpBuf, "%s/plStrain.%u", path, rank );
-		if( (apsIn = fopen( tmpBuf, "r" )) == NULL ) {
-			printf( "Warning, no plstrain.%u found... assuming plastic plugin not used.\n", rank );
-			doAps = 0;
-		}
+    fprintf(stderr, "Parsing Snac output files\n");
+    rank = 0;
+    while( 1 ) {
+	fprintf(stderr, "Rank r=%d\n",rank);
+	/* open the input files */
+	sprintf( tmpBuf, "%s/sim.%u", readPath, rank );
+ 	fprintf(stderr,"Attempting to read from %s ...",tmpBuf); 
+	if( (simIn = fopen( tmpBuf, "r" )) == NULL ) {
+	    if( rank == 0 ) {
+		assert( simIn /* failed to open file for reading */ );
+	    }
+	    else {
+		fprintf(stderr," no such file\n"); 
+		break;
+	    }
+	} else {
+		fprintf(stderr," with success\n"); 
+	}
+	sprintf( tmpBuf, "%s/timeStep.%u", readPath, rank );
+ 	fprintf(stderr,"Reading from %s\n",tmpBuf); 
+	if( (timeStepIn = fopen( tmpBuf, "r" )) == NULL ) {
+	    assert( timeStepIn /* failed to open file for reading */ );
+	}
+	sprintf( tmpBuf, "%s/stressTensor.%u", readPath, rank );
+ 	fprintf(stderr,"Reading from %s\n",tmpBuf); 
+	if( (stressTensorIn = fopen( tmpBuf, "r" )) == NULL ) {
+	    assert( stressTensorIn /* failed to open file for reading */ );
+	}
+	sprintf( tmpBuf, "%s/coord.%u", readPath, rank );
+ 	fprintf(stderr,"Reading from %s\n",tmpBuf); 
+	if( (coordIn = fopen( tmpBuf, "r" )) == NULL ) {
+	    assert( coordIn /* failed to open file for reading */ );
+	}
+	sprintf( tmpBuf, "%s/vel.%u", readPath, rank );
+ 	fprintf(stderr,"Reading from %s\n",tmpBuf); 
+	if( (velIn = fopen( tmpBuf, "r" )) == NULL ) {
+	    assert( velIn /* failed to open file for reading */ );
+	}
+	sprintf( tmpBuf, "%s/minLengthScale.0", readPath );
+ 	fprintf(stderr,"Reading from %s\n",tmpBuf); 
+	if( (minLengthIn = fopen( tmpBuf, "r" )) == NULL ) {
+	    assert( minLengthIn /* failed to open file for reading */ );
+	}
+	sprintf( tmpBuf, "%s/force.%u", readPath, rank );
+ 	fprintf(stderr,"Reading from %s\n",tmpBuf); 
+	if( (forceIn = fopen( tmpBuf, "r" )) == NULL ) {
+	    assert( forceIn /* failed to open file for reading */ );
+	}
+	sprintf( tmpBuf, "%s/temperature.%u", readPath, rank );
+ 	fprintf(stderr,"Reading from %s\n",tmpBuf); 
+	if( (tempIn = fopen( tmpBuf, "r" )) == NULL ) {
+	    fprintf( stderr,"Warning, no temperature.%u found... assuming temperature plugin not used.\n", rank );
+	    doTemp = 0;
+	}
+/* 	sprintf( tmpBuf, "%s/plStrainTensor.%u", readPath, rank ); */
+/*  	fprintf(stderr,"Reading from %s\n",tmpBuf);  */
+/* 	if( (tetApsIn = fopen( tmpBuf, "r" )) == NULL ) { */
+/* 	    fprintf( stderr,"Warning, no plstrain.%u found... assuming plastic plugin not used.\n", rank ); */
+/* 	    doAps = 0; */
+/* 	} */
+	sprintf( tmpBuf, "%s/plStrain.%u", readPath, rank );
+ 	fprintf(stderr,"Reading from %s\n",tmpBuf); 
+	if( (apsIn = fopen( tmpBuf, "r" )) == NULL ) {
+	    fprintf( stderr,"Warning, no plstrain.%u found... assuming plastic plugin not used.\n", rank );
+	    doAps = 0;
+	}
 
 
-		/* Read in simulation information... TODO: assumes nproc=1 */
-		fscanf( simIn, "%u %u %u\n", &elementLocalSize[0], &elementLocalSize[1], &elementLocalSize[2] );
+	/* Read in simulation information... TODO: assumes nproc=1 */
+	fscanf( simIn, "%u %u %u\n", &elementLocalSize[0], &elementLocalSize[1], &elementLocalSize[2] );
 
-		/* Read in loop information */
-		dumpIteration = 0;
-		while( !feof( timeStepIn ) ) {
-			fscanf( timeStepIn, "%16u %16lg %16lg\n", &simTimeStep, &time, &dt );
-			/* do conversion */
-			if( simTimeStep == restartStep || feof( timeStepIn ) ) {
-				ConvertTimeStep( rank, dumpIteration, simTimeStep, time );
-				break;
-			}
-			dumpIteration++;
+	/* Read in loop information */
+	dumpIteration = 0;
+	while( !feof( timeStepIn ) ) {
+	    fscanf( timeStepIn, "%16u %16lg %16lg\n", &simTimeStep, &time, &dt );
+	    /* do conversion */
+	    if( simTimeStep == restartStep || feof( timeStepIn ) ) {
+		fprintf( stderr,"Converting dump=%d, r=%d, ts=%d, t=%g ...\n",
+			 dumpIteration, rank, simTimeStep, time);
+		ConvertTimeStep( rank, dumpIteration, simTimeStep, time );
+		fprintf( stderr,"... done converting\n");
+		break;
+	    }
+	    dumpIteration++;
+	}
 
-		}
+	/* Close the input files */
+	if( apsIn ) {
+	    fclose( apsIn );
+/* 	    fclose( tetApsIn ); */
+	}
+	if( tempIn ) {
+	    fclose( tempIn );
+	}
+	fclose( velIn );
+	fclose( coordIn );
+	fclose( stressTensorIn );
+	fclose( timeStepIn );
+	fclose( simIn );
+	fclose( minLengthIn );
+	fclose( forceIn );
 
-		/* Close the input files */
-		if( apsIn ) {
-			fclose( apsIn );
-			fclose( tetApsIn );
-		}
-		if( tempIn ) {
-			fclose( tempIn );
-		}
-		fclose( velIn );
-		fclose( coordIn );
-		fclose( strTensorIn );
-		fclose( timeStepIn );
-		fclose( simIn );
-		fclose( minLengthIn );
-		fclose( isoForceIn );
+	/* do next rank */
+	rank++;
+    }
+    fprintf(stderr, "Done\n");
 
-		/* do next rank */
-		rank++;
-	}
-	fprintf(stderr, "Done!!\n");
-
-	return 0;
+    return 0;
 }
 
 
 void ConvertTimeStep( int rank, unsigned int dumpIteration, unsigned int simTimeStep, double time ) {
-	char		tmpBuf[PATH_MAX];
-	FILE*		restartOut;
-	unsigned int	elementLocalCount = elementLocalSize[0] * elementLocalSize[1] * elementLocalSize[2];
-	unsigned int	nodeLocalSize[3] = { elementLocalSize[0] + 1, elementLocalSize[1] + 1, elementLocalSize[2] + 1 };
-	unsigned int	nodeLocalCount = nodeLocalSize[0] * nodeLocalSize[1] * nodeLocalSize[2];
-	unsigned int	node_gI;
-	unsigned int	element_gI;
-	unsigned int	tetra_I;
-	float		minLength;
+    char		tmpBuf[PATH_MAX];
+    FILE*		restartOut;
+    unsigned int	elementLocalCount = elementLocalSize[0] * elementLocalSize[1] * elementLocalSize[2];
+    unsigned int	nodeLocalSize[3] = { elementLocalSize[0] + 1, elementLocalSize[1] + 1, elementLocalSize[2] + 1 };
+    unsigned int	nodeLocalCount = nodeLocalSize[0] * nodeLocalSize[1] * nodeLocalSize[2];
+    unsigned int	node_gI;
+    unsigned int	element_gI;
+    unsigned int	tetra_I;
+    float		minLength;
 
 
-	/* Write out position array */
-	sprintf( tmpBuf, "%s/snac.coord.%i.%06u.restart", path, rank, simTimeStep );
-	if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
-		assert( restartOut /* failed to open file for writing */ );
-	}
+    /* Write out position array */
+    sprintf( tmpBuf, "%s/snac.coord.%i.%06u.restart", writePath, rank, simTimeStep );
+    if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
+	assert( restartOut /* failed to open file for writing */ );
+    }
 
-	fseek( coordIn, dumpIteration * nodeLocalCount * sizeof(float) * 3, SEEK_SET );
-	for( node_gI = 0; node_gI < nodeLocalCount; node_gI++ ) {
-		float		coord[3];
-		fread( &coord, sizeof(float), 3, coordIn );
-		fprintf( restartOut, "%.9e %.9e %.9e\n", coord[0], coord[1], coord[2] );
-	}
-	if( restartOut )
-		fclose( restartOut );
+    fseek( coordIn, dumpIteration * nodeLocalCount * sizeof(float) * 3, SEEK_SET );
+    for( node_gI = 0; node_gI < nodeLocalCount; node_gI++ ) {
+	float		coord[3];
+	fread( &coord, sizeof(float), 3, coordIn );
+	fprintf( restartOut, "%.9e %.9e %.9e\n", coord[0], coord[1], coord[2] );
+    }
+    if( restartOut )
+	fclose( restartOut );
 
-	/* Write out initial position array in case of restarting. */
-	sprintf( tmpBuf, "%s/snac.initcoord.%i.%06u.restart", path, rank, simTimeStep );
-	if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
-		assert( restartOut /* failed to open file for writing */ );
-	}
+    /* Write out initial position array in case of restarting. */
+    sprintf( tmpBuf, "%s/snac.initCoord.%i.%06u.restart", writePath, rank, simTimeStep );
+    if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
+	assert( restartOut /* failed to open file for writing */ );
+    }
 
-	fseek( coordIn, 0 * nodeLocalCount * sizeof(float) * 3, SEEK_SET );
-	for( node_gI = 0; node_gI < nodeLocalCount; node_gI++ ) {
-		float		coord[3];
-		fread( &coord, sizeof(float), 3, coordIn );
-		fprintf( restartOut, "%.9e %.9e %.9e\n", coord[0], coord[1], coord[2] );
-	}
-	if( restartOut )
-		fclose( restartOut );
+    fseek( coordIn, 0 * nodeLocalCount * sizeof(float) * 3, SEEK_SET );
+    for( node_gI = 0; node_gI < nodeLocalCount; node_gI++ ) {
+	float		coord[3];
+	fread( &coord, sizeof(float), 3, coordIn );
+	fprintf( restartOut, "%.9e %.9e %.9e\n", coord[0], coord[1], coord[2] );
+    }
+    if( restartOut )
+	fclose( restartOut );
 
-	/* Write out velocity array */
-	sprintf( tmpBuf, "%s/snac.velo.%i.%06u.restart", path, rank, simTimeStep );
-	if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
-		assert( restartOut /* failed to open file for writing */ );
-	}
+    /* Write out velocity array */
+    sprintf( tmpBuf, "%s/snac.vel.%i.%06u.restart", writePath, rank, simTimeStep );
+    if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
+	assert( restartOut /* failed to open file for writing */ );
+    }
 
-	fseek( velIn, dumpIteration * nodeLocalCount * sizeof(float) * 3, SEEK_SET );
-	for( node_gI = 0; node_gI < nodeLocalCount; node_gI++ ) {
-		float		vel[3];
-		fread( &vel, sizeof(float), 3, velIn );
-		fprintf( restartOut, "%.9e %.9e %.9e\n", vel[0], vel[1], vel[2] );
+    fseek( velIn, dumpIteration * nodeLocalCount * sizeof(float) * 3, SEEK_SET );
+    for( node_gI = 0; node_gI < nodeLocalCount; node_gI++ ) {
+	float		vel[3];
+	fread( &vel, sizeof(float), 3, velIn );
+	fprintf( restartOut, "%.9e %.9e %.9e\n", vel[0], vel[1], vel[2] );
+    }
+    if( restartOut )
+	fclose( restartOut );
+
+    /* Write out isostatic force array */
+    sprintf( tmpBuf, "%s/snac.force.%i.%06u.restart", writePath, rank, simTimeStep );
+    if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
+	assert( restartOut /* failed to open file for writing */ );
+    }
+
+    for( node_gI = 0; node_gI < nodeLocalCount; node_gI++ ) {
+	float		force;
+	fread( &force, sizeof(float), 1, forceIn );
+	fprintf( restartOut, "%.9e\n", force );
+    }
+    if( restartOut )
+	fclose( restartOut );
+
+
+    /* Write out stress tensor array */
+    sprintf( tmpBuf, "%s/snac.stressTensor.%i.%06u.restart", writePath, rank, simTimeStep );
+    fprintf(stderr,"\tWriting out %s\n",tmpBuf);
+    if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
+	assert( restartOut /* failed to open file for writing */ );
+    }
+
+    fseek( stressTensorIn, dumpIteration * elementLocalCount * sizeof(float) * 9 * Tetrahedra_Count, SEEK_SET );
+    for( element_gI = 0; element_gI < elementLocalCount; element_gI++ ) {
+	for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
+	    float tensor[3][3];
+	    fread( &tensor, sizeof(float), 9, stressTensorIn );
+	    fprintf( restartOut, "%.9e %.9e %.9e %.9e %.9e %.9e %.9e %.9e %.9e\n", 
+		     tensor[0][0], tensor[0][1], tensor[0][2], 
+		     tensor[1][0], tensor[1][1], tensor[1][2], 
+		     tensor[2][0], tensor[2][1], tensor[2][2] );
+	    fflush( restartOut );
 	}
-	if( restartOut )
-		fclose( restartOut );
+    }
+    if( restartOut )
+	fclose( restartOut );
 
-	/* Write out isostatic force array */
-	sprintf( tmpBuf, "%s/snac.isoForce.%i.restart", path, rank );
+    /* Write out temperature array */
+    if(doTemp) {
+	sprintf( tmpBuf, "%s/snac.temp.%i.%06u.restart", writePath, rank, simTimeStep );
+	fprintf(stderr,"\tWriting out %s\n",tmpBuf);
 	if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
-		assert( restartOut /* failed to open file for writing */ );
+	    assert( restartOut /* failed to open file for writing */ );
 	}
 
+	fseek( tempIn, dumpIteration * nodeLocalCount * sizeof(float), SEEK_SET );
 	for( node_gI = 0; node_gI < nodeLocalCount; node_gI++ ) {
-		float		force;
-		fread( &force, sizeof(float), 1, isoForceIn );
-		fprintf( restartOut, "%.9e\n", force );
+	    float		temperature;
+	    fread( &temperature, sizeof(float), 1, tempIn );
+	    fprintf( restartOut, "%.9e\n", temperature );
 	}
 	if( restartOut )
-		fclose( restartOut );
+	    fclose( restartOut );
+    }
 
+    /* Write out plstrain array */
+    if(doAps) {
+	/* 		sprintf( tmpBuf, "%s/snac.plStrainTensor.%i.%06u.restart", writePath, rank, simTimeStep ); */
+	/* 		if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) { */
+	/* 			assert( restartOut ); */
+	/* 		} */
+	/* for Drucker-Prager */
+	/* 		fseek( tetApsIn, dumpIteration * elementLocalCount * sizeof(float) * 9 * Tetrahedra_Count, SEEK_SET ); */
+	/* 		for( element_gI = 0; element_gI < elementLocalCount; element_gI++ ) { */
+	/* 			for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) { */
+	/* 				int i,j; */
+	/* 				float tensor[3][3]; */
+	/* 				for(i=0;i<3;i++) */
+	/* 					for(j=0;j<3;j++) */
+	/* 						fread( &tensor[i][j], sizeof(float), 1, tetApsIn ); */
+	/* 				fprintf( restartOut, "%.9e %.9e %.9e %.9e %.9e %.9e %.9e %.9e %.9e\n", tensor[0][0], tensor[0][1], tensor[0][2], tensor[1][0], tensor[1][1], tensor[1][2], tensor[2][0], tensor[2][1], tensor[2][2] ); */
+	/* 				fflush( restartOut ); */
+	/* 			} */
+	/* for Mohr-Coulomb */
+	/* 		fseek( tetApsIn, dumpIteration * elementLocalCount * sizeof(float) * Tetrahedra_Count, SEEK_SET ); */
+	/* 		for( element_gI = 0; element_gI < elementLocalCount; element_gI++ ) { */
+	/* 			for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) { */
+	/* 				float tetraStrain; */
+	/* 				fread( &tetraStrain, sizeof(float), 1, tetApsIn ); */
+	/* 				fprintf( restartOut, "%.9e\n", tetraStrain ); */
+	/* 				fflush( restartOut ); */
+	/* 			} */
+	/* 		} */
+	/* 		if( restartOut ) */
+	/* 			fclose( restartOut ); */
 
-	/* Write out stress tensor array */
-	sprintf( tmpBuf, "%s/snac.strTensor.%i.%06u.restart", path, rank, simTimeStep );
-	fprintf(stderr,"filename=%s\n",tmpBuf);
+
+	sprintf( tmpBuf, "%s/snac.plStrain.%i.%06u.restart", writePath, rank, simTimeStep );
+	fprintf(stderr,"\tWriting out %s\n",tmpBuf);
 	if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
-		assert( restartOut /* failed to open file for writing */ );
+	    assert( restartOut /* failed to open file for writing */ );
 	}
 
-	fseek( strTensorIn, dumpIteration * elementLocalCount * sizeof(float) * 9 * Tetrahedra_Count, SEEK_SET );
+	fseek( apsIn, dumpIteration * elementLocalCount * sizeof(float), SEEK_SET );
 	for( element_gI = 0; element_gI < elementLocalCount; element_gI++ ) {
-		for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
-			float tensor[3][3];
-			fread( &tensor, sizeof(float), 9, strTensorIn );
-			fprintf( restartOut, "%.9e %.9e %.9e %.9e %.9e %.9e %.9e %.9e %.9e\n", tensor[0][0], tensor[0][1], tensor[0][2], tensor[1][0], tensor[1][1], tensor[1][2], tensor[2][0], tensor[2][1], tensor[2][2] );
-			fflush( restartOut );
-		}
+	    float		plstrain;
+
+	    fread( &plstrain, sizeof(float), 1, apsIn );
+	    fprintf( restartOut, "%.9e\n", plstrain );
 	}
 	if( restartOut )
-		fclose( restartOut );
-
-	/* Write out temperature array */
-	if(doTemp) {
-		sprintf( tmpBuf, "%s/snac.temp.%i.%06u.restart", path, rank, simTimeStep );
-		if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
-			assert( restartOut /* failed to open file for writing */ );
-		}
-
-		fseek( tempIn, dumpIteration * nodeLocalCount * sizeof(float), SEEK_SET );
-		for( node_gI = 0; node_gI < nodeLocalCount; node_gI++ ) {
-		        float		temperature;
-			fread( &temperature, sizeof(float), 1, tempIn );
-			fprintf( restartOut, "%.9e\n", temperature );
-		}
-		if( restartOut )
-			fclose( restartOut );
+	    fclose( restartOut );
+    }
+    /* mininum length scale */
+    if( rank == 0 ) {
+	sprintf( tmpBuf, "%s/snac.minLengthScale.restart", writePath );
+	fprintf(stderr,"\tWriting out %s\n",tmpBuf);
+	if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
+	    assert( restartOut /* failed to open file for writing */ );
 	}
+	fscanf( minLengthIn, "%e", &minLength );
+	fprintf( restartOut, "%e\n", minLength );
 
-	/* Write out plstrain array */
-	if(doAps) {
-		sprintf( tmpBuf, "%s/snac.plStrainTensor.%i.%06u.restart", path, rank, simTimeStep );
-		if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
-			assert( restartOut /* failed to open file for writing */ );
-		}
-			/* for Drucker-Prager */
-/* 		fseek( tetApsIn, dumpIteration * elementLocalCount * sizeof(float) * 9 * Tetrahedra_Count, SEEK_SET ); */
-/* 		for( element_gI = 0; element_gI < elementLocalCount; element_gI++ ) { */
-/* 			for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) { */
-/* 				int i,j; */
-/* 				float tensor[3][3]; */
-/* 				for(i=0;i<3;i++) */
-/* 					for(j=0;j<3;j++) */
-/* 						fread( &tensor[i][j], sizeof(float), 1, tetApsIn ); */
-/* 				fprintf( restartOut, "%.9e %.9e %.9e %.9e %.9e %.9e %.9e %.9e %.9e\n", tensor[0][0], tensor[0][1], tensor[0][2], tensor[1][0], tensor[1][1], tensor[1][2], tensor[2][0], tensor[2][1], tensor[2][2] ); */
-/* 				fflush( restartOut ); */
-/* 			} */
-			/* for Mohr-Coulomb */
-		fseek( tetApsIn, dumpIteration * elementLocalCount * sizeof(float) * Tetrahedra_Count, SEEK_SET );
-		for( element_gI = 0; element_gI < elementLocalCount; element_gI++ ) {
-			for( tetra_I = 0; tetra_I < Tetrahedra_Count; tetra_I++ ) {
-				float tetraStrain;
-				fread( &tetraStrain, sizeof(float), 1, tetApsIn );
-				fprintf( restartOut, "%.9e\n", tetraStrain );
-				fflush( restartOut );
-			}
-		}
-		if( restartOut )
-			fclose( restartOut );
+	if( restartOut )
+	    fclose( restartOut );
+    }
 
-
-		sprintf( tmpBuf, "%s/snac.plStrain.%i.%06u.restart", path, rank, simTimeStep );
-		if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
-			assert( restartOut /* failed to open file for writing */ );
-		}
-
-		fseek( apsIn, dumpIteration * elementLocalCount * sizeof(float), SEEK_SET );
-		for( element_gI = 0; element_gI < elementLocalCount; element_gI++ ) {
-		        float		plstrain;
-
-			fread( &plstrain, sizeof(float), 1, apsIn );
-			fprintf( restartOut, "%.9e\n", plstrain );
-		}
-		if( restartOut )
-			fclose( restartOut );
-	}
-	/* mininum length scale */
-	if( rank == 0 ) {
-		sprintf( tmpBuf, "%s/snac.minLengthScale.restart", path );
-		if( (restartOut = fopen( tmpBuf, "w" )) == NULL ) {
-			assert( restartOut /* failed to open file for writing */ );
-		}
-		fscanf( minLengthIn, "%e", &minLength );
-		fprintf( restartOut, "%e\n", minLength );
-
-		if( restartOut )
-			fclose( restartOut );
-	}
-
-	return;
+    return;
 }

Modified: long/3D/SNAC/trunk/Snac/snac2vtk/snac2vtk.c
===================================================================
--- long/3D/SNAC/trunk/Snac/snac2vtk/snac2vtk.c	2009-03-08 20:02:11 UTC (rev 14261)
+++ long/3D/SNAC/trunk/Snac/snac2vtk/snac2vtk.c	2009-03-08 22:38:48 UTC (rev 14262)
@@ -616,7 +616,7 @@
 
 
     /* Write out the phase information */
-    fprintf( vtkOut, "        <DataArray type=\"Float32\" Name=\"phase\" format=\"ascii\">\n");
+    fprintf( vtkOut, "        <DataArray type=\"Float32\" Name=\"Phase\" format=\"ascii\">\n");
     fseek( phaseIn, dumpIteration * elementLocalCount * sizeof(unsigned int), SEEK_SET );
     for( element_gI = 0; element_gI < elementLocalCount; element_gI++ ) {
 	unsigned int		phaseIndex;
@@ -639,7 +639,7 @@
 
     /* Write out the viscosity information */
     if( doVisc ) {
-	fprintf( vtkOut, "        <DataArray type=\"Float32\" Name=\"viscosity\" format=\"ascii\">\n");
+	fprintf( vtkOut, "        <DataArray type=\"Float32\" Name=\"Viscosity\" format=\"ascii\">\n");
 	fseek( viscIn, dumpIteration * elementLocalCount * sizeof(float), SEEK_SET );
 	for( element_gI = 0; element_gI < elementLocalCount; element_gI++ ) {
 	    float		viscosity;
@@ -684,11 +684,11 @@
 
 	/* Start the node section */
 	fprintf( vtkOut1, "    <PPointData>\n");
-	fprintf( vtkOut1, "        <PDataArray type=\"Float32\" Name=\"velocity\" NumberOfComponents=\"3\"/>\n");
+	fprintf( vtkOut1, "        <PDataArray type=\"Float32\" Name=\"Velocity\" NumberOfComponents=\"3\"/>\n");
 	if( doForce )
-	    fprintf( vtkOut1, "        <PDataArray type=\"Float32\" Name=\"force\" NumberOfComponents=\"3\"/>\n");
+	    fprintf( vtkOut1, "        <PDataArray type=\"Float32\" Name=\"Force\" NumberOfComponents=\"3\"/>\n");
 	if( doTemp )
-	    fprintf( vtkOut1, "        <PDataArray type=\"Float32\" Name=\"temperature\"/>\n");
+	    fprintf( vtkOut1, "        <PDataArray type=\"Float32\" Name=\"Temperature\"/>\n");
 	fprintf( vtkOut1, "    </PPointData>\n");
 
 	/* Start the element section */
@@ -710,9 +710,9 @@
 	/*
 	 * ... end CPS mods
 	 */
-	fprintf( vtkOut1, "        <PDataArray type=\"Float32\" Name=\"phase\"/>\n");
+	fprintf( vtkOut1, "        <PDataArray type=\"Float32\" Name=\"Phase\"/>\n");
 	if( doVisc )
-	    fprintf( vtkOut1, "        <PDataArray type=\"Float32\" Name=\"viscosity\"/>\n");
+	    fprintf( vtkOut1, "        <PDataArray type=\"Float32\" Name=\"Viscosity\"/>\n");
 	fprintf( vtkOut1, "    </PCellData>\n");
 	
 	/* Write out coordinates. */



More information about the CIG-COMMITS mailing list