[cig-commits] commit: Make it compile with C++ and C compilers

Mercurial hg at geodynamics.org
Wed May 11 14:50:32 PDT 2011


changeset:   781:8917eb4bcedf
user:        Walter Landry <wlandry at caltech.edu>
date:        Wed May 11 13:27:34 2011 -0700
files:       Assembly/src/PressureGradMatrixTerm.c Discretisation/src/AnalyticSolution.c Discretisation/src/AnalyticSolution.h Discretisation/src/BilinearElementType.c Discretisation/src/BilinearInnerElType.c Discretisation/src/C0Generator.c Discretisation/src/C2Generator.c Discretisation/src/ConstantElementType.c Discretisation/src/ElementType.c Discretisation/src/ElementType_Register.c Discretisation/src/FeEquationNumber.c Discretisation/src/FeEquationNumber.h Discretisation/src/FeMesh.c Discretisation/src/FeMesh.h Discretisation/src/FeMesh_Algorithms.c Discretisation/src/FeMesh_ElementType.c Discretisation/src/FeSwarmVariable.c Discretisation/src/FeSwarmVariable.h Discretisation/src/FeVariable.c Discretisation/src/FeVariable.h Discretisation/src/FieldTest.c Discretisation/src/FieldTest.h Discretisation/src/Finalise.c Discretisation/src/FunctionSuite.c Discretisation/src/Inner2DGenerator.c Discretisation/src/LinearTriangleElementType.c Discretisation/src/LinkedDofInfo.c Discretisation/src/LinkedDofInfo.h Discretisation/src/OperatorFeVariable.c Discretisation/src/OperatorFeVariable.h Discretisation/src/ShapeFeVariable.c Discretisation/src/ShapeFeVariable.h Discretisation/src/TrilinearElementType.c Discretisation/src/TrilinearInnerElType.c Discretisation/tests/C2GeneratorSuite.c Discretisation/tests/ElementTypeSuite.c Discretisation/tests/FeEquationNumberSuite.c Discretisation/tests/FeVariableSuite.c Discretisation/tests/TrilinearElementTypeSuite.c SConscript SLE/ProvidedSystems/AdvectionDiffusion/src/AdvectionDiffusionSLE.c SLE/ProvidedSystems/AdvectionDiffusion/src/AdvectionDiffusionSLE.h SLE/ProvidedSystems/AdvectionDiffusion/src/Residual.c SLE/ProvidedSystems/AdvectionDiffusion/src/UpwindParameter.c SLE/ProvidedSystems/AdvectionDiffusion/tests/LumpedMassMatrixSuite.c SLE/ProvidedSystems/Energy/src/Energy_SLE.c SLE/ProvidedSystems/Energy/src/Energy_SLE_Solver.c SLE/ProvidedSystems/Energy/src/Energy_SLE_Solver.h SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_PenaltySolver.c SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_PenaltySolver.h SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_UzawaSolver.c SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_UzawaSolver.h SLE/SystemSetup/src/Assembler.c SLE/SystemSetup/src/EntryPoint.c SLE/SystemSetup/src/FiniteElementContext.c SLE/SystemSetup/src/ForceTerm.c SLE/SystemSetup/src/ForceTerm.h SLE/SystemSetup/src/ForceVector.c SLE/SystemSetup/src/ForceVector.h SLE/SystemSetup/src/MGOpGenerator.c SLE/SystemSetup/src/MultigridSolver.c SLE/SystemSetup/src/PETScMGSolver.c SLE/SystemSetup/src/SLE_Solver.c SLE/SystemSetup/src/SLE_Solver.h SLE/SystemSetup/src/SROpGenerator.c SLE/SystemSetup/src/SolutionVector.c SLE/SystemSetup/src/SolutionVector.h SLE/SystemSetup/src/StiffnessMatrix.c SLE/SystemSetup/src/StiffnessMatrix.h SLE/SystemSetup/src/StiffnessMatrixTerm.c SLE/SystemSetup/src/StiffnessMatrixTerm.h SLE/SystemSetup/src/SystemLinearEquations.c SLE/SystemSetup/src/SystemLinearEquations.h SLE/SystemSetup/tests/SolutionVectorSuite.c SLE/SystemSetup/tests/StiffnessMatrixSuite.c SysTest/AnalyticPlugins/AdvDiffSteadyState1D/AdvDiffSteadyState1D.c SysTest/AnalyticPlugins/LinearVelocityAnalytic/LinearVelocityAnalytic.c libStgFEM/src/Init.c libStgFEM/tests/LibStgFEMSuite.c plugins/CompareFeVariableAgainstReferenceSolution/CompareFeVariableAgainstReferenceSolution.c plugins/Document/Document.c plugins/FeVariableImportExporters/FeVariable_ImportExport_ABAQUS/FeVariable_ImportExport_ABAQUS.c plugins/FeVariableImportExporters/FeVariable_ImportExport_SpecRidge2D/FeVariable_ImportExport_SpecRidge2D.c plugins/Output/PrintFeVariableDiscreteValues/Plugin.c plugins/Output/PrintFeVariableDiscreteValues/Plugin.h plugins/Output/PrintFeVariableDiscreteValues_2dBox/Plugin.c plugins/Output/PrintFeVariableDiscreteValues_2dBox/Plugin.h plugins/StandardConditionFunctions/StandardConditionFunctions.c
description:
Make it compile with C++ and C compilers


diff -r 980fabd2e8d6 -r 8917eb4bcedf Assembly/src/PressureGradMatrixTerm.c
--- a/Assembly/src/PressureGradMatrixTerm.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Assembly/src/PressureGradMatrixTerm.c	Wed May 11 13:27:34 2011 -0700
@@ -201,7 +201,7 @@ Bool PressureGradMatrixTerm_RowCB( Press
 
 Bool PressureGradMatrixTerm_ColCB( PressureGradMatrixTerm* self, Assembler* assm ) {
 	if( assm->rowDofInd != assm->colDofInd )
-		return;
+          return False;
 
 	self->elStiffMat[assm->rowInd][assm->colInd] += 
 		assm->shapeFuncs[assm->rowElNodeInd] * 
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/AnalyticSolution.c
--- a/Discretisation/src/AnalyticSolution.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/AnalyticSolution.c	Wed May 11 13:27:34 2011 -0700
@@ -117,7 +117,7 @@ void _AnalyticSolution_Init( AnalyticSol
 
 	/* Add functions to entry points */
 	EntryPoint_AppendClassHook( Context_GetEntryPoint( context, AbstractContext_EP_UpdateClass ), 
-			self->type, AnalyticSolution_Update, self->type, self );
+                                    self->type, (void*)AnalyticSolution_Update, self->type, self );
 	EP_AppendClassHook( Context_GetEntryPoint( context, AbstractContext_EP_DumpClass ), 
 			AnalyticSolution_TestAll, self );
 
@@ -152,7 +152,7 @@ void _AnalyticSolution_Print( void* anal
 	
 }
 
-void* _AnalyticSolution_Copy( void* analyticSolution, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _AnalyticSolution_Copy( const void* analyticSolution, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	abort();
 	return NULL;
 }
@@ -363,7 +363,7 @@ void AnalyticSolution_RegisterFeVariable
 	/* Add feVariable to list */
 	Stg_ObjectList_Append( self->feVariableList, feVariable );
 	/* Add function to list */
-	Stg_ObjectList_GlobalPointerAppend( self->analyticFeVariableFuncList, solutionFunction, (Name)tmpName );
+	Stg_ObjectList_GlobalPointerAppend( self->analyticFeVariableFuncList, (void*)solutionFunction, (Name)tmpName );
 	Memory_Free( tmpName  );	
 }
 
@@ -420,16 +420,16 @@ void AnalyticSolution_BuildAllAnalyticFi
 
 FeVariable* AnalyticSolution_CreateAnalyticField( void* analyticSolution, FeVariable* feVariable ) {
 	AnalyticSolution*                            self = (AnalyticSolution*) analyticSolution;
-	Name                                         tmpName;
+	char*                                        tmpName;
 	FeVariable*                                  analyticFeVariable;
 	Variable*                                    dataVariable;
 	DofLayout*                                   dofLayout;
 	Variable_Register*                           variable_Register = self->context->variable_Register;
 	Dof_Index                                    componentsCount   = feVariable->fieldComponentCount;
-	Name                                         variableName[9];
+	char*                                        variableName[9];
 	Variable_Index                               variable_I;
 	Node_DomainIndex                             node_I;
-	Bool                                         scalar             = ( componentsCount == 1 );
+	Bool scalar=(componentsCount==1) ? True : False;
 	OperatorFeVariable*                          analyticMagField;
 	OperatorFeVariable*                          errorField;
 	OperatorFeVariable*                          errorMagnitudeField;
@@ -575,28 +575,28 @@ FeVariable* AnalyticSolution_CreateAnaly
 }
 
 FeVariable* AnalyticSolution_CreateAnalyticSymmetricTensorField( void* analyticSolution, FeVariable* vectorField ) {
-	AnalyticSolution*		self = (AnalyticSolution*) analyticSolution;
-	FeVariable*				analyticVectorField;
-	OperatorFeVariable*	analyticVectorInvField;
-	Name						tmpName, tmpName2;
-	DofLayout*				dofLayout;
+  AnalyticSolution*		self = (AnalyticSolution*) analyticSolution;
+  FeVariable*				analyticVectorField;
+  OperatorFeVariable*	analyticVectorInvField;
+  char					*tmpName, *tmpName2;
+  DofLayout*				dofLayout;
 
-	analyticVectorField = AnalyticSolution_CreateAnalyticField( self, vectorField );
+  analyticVectorField = AnalyticSolution_CreateAnalyticField( self, vectorField );
 
-	/* Create new dof layout */
-	tmpName = Stg_Object_AppendSuffix( analyticVectorField, (Name)"Analytic-DofLayout"  );
-	dofLayout = DofLayout_New( tmpName, self->context, self->context->variable_Register, Mesh_GetDomainSize( analyticVectorField->feMesh, MT_VERTEX ), NULL );
+  /* Create new dof layout */
+  tmpName = Stg_Object_AppendSuffix( analyticVectorField, (Name)"Analytic-DofLayout"  );
+  dofLayout = DofLayout_New( tmpName, self->context, self->context->variable_Register, Mesh_GetDomainSize( analyticVectorField->feMesh, MT_VERTEX ), NULL );
 
-	/* Create Invariant Field */
-	tmpName2 = Stg_Object_AppendSuffix( analyticVectorField, (Name)"Invariant"  );
-	analyticVectorInvField = OperatorFeVariable_NewUnary( tmpName2, self->context, analyticVectorField, "SymmetricTensor_Invariant" );
+  /* Create Invariant Field */
+  tmpName2 = Stg_Object_AppendSuffix( analyticVectorField, (Name)"Invariant"  );
+  analyticVectorInvField = OperatorFeVariable_NewUnary( tmpName2, self->context, analyticVectorField, "SymmetricTensor_Invariant" );
 
-	Memory_Free( tmpName );
-	Memory_Free( tmpName2 );
+  Memory_Free( tmpName );
+  Memory_Free( tmpName2 );
 
-	LiveComponentRegister_Add( self->LC_Register, (Stg_Component*) analyticVectorInvField );
+  LiveComponentRegister_Add( self->LC_Register, (Stg_Component*) analyticVectorInvField );
 
-	return analyticVectorField;
+  return analyticVectorField;
 }
 
 FeVariable* AnalyticSolution_GetFeVariableFromAnalyticFeVariable( void* analyticSolution, FeVariable* analyticFeVariable ) {
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/AnalyticSolution.h
--- a/Discretisation/src/AnalyticSolution.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/AnalyticSolution.h	Wed May 11 13:27:34 2011 -0700
@@ -114,7 +114,7 @@
 	#define AnalyticSolution_DeepCopy( self ) \
 		(AnalyticSolution*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
 	
-	void* _AnalyticSolution_Copy( void* analyticSolution, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _AnalyticSolution_Copy( const void* analyticSolution, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	/* Build implementation */
 	void _AnalyticSolution_Build( void* analyticSolution, void* data );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/BilinearElementType.c
--- a/Discretisation/src/BilinearElementType.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/BilinearElementType.c	Wed May 11 13:27:34 2011 -0700
@@ -60,7 +60,7 @@ const Type BilinearElementType_Type = "B
 #define _BilinearElementType_NodeCount 4
 
 BilinearElementType* BilinearElementType_New( Name name ) {
-	BilinearElementType* self = _BilinearElementType_DefaultNew( name );
+  BilinearElementType* self = (BilinearElementType*)_BilinearElementType_DefaultNew( name );
 
 	self->isConstructed = True;
 	_ElementType_Init( (ElementType*)self, _BilinearElementType_NodeCount );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/BilinearInnerElType.c
--- a/Discretisation/src/BilinearInnerElType.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/BilinearInnerElType.c	Wed May 11 13:27:34 2011 -0700
@@ -59,7 +59,7 @@ const Type BilinearInnerElType_Type = "B
 #define _BilinearInnerElType_NodeCount 3
 
 BilinearInnerElType* BilinearInnerElType_New( Name name ) {
-	BilinearInnerElType* self = BilinearInnerElType_DefaultNew( name );
+  BilinearInnerElType* self = (BilinearInnerElType*)BilinearInnerElType_DefaultNew( name );
 
 	self->isConstructed = True;	
 	_ElementType_Init( (ElementType*)self, _BilinearInnerElType_NodeCount );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/C0Generator.c
--- a/Discretisation/src/C0Generator.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/C0Generator.c	Wed May 11 13:27:34 2011 -0700
@@ -174,7 +174,7 @@ void C0Generator_SetElementMesh( void* g
 
 	assert( self && Stg_CheckType( self, C0Generator ) );
 
-	self->elMesh = mesh;
+	self->elMesh = (Mesh*)mesh;
 }
 
 
@@ -197,7 +197,7 @@ void C0Generator_BuildTopology( C0Genera
 	elMesh = self->elMesh;
 	nDims = Mesh_GetDimSize( elMesh );
 	elTopo = Mesh_GetTopology( elMesh );
-	elSync = Mesh_GetSync( elMesh, nDims );
+	elSync = Mesh_GetSync( elMesh, (MeshTopology_Dim)nDims );
 
 	topo = Mesh_GetTopology( mesh );
 	MeshTopology_SetComm( topo, MeshTopology_GetComm( elTopo ) );
@@ -206,13 +206,13 @@ void C0Generator_BuildTopology( C0Genera
 	IGraph_SetDomain( topo, MT_VERTEX, elSync );
 	topo->shadDepth = elTopo->shadDepth;
 
-	nDomainEls = Mesh_GetDomainSize( elMesh, nDims );
+	nDomainEls = Mesh_GetDomainSize( elMesh, (MeshTopology_Dim)nDims );
 	nIncEls = AllocArray( unsigned, nDomainEls );
 	incEls = AllocArray2D( unsigned, nDomainEls, 1 );
 	for( e_i = 0; e_i < nDomainEls; e_i++ ) {
 		nIncEls[e_i] = 1;
 		incEls[e_i][0] = e_i;
-		IGraph_SetIncidence( topo, nDims, e_i, MT_VERTEX, nIncEls[e_i], incEls[e_i] );
+		IGraph_SetIncidence( topo, nDims, e_i, MT_VERTEX, nIncEls[e_i], (int*)(incEls[e_i]) );
 	}
 	FreeArray( nIncEls );
 	FreeArray( incEls );
@@ -233,7 +233,7 @@ void C0Generator_BuildGeometry( C0Genera
 
 	elMesh = self->elMesh;
 	nDims = Mesh_GetDimSize( elMesh );
-	nDomainEls = Mesh_GetDomainSize( elMesh, nDims );
+	nDomainEls = Mesh_GetDomainSize( elMesh, (MeshTopology_Dim)nDims );
 	mesh->verts = AllocArray2D( double, nDomainEls, nDims );
 	centroid = AllocArray( double, nDims );
 	for( e_i = 0; e_i < nDomainEls; e_i++ ) {
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/C2Generator.c
--- a/Discretisation/src/C2Generator.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/C2Generator.c	Wed May 11 13:27:34 2011 -0700
@@ -187,7 +187,7 @@ void C2Generator_GenElementVertexInc( vo
 	nDomainEls = Sync_GetNumDomains( IGraph_GetDomain( topo, nDims ) );
 	incEls = Memory_Alloc_Array_Unnamed( unsigned, vertsPerEl );
 	dimInds = Memory_Alloc_Array_Unnamed( unsigned, topo->nDims );
-	for( e_i = 0; e_i < nDomainEls; e_i++ ) {
+	for( e_i = 0; e_i < (unsigned)nDomainEls; e_i++ ) {
 		unsigned	gInd = Sync_DomainToGlobal( IGraph_GetDomain( topo, nDims ), e_i );
 		unsigned	curNode = 0;
 
@@ -268,7 +268,7 @@ void C2Generator_GenElementVertexInc( vo
 			}
 		}
 		CartesianGenerator_MapToDomain( (CartesianGenerator*)self, IGraph_GetDomain( topo, 0), vertsPerEl, incEls );
-		IGraph_SetIncidence( topo, topo->nDims, e_i, MT_VERTEX, vertsPerEl, incEls );
+		IGraph_SetIncidence( topo, topo->nDims, e_i, MT_VERTEX, vertsPerEl, (int*)incEls );
 	}
 
 	FreeArray( incEls );
@@ -291,7 +291,7 @@ void C2Generator_GenFaceVertexInc( void*
 	Journal_Printf( stream, "Generating face-vertex types...\n" );
 	Stream_Indent( stream );
 
-	for( face_i = 0; face_i < topo->remotes[MT_FACE]->nDomains; face_i++ ) {
+	for( face_i = 0; face_i < (unsigned)(topo->remotes[MT_FACE]->nDomains); face_i++ ) {
 		gFace = Sync_DomainToGlobal( topo->remotes[MT_FACE], face_i );
 
 		if( gFace < grids[2][0]->nPoints ) {
@@ -377,7 +377,7 @@ void C2Generator_GenFaceVertexInc( void*
 		}
 
 		CartesianGenerator_MapToDomain( (CartesianGenerator*)self, (Sync*)IGraph_GetDomain( topo, MT_VERTEX ), 9, verts );
-		IGraph_SetIncidence( topo, MT_FACE, face_i, MT_VERTEX, 9, verts );
+		IGraph_SetIncidence( topo, MT_FACE, face_i, MT_VERTEX, 9, (int*)verts );
 	}
 
 	Memory_Free( dimInds );	
@@ -401,7 +401,7 @@ void C2Generator_GenEdgeVertexInc( void*
 	Journal_Printf( stream, "Generating edge-vertex incidence...\n" );
 	Stream_Indent( stream );
 
-	for( edge_i = 0; edge_i < Sync_GetNumDomains( sync ); edge_i++ ) {
+	for( edge_i = 0; edge_i < (unsigned)Sync_GetNumDomains( sync ); edge_i++ ) {
 		gEdge = Sync_DomainToGlobal( sync, edge_i );
 
 		if( gEdge < grids[1][0]->nPoints ) {
@@ -451,7 +451,7 @@ void C2Generator_GenEdgeVertexInc( void*
 		}
 
 		CartesianGenerator_MapToDomain( (CartesianGenerator*)self, (Sync*)IGraph_GetDomain( topo, MT_VERTEX ), 3, verts );
-		IGraph_SetIncidence( topo, MT_EDGE, edge_i, MT_VERTEX, 3, verts );
+		IGraph_SetIncidence( topo, MT_EDGE, edge_i, MT_VERTEX, 3, (int*)verts );
 	}
 
 	Memory_Free( dimInds );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/ConstantElementType.c
--- a/Discretisation/src/ConstantElementType.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/ConstantElementType.c	Wed May 11 13:27:34 2011 -0700
@@ -55,7 +55,7 @@ const Type ConstantElementType_Type = "C
 #define _ConstantElementType_NodeCount 1
 
 ConstantElementType* ConstantElementType_New( Name name ) {
-	ConstantElementType* self = ConstantElementType_DefaultNew( name );
+  ConstantElementType* self = (ConstantElementType*)ConstantElementType_DefaultNew( name );
 
 	self->isConstructed = True;	
 	_ElementType_Init( (ElementType*)self, _ConstantElementType_NodeCount );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/ElementType.c
--- a/Discretisation/src/ElementType.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/ElementType.c	Wed May 11 13:27:34 2011 -0700
@@ -271,7 +271,7 @@ void _ElementType_ConvertGlobalCoordToEl
 
 	Mesh_GetIncidence( mesh, Mesh_GetDimSize( mesh ), element, MT_VERTEX, self->inc );
 	nInc = IArray_GetSize( self->inc );
-	inc = IArray_GetPtr( self->inc );
+	inc = (unsigned*)IArray_GetPtr( (self->inc) );
 
 	/* Initial guess for element local coordinate is in the centre of the element - ( 0.0, 0.0, 0.0 ) */
 	memset( elLocalCoord, 0, dim*sizeof(double) );
@@ -378,7 +378,7 @@ void ElementType_ShapeFunctionsGlobalDer
 
 	Mesh_GetIncidence( mesh, Mesh_GetDimSize( mesh ), elId, MT_VERTEX, self->inc );
 	nInc = IArray_GetSize( self->inc );
-	inc = IArray_GetPtr( self->inc );
+	inc = (unsigned*)IArray_GetPtr((self->inc) );
 	
 	/*
 	If constant shape function gets passed in here, getLocalDeriv will
@@ -396,7 +396,7 @@ void ElementType_ShapeFunctionsGlobalDer
 	/* unroll this bugger cause we do it all the time */
 	if( dim == 2 ) {
 		jac[0][0] = jac[0][1] = jac[1][0] = jac[1][1] = 0.0;
-		for( n=0; n<nodesPerEl; n++){	
+		for( n=0; n<(int)nodesPerEl; n++){	
 			nodeCoord = Mesh_GetVertex( mesh, inc[n] );
 			jac[0][0] = jac[0][0] + GNi[0][n] * nodeCoord[0];
 			jac[0][1] = jac[0][1] + GNi[0][n] * nodeCoord[1];
@@ -410,7 +410,7 @@ void ElementType_ShapeFunctionsGlobalDer
 		jac[0][0] = jac[0][1] = jac[0][2] = 0.0;
 		jac[1][0] = jac[1][1] = jac[1][2] = 0.0;
 		jac[2][0] = jac[2][1] = jac[2][2] = 0.0;
-		for( n=0; n<nodesPerEl; n++){	
+		for( n=0; n<(int)nodesPerEl; n++){	
 			nodeCoord = Mesh_GetVertex( mesh, inc[n] );
 			jac[0][0] = jac[0][0] + GNi[0][n] * nodeCoord[0];
 			jac[0][1] = jac[0][1] + GNi[0][n] * nodeCoord[1];
@@ -475,7 +475,7 @@ void ElementType_ShapeFunctionsGlobalDer
 	
 	/* get global derivs Ni_x, Ni_y and Ni_z if dim == 3 */
 	for( dx=0; dx<dim; dx++ ) {
-		for( n=0; n<nodesPerEl; n++ ) {
+          for( n=0; n<(int)nodesPerEl; n++ ) {
 			
 			globalSF_DerivVal = 0.0;
 			for(dxi=0; dxi<dim; dxi++) {
@@ -509,7 +509,7 @@ void ElementType_Jacobian_AxisIndependen
 
 	Mesh_GetIncidence( mesh, Mesh_GetDimSize( mesh ), elId, MT_VERTEX, self->inc );
 	nInc = IArray_GetSize( self->inc );
-	inc = IArray_GetPtr( self->inc );
+	inc = (unsigned*)IArray_GetPtr((self->inc) );
 	
 	/* If GNi isn't passed in - then evaluate them for you */
 	if (_GNi == NULL) {
@@ -622,7 +622,7 @@ void ElementType_GetFaceNodes( void* ele
 	assert( mesh && Stg_CheckType( mesh, FeMesh ) );
 
 	FeMesh_GetElementNodes( mesh, element_I, self->inc );
-	inc = IArray_GetPtr( self->inc );
+	inc = (unsigned*)IArray_GetPtr((self->inc) );
 
 	for( node_i = 0; node_i < nNodes; node_i++ )
 		nodes[node_i] = inc[self->faceNodes[face_I][node_i]];
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/ElementType_Register.c
--- a/Discretisation/src/ElementType_Register.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/ElementType_Register.c	Wed May 11 13:27:34 2011 -0700
@@ -58,7 +58,7 @@ ElementType_Register* elementType_Regist
 ElementType_Register* elementType_Register = 0;
 
 ElementType_Register* ElementType_Register_New( Name name ) {
-	ElementType_Register* self = ElementType_Register_DefaultNew( name );
+  ElementType_Register* self = (ElementType_Register*)ElementType_Register_DefaultNew( name );
 
 	self->isConstructed = True;
 	_ElementType_Register_Init( self );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/FeEquationNumber.c
--- a/Discretisation/src/FeEquationNumber.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/FeEquationNumber.c	Wed May 11 13:27:34 2011 -0700
@@ -188,7 +188,7 @@ FeEquationNumber* FeEquationNumber_New(
 	VariableCondition*	bcs,
 	LinkedDofInfo*			linkedDofInfo )
 {
-   FeEquationNumber* self = FeEquationNumber_DefaultNew( name );
+  FeEquationNumber* self = (FeEquationNumber*)FeEquationNumber_DefaultNew( name );
 
 	self->isConstructed = True;
 	_FeEquationNumber_Init( self, context, mesh, dofLayout, bcs, linkedDofInfo );
@@ -352,7 +352,7 @@ void _FeEquationNumber_Print( void* mesh
 }
 
 
-void* _FeEquationNumber_Copy( void* feEquationNumber, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _FeEquationNumber_Copy( const void* feEquationNumber, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 #if 0
    FeEquationNumber*	self = (FeEquationNumber*)feEquationNumber;
    Mesh*			mesh;
@@ -508,7 +508,8 @@ void _FeEquationNumber_Build( void* feEq
       DofLayout* dofLayout = self->dofLayout;
       VariableCondition* bcs = self->bcs;
       int nDofs, varInd;
-      int ii, jj;
+      unsigned ii;
+      int jj;
 
       for( ii = 0; ii < FeMesh_GetNodeLocalSize( mesh ); ii++ ) {
          nDofs = dofLayout->dofCounts[ii];
@@ -1844,7 +1845,7 @@ void FeEquationNumber_BuildLocationMatri
    for( e_i = 0; e_i < nDomainEls; e_i++ ) {
       FeMesh_GetElementNodes( feMesh, e_i, inc );
       nElNodes = IArray_GetSize( inc );
-      elNodes = IArray_GetPtr( inc );
+      elNodes = (unsigned*)IArray_GetPtr( inc );
       locMat[e_i] = AllocArray( int*, nElNodes );
       for( n_i = 0; n_i < nElNodes; n_i++ )
          locMat[e_i][n_i] = AllocArray( int, nNodalDofs[elNodes[n_i]] );
@@ -1854,7 +1855,7 @@ void FeEquationNumber_BuildLocationMatri
    for( e_i = 0; e_i < nDomainEls; e_i++ ) {
       FeMesh_GetElementNodes( feMesh, e_i, inc );
       nElNodes = IArray_GetSize( inc );
-      elNodes = IArray_GetPtr( inc );
+      elNodes = (unsigned*)IArray_GetPtr( inc );
       for( n_i = 0; n_i < nElNodes; n_i++ ) {
          for( dof_i = 0; dof_i < nNodalDofs[elNodes[n_i]]; dof_i++ )
             locMat[e_i][n_i][dof_i] = dstArray[elNodes[n_i]][dof_i];
@@ -1933,7 +1934,7 @@ Dof_EquationNumber** FeEquationNumber_Bu
    inc = IArray_New();
    FeMesh_GetElementNodes( feMesh, lElement_I, inc );
    numNodesThisElement = IArray_GetSize( inc );
-   elInc = IArray_GetPtr( inc );
+   elInc = (Node_DomainIndex*)IArray_GetPtr( inc );
 
    /* HACK: Make sure global element location matrix is built. */
    if( !self->locationMatrixBuilt )
@@ -2024,7 +2025,7 @@ void FeEquationNumber_PrintDestinationAr
 	MPI_Comm            comm = Comm_GetMPIComm( Mesh_GetCommTopology( feMesh, MT_VERTEX ) );
 	unsigned            rank;
 	Grid*               vGrid;
-	int                 ijk[3];
+	unsigned            ijk[3];
 	Element_LocalIndex  lNode_I;
 	Node_GlobalIndex    gNode_I;
 	Node_Index          sizeI, sizeJ, sizeK;
@@ -2088,7 +2089,7 @@ void FeEquationNumber_PrintLocationMatri
    for (gEl_I =0; gEl_I < elementGlobalCount; gEl_I++ ) {
       Element_LocalIndex lEl_I;
 
-      if ( !Mesh_GlobalToDomain( feMesh, nDims, gEl_I, &lEl_I ) || lEl_I >= nLocalEls ) {
+      if ( !Mesh_GlobalToDomain( feMesh, (MeshTopology_Dim)nDims, gEl_I, &lEl_I ) || lEl_I >= nLocalEls ) {
          Journal_Printf( stream, "\tLM[(g/l el)%2d/XXX]: on another proc\n", gEl_I);
       }
       else {
@@ -2100,7 +2101,7 @@ void FeEquationNumber_PrintLocationMatri
          inc = IArray_New();
          FeMesh_GetElementNodes( self->feMesh, lEl_I, inc );
          numNodesAtElement = IArray_GetSize( inc );
-         incNodes = IArray_GetPtr( inc );
+         incNodes = (unsigned*)IArray_GetPtr( inc );
 
          Journal_Printf( stream, "\tLM[(g/l el)%2d/%2d][(enodes)0-%d]", gEl_I, lEl_I, numNodesAtElement);	
          /* print the nodes and dofs */
@@ -2410,11 +2411,11 @@ void FeEquationNumber_BuildWithTopology(
    for( e_i = 0; e_i < self->nDomainEls; e_i++ ) {
       FeMesh_GetElementNodes( feMesh, e_i, inc );
       nElNodes = IArray_GetSize( inc );
-      elNodes = IArray_GetPtr( inc );
+      elNodes = (unsigned*)IArray_GetPtr( inc );
       nLocMatDofs = ReallocArray( nLocMatDofs, int, nElNodes );
       for( n_i = 0; n_i < nElNodes; n_i++ )
          nLocMatDofs[n_i] = nNodalDofs[elNodes[n_i]];
-      locMat[e_i] = AllocComplex2D( int, nElNodes, nLocMatDofs );
+      locMat[e_i] = AllocComplex2D( int, nElNodes, (Index*)nLocMatDofs );
    }
    FreeArray( nLocMatDofs );
 
@@ -2517,7 +2518,7 @@ void FeEquationNumber_BuildWithTopology(
    for( e_i = 0; e_i < self->nDomainEls; e_i++ ) {
       FeMesh_GetElementNodes( feMesh, e_i, inc );
       nElNodes = IArray_GetSize( inc );
-      elNodes = IArray_GetPtr( inc );
+      elNodes = (unsigned*)IArray_GetPtr( inc );
       for( n_i = 0; n_i < nElNodes; n_i++ ) {
          for( dof_i = 0; dof_i < nNodalDofs[elNodes[n_i]]; dof_i++ )
             locMat[e_i][n_i][dof_i] = dstArray[elNodes[n_i]][dof_i];
@@ -2627,6 +2628,14 @@ Bool FeEquationNumber_IsKnown( void* feE
 #endif
 
 
+int GenerateEquationNumbering(
+		int NX, int NY, int NZ,
+		int nlocal, int g_node_id[],
+		int dof, int nglobal,
+		PetscTruth periodic_x, PetscTruth periodic_y, PetscTruth periodic_z,
+		int npx, int npy, int npz,
+		int periodic_x_gnode_id[], int periodic_y_gnode_id[], int periodic_z_gnode_id[],
+		int eqnums[], int *neqnums );
 
 void FeEquationNumber_BuildWithDave( FeEquationNumber* self ) {
    int nLocals, *locals;
@@ -2653,20 +2662,20 @@ void FeEquationNumber_BuildWithDave( FeE
    STree *doneSet;
    int ii, jj, kk;
 
-   comm = Mesh_GetCommTopology( self->feMesh, 0 );
+   comm = Mesh_GetCommTopology( self->feMesh, (MeshTopology_Dim)0 );
    mpiComm = Comm_GetMPIComm( comm );
    MPI_Comm_size( mpiComm, &nRanks );
    MPI_Comm_rank( mpiComm, &rank );
 
    /* Setup an array containing global indices of all locally owned nodes. */
-   nLocals = Mesh_GetLocalSize( self->feMesh, 0 );
+   nLocals = Mesh_GetLocalSize( self->feMesh, (MeshTopology_Dim)0 );
    locals = AllocArray( int, nLocals );
    for( ii = 0; ii < nLocals; ii++ )
-      locals[ii] = Mesh_DomainToGlobal( self->feMesh, 0, ii );
+      locals[ii] = Mesh_DomainToGlobal( self->feMesh, (MeshTopology_Dim)0, ii );
 
    /* Allocate for destination array. */
    nDofs = self->dofLayout->dofCounts[0];
-   dstArray = AllocArray2D( int, Mesh_GetDomainSize( self->feMesh, 0 ), nDofs );
+   dstArray = AllocArray2D( int, Mesh_GetDomainSize( self->feMesh, (MeshTopology_Dim)0 ), nDofs );
 
    /* Get the vertex grid extension and any periodicity. */
    nDims = Mesh_GetDimSize( self->feMesh );
@@ -2675,10 +2684,10 @@ void FeEquationNumber_BuildWithDave( FeE
 
    /* Fill destination array with initial values, setting dirichlet BCs as we go. */
    for( ii = 0; ii < nLocals; ii++ ) {
-      Grid_Lift( vGrid, locals[ii], inds );
+     Grid_Lift( vGrid, locals[ii], (unsigned*)inds );
       usePeriodic = False;
       for( jj = 0; jj < nDims; jj++ ) {
-	 if( periodic[jj] && (inds[jj] == 0 || inds[jj] == vGrid->sizes[jj] - 1) ) {
+        if( periodic[jj] && (inds[jj] == 0 || inds[jj] == (int)(vGrid->sizes[jj] - 1)) ) {
             usePeriodic = True;
 	    break;
 	 }
@@ -2703,8 +2712,8 @@ void FeEquationNumber_BuildWithDave( FeE
       if( periodic[ii] ) {
 	 periodicInds[ii] = AllocArray( int, nLocals );
 	 for( jj = 0; jj < nLocals; jj++ ) {
-	    Grid_Lift( vGrid, locals[jj], inds );
-	    if( inds[ii] != vGrid->sizes[ii] - 1 ) continue;
+           Grid_Lift( vGrid, locals[jj], (unsigned*)inds );
+           if( inds[ii] != (int)(vGrid->sizes[ii] - 1) ) continue;
 /*
             for( kk = 0; kk < nDofs; kk++ )
                if( dstArray[jj][kk] == -1 ) break;
@@ -2719,8 +2728,8 @@ void FeEquationNumber_BuildWithDave( FeE
    if( nDims == 2 ) {
       GenerateEquationNumbering( vGrid->sizes[0], vGrid->sizes[1], 1,
 				 nLocals, locals,
-				 nDofs, Mesh_GetGlobalSize( self->feMesh, 0 ),
-				 periodic[0], periodic[1], False,
+				 nDofs, Mesh_GetGlobalSize( self->feMesh, (MeshTopology_Dim)0 ),
+				 (PetscTruth)periodic[0], (PetscTruth)periodic[1], (PetscTruth)False,
 				 nPeriodicInds[0], nPeriodicInds[1], 0,
 				 periodicInds[0], periodicInds[1], NULL,
 				 dstArray[0], &nEqNums );
@@ -2728,8 +2737,8 @@ void FeEquationNumber_BuildWithDave( FeE
    else {
       GenerateEquationNumbering( vGrid->sizes[0], vGrid->sizes[1], vGrid->sizes[2],
 				 nLocals, locals,
-				 nDofs, Mesh_GetGlobalSize( self->feMesh, 0 ),
-				 periodic[0], periodic[1], periodic[2],
+				 nDofs, Mesh_GetGlobalSize( self->feMesh, (MeshTopology_Dim)0 ),
+				 (PetscTruth)periodic[0], (PetscTruth)periodic[1], (PetscTruth)periodic[2],
 				 nPeriodicInds[0], nPeriodicInds[1], nPeriodicInds[2],
 				 periodicInds[0], periodicInds[1], periodicInds[2],
 				 dstArray[0], &nEqNums );
@@ -2744,12 +2753,12 @@ void FeEquationNumber_BuildWithDave( FeE
    /* Setup owned mapping part 1. */
    STree_Clear( self->ownedMap );
    for( ii = 0; ii < nLocals; ii++ ) {
-      Grid_Lift( vGrid, locals[ii], inds );
+     Grid_Lift( vGrid, locals[ii], (unsigned*)inds );
       for( jj = 0; jj < nDims; jj++ ) {
-	 if( periodic[jj] && inds[jj] == vGrid->sizes[jj] - 1 ) {
+        if( periodic[jj] && inds[jj] == (int)(vGrid->sizes[jj] - 1) ) {
             inds[jj] = 0;
-            ind = Grid_Project( vGrid, inds );
-            if( !FeMesh_NodeGlobalToDomain( self->feMesh, ind, &ind ) )
+            ind = Grid_Project( vGrid, (unsigned*)inds );
+            if( !FeMesh_NodeGlobalToDomain( self->feMesh, ind, (unsigned*)(&ind) ) )
                break;
          }
       }
@@ -2785,24 +2794,24 @@ void FeEquationNumber_BuildWithDave( FeE
    NewClass_Delete( doneSet );
 
    /* Transfer remote equation numbers. */
-   sync = Mesh_GetSync( self->feMesh, 0 );
+   sync = Mesh_GetSync( self->feMesh, (MeshTopology_Dim)0 );
    Sync_SyncArray( sync, dstArray[0], nDofs * sizeof(int),
                    dstArray[0] + nLocals * nDofs, nDofs * sizeof(int),
                    nDofs * sizeof(int) );
 
    /* Allocate for location matrix. */
    /* first store nDomainEls for usage during destroy */
-   self->nDomainEls = Mesh_GetDomainSize( self->feMesh, nDims );
+   self->nDomainEls = Mesh_GetDomainSize( self->feMesh, (MeshTopology_Dim)nDims );
    locMat = AllocArray( int**, self->nDomainEls );
-   for( ii = 0; ii < self->nDomainEls; ii++ )
+   for( ii = 0; ii < (int)(self->nDomainEls); ii++ )
       locMat[ii] = AllocArray2D( int, FeMesh_GetElementNodeSize( self->feMesh, 0 ), nDofs );
 
    /* Fill in location matrix. */
    inc = IArray_New();
-   for( ii = 0; ii < Mesh_GetDomainSize( self->feMesh, nDims ); ii++ ) {
+   for( ii = 0; ii < (int)Mesh_GetDomainSize( self->feMesh, (MeshTopology_Dim)nDims ); ii++ ) {
       FeMesh_GetElementNodes( self->feMesh, ii, inc );
       elNodes = IArray_GetPtr( inc );
-      for( jj = 0; jj < FeMesh_GetElementNodeSize( self->feMesh, 0 ); jj++ ) {
+      for( jj = 0; jj < (int)FeMesh_GetElementNodeSize( self->feMesh, 0 ); jj++ ) {
          for( kk = 0; kk < nDofs; kk++ )
             locMat[ii][jj][kk] = dstArray[elNodes[jj]][kk];
       }
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/FeEquationNumber.h
--- a/Discretisation/src/FeEquationNumber.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/FeEquationNumber.h	Wed May 11 13:27:34 2011 -0700
@@ -201,7 +201,7 @@
 	#define FeEquationNumber_DeepCopy( self ) \
 		(FeEquationNumber*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
 	
-	void* _FeEquationNumber_Copy( void* feEquationNumber, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _FeEquationNumber_Copy( const void* feEquationNumber, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 
 	/** The "Build" phase for the equation number information. Calculates the 
 	domain and global Dof and unconstrained Dof totals, and builds the
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/FeMesh.c
--- a/Discretisation/src/FeMesh.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/FeMesh.c	Wed May 11 13:27:34 2011 -0700
@@ -85,7 +85,7 @@ FeMesh* _FeMesh_New(  FEMESH_DEFARGS  ) 
 	return self;
 }
 
-void _FeMesh_Init( FeMesh* self, ElementType* elType, const char* family, Bool elementMesh ) {
+void _FeMesh_Init( FeMesh* self, ElementType* elType, Name family, Bool elementMesh ) {
 	Stream*	stream;
 
 	assert( self && Stg_CheckType( self, FeMesh ) );
@@ -269,7 +269,7 @@ void FeMesh_SetElementType( void* feMesh
 	self->feElType = elType;
 }
 
-void FeMesh_SetElementFamily( void* feMesh, const char* family ) {
+void FeMesh_SetElementFamily( void* feMesh, Name family ) {
 	FeMesh*	self = (FeMesh*)feMesh;
 
 	assert( self );
@@ -381,7 +381,7 @@ void FeMesh_CoordLocalToGlobal( void* fe
 	elType = FeMesh_GetElementType( self, element );
 	FeMesh_GetElementNodes( self, element, self->inc );
 	nElNodes = IArray_GetSize( self->inc );
-	elNodes = IArray_GetPtr( self->inc );
+	elNodes = (unsigned*)IArray_GetPtr( self->inc );
 	basis = AllocArray( double, nElNodes );
 	ElementType_EvaluateShapeFunctionsAt( elType, local, basis );
 
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/FeMesh.h
--- a/Discretisation/src/FeMesh.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/FeMesh.h	Wed May 11 13:27:34 2011 -0700
@@ -54,7 +54,7 @@
 		/* Virtual info */			\
 							\
 		/* FeMesh info */			\
-		const char*			feElFamily;	\
+		Name			feElFamily;	\
 		ElementType*		feElType;	\
 		Bool		elementMesh;		\
 		IArray*	inc;
@@ -80,7 +80,7 @@
 
 	FeMesh* FeMesh_New( Name name, AbstractContext* context );
 	FeMesh* _FeMesh_New(  FEMESH_DEFARGS  );
-	void _FeMesh_Init( FeMesh* self, ElementType* elType, const char* family, Bool elementMesh );
+	void _FeMesh_Init( FeMesh* self, ElementType* elType, Name family, Bool elementMesh );
    FeMesh* _FeMesh_DefaultNew( Name name );
 
 	/*--------------------------------------------------------------------------------------------------------------------------
@@ -99,7 +99,7 @@
 	** Public functions
 	*/
 
-	void FeMesh_SetElementFamily( void* feMesh, const char* family );
+	void FeMesh_SetElementFamily( void* feMesh, Name family );
 	void FeMesh_SetElementType( void* feMesh, ElementType* elType );
 
 	ElementType* FeMesh_GetElementType( void* feMesh, unsigned element );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/FeMesh_Algorithms.c
--- a/Discretisation/src/FeMesh_Algorithms.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/FeMesh_Algorithms.c	Wed May 11 13:27:34 2011 -0700
@@ -116,7 +116,7 @@ void _FeMesh_Algorithms_Print( void* alg
 }
 
 void _FeMesh_Algorithms_AssignFromXML( void* algorithms, Stg_ComponentFactory* cf, void* data ) {
-   _FeMesh_Algorithms_Init( algorithms );
+  _FeMesh_Algorithms_Init( (FeMesh_Algorithms*)algorithms );
 }
 
 void _FeMesh_Algorithms_Build( void* algorithms, void* data ) {
@@ -142,7 +142,7 @@ Bool _FeMesh_Algorithms_Search( void* al
 {
 	FeMesh_Algorithms*	self = (FeMesh_Algorithms*)algorithms;
 
-	return FeMesh_Algorithms_SearchWithTree( self, point, dim, ind );
+	return FeMesh_Algorithms_SearchWithTree( self, point, (unsigned*)dim, ind );
 }
 
 Bool _FeMesh_Algorithms_SearchElements( void* algorithms, double* point, 
@@ -172,16 +172,16 @@ Bool FeMesh_Algorithms_SearchWithTree( v
 
    *dim = Mesh_GetDimSize( self->mesh );
    MPI_Comm_size( MPI_COMM_WORLD, &curRank );
-   nLocals = Mesh_GetLocalSize( self->mesh, *dim );
+   nLocals = Mesh_GetLocalSize( self->mesh, (MeshTopology_Dim)(*dim) );
    if( !SpatialTree_Search( self->tree, pnt, &nEls, &els ) )
       return False;
 
    *el = nLocals;
    elType = Mesh_GetElementType( self->mesh, 0 );
    for( ii = 0; ii < nEls; ii++ ) {
-      if( FeMesh_ElementType_ElementHasPoint( elType, els[ii], pnt, &curDim, &curEl ) ) {
-         if( curEl >= nLocals ) {
-            owner = Mesh_GetOwner( self->mesh, curDim, curEl - nLocals );
+     if( FeMesh_ElementType_ElementHasPoint( elType, els[ii], pnt, (MeshTopology_Dim*)(&curDim), &curEl ) ) {
+       if( curEl >= (unsigned)nLocals ) {
+         owner = Mesh_GetOwner( self->mesh, (MeshTopology_Dim)curDim, curEl - nLocals );
             owner = Comm_RankLocalToGlobal( self->mesh->topo->comm, owner );
             if( owner <= curRank ) {
                curRank = owner;
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/FeMesh_ElementType.c
--- a/Discretisation/src/FeMesh_ElementType.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/FeMesh_ElementType.c	Wed May 11 13:27:34 2011 -0700
@@ -48,7 +48,7 @@ const Type FeMesh_ElementType_Type = "Fe
 ** Constructors
 */
 
-FeMesh_ElementType* FeMesh_ElementType_New( Name name ) {
+FeMesh_ElementType* FeMesh_ElementType_New() {
 	/* Variables set in this function */
 	SizeT                                                    _sizeOfSelf = sizeof(FeMesh_ElementType);
 	Type                                                            type = FeMesh_ElementType_Type;
@@ -123,7 +123,7 @@ Bool FeMesh_ElementType_ElementHasPoint(
 			return False;
 	}
 
-	*dim = nDims;
+	*dim = (MeshTopology_Dim)nDims;
 	*ind = elInd;
 	return True;
 }
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/FeSwarmVariable.c
--- a/Discretisation/src/FeSwarmVariable.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/FeSwarmVariable.c	Wed May 11 13:27:34 2011 -0700
@@ -106,11 +106,11 @@ void _FeSwarmVariable_Print( void* _swar
 	Journal_PrintPointer( stream, self->feVariable );
 }
 
-void* _FeSwarmVariable_Copy( void* swarmVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _FeSwarmVariable_Copy( const void* swarmVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	FeSwarmVariable*	self = (FeSwarmVariable*)swarmVariable;
 	FeSwarmVariable*	newFeSwarmVariable;
 	
-	newFeSwarmVariable = _SwarmVariable_Copy( self, dest, deep, nameExt, ptrMap );
+	newFeSwarmVariable = (FeSwarmVariable*)_SwarmVariable_Copy( self, dest, deep, nameExt, ptrMap );
 	
 	newFeSwarmVariable->feVariable = self->feVariable;
 	
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/FeSwarmVariable.h
--- a/Discretisation/src/FeSwarmVariable.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/FeSwarmVariable.h	Wed May 11 13:27:34 2011 -0700
@@ -86,7 +86,7 @@
 
 	void _FeSwarmVariable_Print( void* _swarmVariable, Stream* stream );
 
-	void* _FeSwarmVariable_Copy( void* swarmVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _FeSwarmVariable_Copy( const void* swarmVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	/* 'Stg_Component' Virtual Implementations */
 	void* _FeSwarmVariable_DefaultNew( Name name );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/FeVariable.c
--- a/Discretisation/src/FeVariable.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/FeVariable.c	Wed May 11 13:27:34 2011 -0700
@@ -80,7 +80,7 @@ FeVariable* FeVariable_New_FromTemplate(
 	Bool							loadReferenceEachTimestep,
 	FieldVariable_Register*	fV_Register )
 {
-	FeVariable*	templateFeVariable = _templateFeVariable;
+  FeVariable*	templateFeVariable = (FeVariable*)_templateFeVariable;
 	FeVariable*	newFeVariable = NULL;
 	
 	newFeVariable = FeVariable_New_Full(
@@ -160,7 +160,7 @@ FeVariable* FeVariable_New_Full(
 	MPI_Comm						communicator,
 	FieldVariable_Register*	fieldVariable_Register )		
 {
-	FeVariable* self = _FeVariable_DefaultNew( name );
+  FeVariable* self = (FeVariable*)_FeVariable_DefaultNew( name );
 
 	self->isConstructed = True;
 	_FieldVariable_Init( (FieldVariable*)self, context, fieldComponentCount, dim, isCheckpointedAndReloaded, communicator, fieldVariable_Register );
@@ -252,7 +252,7 @@ void _FeVariable_Init(
 			self->eqNum = self->templateFeVariable->eqNum;
 		}
 		else {
-			self->eqNum = FeEquationNumber_New( defaultFeVariableFeEquationNumberName, self->context, self->feMesh, self->dofLayout, self->bcs, linkedDofInfo );
+                  self->eqNum = FeEquationNumber_New( defaultFeVariableFeEquationNumberName, self->context, self->feMesh, self->dofLayout, self->bcs, (LinkedDofInfo*)linkedDofInfo );
 			self->eqNum->removeBCs = self->removeBCs;
 		}
 	}
@@ -330,7 +330,7 @@ void _FeVariable_Print( void* variable, 
 	}
 }
 
-void* _FeVariable_Copy( void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _FeVariable_Copy( const void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	FeVariable*	self = (FeVariable*)feVariable;
 	FeVariable*	newFeVariable;
 	PtrMap*		map = ptrMap;
@@ -341,7 +341,7 @@ void* _FeVariable_Copy( void* feVariable
 		ownMap = True;
 	}
 	
-	newFeVariable = _FieldVariable_Copy( self, dest, deep, nameExt, map );
+	newFeVariable = (FeVariable*)_FieldVariable_Copy( self, dest, deep, nameExt, map );
 
 	newFeVariable->templateFeVariable = self->templateFeVariable;
 	
@@ -1183,7 +1183,7 @@ void FeVariable_InterpolateDerivatives_W
 
 	FeMesh_GetElementNodes( self->feMesh, lElement_I, self->inc );
 	nInc = IArray_GetSize( self->inc );
-	inc = IArray_GetPtr( self->inc );
+	inc = (unsigned*)IArray_GetPtr( self->inc );
 
 		/** Interpolate derivative from nodes */
         for ( elLocalNode_I = 0 ; elLocalNode_I < nInc ; elLocalNode_I++) {
@@ -1224,7 +1224,7 @@ void FeVariable_InterpolateValue_WithNi(
 
 	FeMesh_GetElementNodes( self->feMesh, lElement_I, self->inc );
 	nInc = IArray_GetSize( self->inc );
-	inc = IArray_GetPtr( self->inc );
+	inc = (unsigned*)IArray_GetPtr( self->inc );
 
 	for ( dof_I = 0 ; dof_I < dofCount ; dof_I++ ) {
 		/** Interpolate derivative from nodes */
@@ -1542,7 +1542,7 @@ void _FeVariable_InterpolateNodeValuesTo
 
 	FeMesh_GetElementNodes( self->feMesh, element_lI, self->inc );
 	nInc = IArray_GetSize( self->inc );
-	inc = IArray_GetPtr( self->inc );
+	inc = (unsigned*)IArray_GetPtr( self->inc );
 
 	/** Gets number of degrees of freedom - assuming it is the same throughout the mesh */
 	dofCountThisNode = self->dofLayout->dofCounts[lNode_I];
@@ -1727,7 +1727,7 @@ double FeVariable_AverageLayer( void* fe
 	double			heights[2];
 	unsigned		localInd[2], globalInd[2];
 	double			*min, *max;
-	unsigned		d_i;
+	int		d_i;
 	
 	integral = FeVariable_IntegrateLayer( self, swarm, layerAxis, layerIndex );
 
@@ -1935,7 +1935,7 @@ void FeVariable_ImportExportInfo_Delete(
 	/** Nothing to do - the ObjectAdaptor will take care of deleting the actual struct itself */
 }
 
-void FeVariable_SaveToFile( void* feVariable, const char* filename, Bool saveCoords ) {
+void FeVariable_SaveToFile( void* feVariable, Name filename, Bool saveCoords ) {
 	FeVariable*       self = (FeVariable*)feVariable;
 	Node_LocalIndex   lNode_I;
 	Node_GlobalIndex  gNode_I;
@@ -2047,7 +2047,7 @@ void FeVariable_SaveToFile( void* feVari
          H5Gclose(group_id);
          H5Sclose(attribData_id);
       }       
-      size[0] = Mesh_GetGlobalSize( self->feMesh, 0 );;
+      size[0] = Mesh_GetGlobalSize( self->feMesh, (MeshTopology_Dim)0 );;
       size[1] = dofAtEachNodeCount;
       if( saveCoords )
          size[1] += self->dim;
@@ -2184,7 +2184,7 @@ void FeVariable_SaveToFile( void* feVari
 
 #define MAX_LINE_LENGTH_DEFINE 1024
 
-void FeVariable_ReadFromFile( void* feVariable, const char* filename ) {
+void FeVariable_ReadFromFile( void* feVariable, Name filename ) {
 	FeVariable*        self = (FeVariable*)feVariable;
 	Node_LocalIndex    lNode_I = 0;
 	Node_GlobalIndex   gNode_I = 0;
@@ -2364,7 +2364,7 @@ void FeVariable_ReadFromFile( void* feVa
 	   count[1] += self->dim;
 	   
    memSpace = H5Screate_simple( 2, count, NULL );
-   totalNodes = Mesh_GetGlobalSize( self->feMesh, 0 );
+   totalNodes = Mesh_GetGlobalSize( self->feMesh, (MeshTopology_Dim)0 );
    buf = Memory_Alloc_Array( double, count[1], "fileBuffer" );
 
    Journal_Firewall( (maxSize[0] == totalNodes), errorStr,
@@ -2475,7 +2475,7 @@ void FeVariable_ReadFromFile( void* feVa
 	FeVariable_SyncShadowValues( self );
 }
 
-void FeVariable_InterpolateFromFile( void* feVariable, DomainContext* context, const char* feVarFilename, const char* meshFilename ){
+void FeVariable_InterpolateFromFile( void* feVariable, DomainContext* context, Name feVarFilename, const char* meshFilename ){
 	FeVariable*							self = (FeVariable*)feVariable;
    Stream*								errorStr = Journal_Register( Error_Type, (Name)self->type  );   
 #ifdef READ_HDF5
@@ -2497,7 +2497,7 @@ void FeVariable_InterpolateFromFile( voi
 	double*								value;
 	unsigned								nDomainVerts;
 	static double*						arrayPtr;
-   Name									varName[9];
+   char*									varName[9];
 
    /** Open the file and data set. */
 	file = H5Fopen( meshFilename, H5F_ACC_RDONLY, H5P_DEFAULT );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/FeVariable.h
--- a/Discretisation/src/FeVariable.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/FeVariable.h	Wed May 11 13:27:34 2011 -0700
@@ -60,8 +60,8 @@
 	typedef void (FeVariable_SyncShadowValuesFunc)( void* feVariable );
 	
 	/* Function prototypes for import / export */
-	typedef void (FeVariable_ReadNodalValuesFromFile_Function) (void* feVariable, const char* prefixStr, unsigned int timeStep );
-	typedef void (FeVariable_IO_File_Function) (void* feVariable, const char* fileName, Bool saveCoords );
+	typedef void (FeVariable_ReadNodalValuesFromFile_Function) (void* feVariable, Name prefixStr, unsigned int timeStep );
+	typedef void (FeVariable_IO_File_Function) (void* feVariable, Name fileName, Bool saveCoords );
 
 	/* A global list of import/export info objects - can be added to later by plugins. Needs to be initialised in
 	 * FeDiscretisation_Init() */
@@ -233,7 +233,7 @@
 	#define FeVariable_DeepCopy( self ) \
 		(FeVariable*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
 	
-	void* _FeVariable_Copy( void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _FeVariable_Copy( const void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	/** Stg_Component_Build() implementation */
 	void _FeVariable_Build( void* variable, void* data );
@@ -310,17 +310,17 @@
 	void FeVariable_PrintLocalDiscreteValues_2dBox( void* variable, Stream* stream );
 
 	/** Saves the current mesh coordinates, and value of each dof in the feVariable, to file */
-	void FeVariable_SaveToFile( void* feVariable, const char* filename, Bool saveCoords );
+	void FeVariable_SaveToFile( void* feVariable, Name filename, Bool saveCoords );
 
 	/** Reads in everything to initialise a built FeVariable from a file */
-	void FeVariable_ReadFromFile( void* feVariable, const char* filename );
+	void FeVariable_ReadFromFile( void* feVariable, Name filename );
 
 	/** Reads in everything to initialise a built FeVariable from a file. 
 	    This function also performs required interpolation where simulation 
 	    mesh resolution does not match file mesh resolution
 	    you must provide the feVariable which is being initialised, the filename of the checkpointed feVariable
 	    from which interpolation is being performed, and its corresponding mesh filename */
-	void FeVariable_InterpolateFromFile( void* feVariable, DomainContext* context, const char* feVarFilename, const char* meshFilename );
+	void FeVariable_InterpolateFromFile( void* feVariable, DomainContext* context, Name feVarFilename, const char* meshFilename );
 
 	/** Evaluates Spatial Derivatives using shape functions */
 	Bool FeVariable_InterpolateDerivativesAt( void* variable, double* globalCoord, double* value );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/FieldTest.c
--- a/Discretisation/src/FieldTest.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/FieldTest.c	Wed May 11 13:27:34 2011 -0700
@@ -141,7 +141,7 @@ void _FieldTest_Print( void* fieldTest, 
 	
 }
 
-void* _FieldTest_Copy( void* fieldTest, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _FieldTest_Copy( const void* fieldTest, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	abort();
 	return NULL;
 }
@@ -158,7 +158,7 @@ void _FieldTest_AssignFromXML( void* fie
 	FieldVariable_Register*	fV_Register;
 	Index							feVariable_I/*, referenceFieldCount*/;
 	Index							swarmVar_I;
-	Name							fieldName;
+	char*							fieldName;
 	Hook*							generateErrorFields;
 	Hook*							physicsTestHook;
 	Stream*						errStream = Journal_Register( Error_Type, (Name)"FieldTests"  );
@@ -253,12 +253,12 @@ void _FieldTest_AssignFromXML( void* fie
 	self->expectedPass     = False;
 
 	/* set up the entry point */
-	generateErrorFields = Hook_New( "Generate error fields hook", FieldTest_GenerateErrFields, self->name );
+	generateErrorFields = Hook_New( "Generate error fields hook", (void*)FieldTest_GenerateErrFields, self->name );
 	_EntryPoint_AppendHook( Context_GetEntryPoint( self->context, AbstractContext_EP_FrequentOutput ), generateErrorFields );
 
 	/* entry point for the fisix test func */
 	if( strlen(self->expectedFileName) > 1 ) {
-		physicsTestHook = Hook_New( "Physics test hook", FieldTest_EvaluatePhysicsTest, self->name );
+          physicsTestHook = Hook_New( "Physics test hook", (void*)FieldTest_EvaluatePhysicsTest, self->name );
 		_EntryPoint_AppendHook( Context_GetEntryPoint( self->context, AbstractContext_EP_FrequentOutput ), physicsTestHook );
 	}
 
@@ -443,9 +443,9 @@ void FieldTest_BuildAnalyticField( void*
 	FeMesh*					referenceMesh = numericField->feMesh;
 	DomainContext*			context = self->context;
 	Variable_Register*	variable_Register	= context->variable_Register;
-	Name						tmpName;
+	char*						tmpName;
 	Dof_Index				componentsCount = numericField->fieldComponentCount;
-	Name						varName[9];
+	char*						varName[9];
 	unsigned					var_I;
 	unsigned					node_I;
 	Variable*				variable;
@@ -543,9 +543,9 @@ void FieldTest_BuildErrField( void* fiel
 	FeVariable*				numericField = self->numericFieldList[field_I];
 	DomainContext*			context = self->context;
 	Variable_Register*	variable_Register	= context->variable_Register;
-	Name						tmpName;
+	char*						tmpName;
 	Dof_Index				componentsCount = numericField->fieldComponentCount;
-	Name						varName[9];
+	char*						varName[9];
 	unsigned					var_I;
 	unsigned					node_I;
 	Variable*				variable;
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/FieldTest.h
--- a/Discretisation/src/FieldTest.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/FieldTest.h	Wed May 11 13:27:34 2011 -0700
@@ -151,7 +151,7 @@
 	#define FieldTest_DeepCopy( self ) \
 		(FieldTest*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
 	
-	void* _FieldTest_Copy( void* fieldTest, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _FieldTest_Copy( const void* fieldTest, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	/* Build implementation */
 	void _FieldTest_Build( void* fieldTest, void* data );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/Finalise.c
--- a/Discretisation/src/Finalise.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/Finalise.c	Wed May 11 13:27:34 2011 -0700
@@ -49,6 +49,7 @@
 #include "Finalise.h"
 
 #include "FeVariable.h"
+#include <petsc.h>
 
 #include <stdio.h>
 
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/FunctionSuite.c
--- a/Discretisation/src/FunctionSuite.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/FunctionSuite.c	Wed May 11 13:27:34 2011 -0700
@@ -58,7 +58,7 @@ void StgFEM_InterpolateValue_WithNi( voi
 
 	FeMesh_GetElementNodes( self->feMesh, lElement_I, self->inc );
 	nInc = IArray_GetSize( self->inc );
-	inc = IArray_GetPtr( self->inc );
+	inc = (unsigned*)IArray_GetPtr( self->inc );
 
 	for ( dof_I = 0; dof_I < dofCount; dof_I++ ) {
 		dofVariable = DofLayout_GetVariable( self->dofLayout, 0, dof_I );
@@ -90,7 +90,7 @@ void StgFEM_InterpolateDerivatives_WithG
 
 	FeMesh_GetElementNodes( self->feMesh, lElement_I, self->inc );
 	nInc = IArray_GetSize( self->inc );
-	inc = IArray_GetPtr( self->inc );
+	inc = (unsigned*)IArray_GetPtr( self->inc );
 
 	for ( dof_I = 0 ; dof_I < dofCount ; dof_I++ ) {
 		dofVariable  = DofLayout_GetVariable( self->dofLayout, 0, dof_I );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/Inner2DGenerator.c
--- a/Discretisation/src/Inner2DGenerator.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/Inner2DGenerator.c	Wed May 11 13:27:34 2011 -0700
@@ -176,7 +176,7 @@ void Inner2DGenerator_SetElementMesh( vo
 
 	assert( self && Stg_CheckType( self, Inner2DGenerator ) );
 
-	self->elMesh = mesh;
+	self->elMesh = (Mesh*)mesh;
 }
 
 
@@ -203,7 +203,7 @@ void Inner2DGenerator_BuildTopology( Inn
 	elMesh = self->elMesh;
 	nDims = Mesh_GetDimSize( elMesh );
 	elTopo = Mesh_GetTopology( elMesh );
-	elSync = Mesh_GetSync( elMesh, nDims );
+	elSync = Mesh_GetSync( elMesh, (MeshTopology_Dim)nDims );
 
 	topo = Mesh_GetTopology( mesh );
 	MeshTopology_SetComm( topo, MeshTopology_GetComm( elTopo ) );
@@ -272,7 +272,7 @@ void Inner2DGenerator_BuildTopology( Inn
 	topo->shadDepth = elTopo->shadDepth;
 
 	/* Build the incidence. */
-	nDomainEls = Mesh_GetDomainSize( elMesh, nDims );
+	nDomainEls = Mesh_GetDomainSize( elMesh, (MeshTopology_Dim)nDims );
 	if( nDims == 2 ) {
 		nIncEls = 3;
 		incEls = MemArray( unsigned, 3, Inner2DGenerator_Type );
@@ -315,7 +315,7 @@ void Inner2DGenerator_BuildGeometry( Inn
 
 	elMesh = self->elMesh;
 	nDims = Mesh_GetDimSize( elMesh );
-	nDomainEls = Mesh_GetDomainSize( elMesh, nDims );
+	nDomainEls = Mesh_GetDomainSize( elMesh, (MeshTopology_Dim)nDims );
 
 	if( nDims == 2 ) {
 		mesh->verts = AllocArray2D( double, nDomainEls * 3, nDims );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/LinearTriangleElementType.c
--- a/Discretisation/src/LinearTriangleElementType.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/LinearTriangleElementType.c	Wed May 11 13:27:34 2011 -0700
@@ -56,7 +56,7 @@ const Type LinearTriangleElementType_Typ
 #define _LinearTriangleElementType_NodeCount 3
 
 LinearTriangleElementType* LinearTriangleElementType_New( Name name ) {
-	LinearTriangleElementType* self = _LinearTriangleElementType_DefaultNew( name );
+  LinearTriangleElementType* self = (LinearTriangleElementType*)_LinearTriangleElementType_DefaultNew( name );
 
 	self->isConstructed = True;
 	_ElementType_Init( (ElementType*)self, _LinearTriangleElementType_NodeCount );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/LinkedDofInfo.c
--- a/Discretisation/src/LinkedDofInfo.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/LinkedDofInfo.c	Wed May 11 13:27:34 2011 -0700
@@ -56,7 +56,7 @@ const Type LinkedDofInfo_Type = "LinkedD
 const Type LinkedDofInfo_Type = "LinkedDofInfo";
 
 LinkedDofInfo* LinkedDofInfo_New( Name name, DomainContext* context, void* mesh, DofLayout* dofLayout, Dictionary* dictionary ) {
-	LinkedDofInfo* self = _LinkedDofInfo_DefaultNew( name );
+  LinkedDofInfo* self = (LinkedDofInfo*)_LinkedDofInfo_DefaultNew( name );
 
 	self->isConstructed = True;	
 	_LinkedDofInfo_Init( self, context, mesh, dofLayout, dictionary );
@@ -184,7 +184,7 @@ void _LinkedDofInfo_Destroy( void* linke
 	Memory_Free( self->eqNumsOfLinkedDofs );
 }
 
-void* _LinkedDofInfo_Copy( void* linkedDofInfo, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _LinkedDofInfo_Copy( const void* linkedDofInfo, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	LinkedDofInfo*	self = (LinkedDofInfo*)linkedDofInfo;
 	LinkedDofInfo*	newLinkedDofInfo;
 	PtrMap*			map = ptrMap;
@@ -195,7 +195,7 @@ void* _LinkedDofInfo_Copy( void* linkedD
 		ownMap = True;
 	}
 	
-	newLinkedDofInfo = _Stg_Class_Copy( self, dest, deep, nameExt, map );
+	newLinkedDofInfo = (LinkedDofInfo*)_Stg_Class_Copy( self, dest, deep, nameExt, map );
 	
 	/* Virtual methods */
 	newLinkedDofInfo->linkedDofSetsCount = self->linkedDofSetsCount;
@@ -206,7 +206,7 @@ void* _LinkedDofInfo_Copy( void* linkedD
 		newLinkedDofInfo->dofLayout = (DofLayout*)Stg_Class_Copy( self->dofLayout, NULL, deep, nameExt, map );
 		newLinkedDofInfo->mesh = (Mesh*)Stg_Class_Copy( self->mesh, NULL, deep, nameExt, map );
 
-		if ( (newLinkedDofInfo->linkedDofTbl = PtrMap_Find( map, self->linkedDofTbl )) == NULL && self->linkedDofTbl ) {
+		if ( (newLinkedDofInfo->linkedDofTbl = (int**)PtrMap_Find( map, self->linkedDofTbl )) == NULL && self->linkedDofTbl ) {
 			Node_Index	node_I;
 			Dof_Index	dof_I;
 			newLinkedDofInfo->linkedDofTbl = Memory_Alloc_2DComplex( int, self->dofLayout->_numItemsInLayout, self->dofLayout->dofCounts, "linkedDofInfo->linkedDofTbl" );
@@ -218,7 +218,7 @@ void* _LinkedDofInfo_Copy( void* linkedD
 			}
 			PtrMap_Append( map, self->linkedDofTbl, newLinkedDofInfo->linkedDofTbl );
 		}
-		if ( (newLinkedDofInfo->eqNumsOfLinkedDofs = PtrMap_Find( map, self->eqNumsOfLinkedDofs )) == NULL && self->eqNumsOfLinkedDofs ) {	
+		if ( (newLinkedDofInfo->eqNumsOfLinkedDofs = (int*)PtrMap_Find( map, self->eqNumsOfLinkedDofs )) == NULL && self->eqNumsOfLinkedDofs ) {	
 			newLinkedDofInfo->eqNumsOfLinkedDofs = Memory_Alloc_Array( int, self->linkedDofSetsCount, "linkedDofInfo->eqNumsOfLinkedDofs" );
 			memcpy( newLinkedDofInfo->eqNumsOfLinkedDofs, self->eqNumsOfLinkedDofs, self->linkedDofSetsCount * sizeof(int) );
 			PtrMap_Append( map, self->eqNumsOfLinkedDofs, newLinkedDofInfo->eqNumsOfLinkedDofs );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/LinkedDofInfo.h
--- a/Discretisation/src/LinkedDofInfo.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/LinkedDofInfo.h	Wed May 11 13:27:34 2011 -0700
@@ -125,7 +125,7 @@
 	#define LinkedDofInfo_DeepCopy( self ) \
 		(LinkedDofInfo*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
 	
-	void* _LinkedDofInfo_Copy( void* linkedDofInfo, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _LinkedDofInfo_Copy( const void* linkedDofInfo, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 
 	void _LinkedDofInfo_Build( void* linkedDofInfo, void* data );
 
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/OperatorFeVariable.c
--- a/Discretisation/src/OperatorFeVariable.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/OperatorFeVariable.c	Wed May 11 13:27:34 2011 -0700
@@ -178,7 +178,7 @@ OperatorFeVariable* OperatorFeVariable_N
 	MPI_Comm													communicator,
 	FieldVariable_Register*								fieldVariable_Register )
 {
-	OperatorFeVariable* self = _OperatorFeVariable_DefaultNew( name );
+  OperatorFeVariable* self = (OperatorFeVariable*)_OperatorFeVariable_DefaultNew( name );
 
 	self->isConstructed = True;
 	_FieldVariable_Init( (FieldVariable*)self, context, feVariableCount, dim, isCheckpointedAndReloaded, communicator, fieldVariable_Register );                                                                                                          
@@ -266,11 +266,11 @@ void _OperatorFeVariable_Print( void* _f
 
 }
 
-void* _OperatorFeVariable_Copy( void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _OperatorFeVariable_Copy( const void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	OperatorFeVariable*	self = (OperatorFeVariable*)feVariable;
 	OperatorFeVariable*	newOperatorFeVariable;
 	
-	newOperatorFeVariable = _FeVariable_Copy( self, dest, deep, nameExt, ptrMap );
+	newOperatorFeVariable = (OperatorFeVariable*)_FeVariable_Copy( self, dest, deep, nameExt, ptrMap );
 	
 	newOperatorFeVariable->_operator = self->_operator;
 	newOperatorFeVariable->feVariableCount = self->feVariableCount;
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/OperatorFeVariable.h
--- a/Discretisation/src/OperatorFeVariable.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/OperatorFeVariable.h	Wed May 11 13:27:34 2011 -0700
@@ -62,7 +62,7 @@
 		__FeVariable \
 		\
 		/* Other info */ \
-		char*				operatorName; \
+		Name				operatorName; \
 		Operator*		_operator; \
 		Index				feVariableCount; \
 		FeVariable**	feVariableList; \
@@ -137,7 +137,7 @@
 
 	void _OperatorFeVariable_Print( void* _feVariable, Stream* stream );
 
-	void* _OperatorFeVariable_Copy( void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _OperatorFeVariable_Copy( const void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	/* 'Stg_Component' Virtual Implementations */
 	void _OperatorFeVariable_AssignFromXML( void* feVariable, Stg_ComponentFactory* cf, void* data );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/ShapeFeVariable.c
--- a/Discretisation/src/ShapeFeVariable.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/ShapeFeVariable.c	Wed May 11 13:27:34 2011 -0700
@@ -75,7 +75,7 @@ void* ShapeFeVariable_DefaultNew( Name n
 	FeVariable_GetValueAtNodeFunction*                      _getValueAtNode = _FeVariable_GetValueAtNode;
 
 	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType                             nameAllocationType = ZERO;
+	AllocationType                             nameAllocationType = (AllocationType)ZERO;
 	FeVariable_SyncShadowValuesFunc*            _syncShadowValues = ZERO;
 
 	return (ShapeFeVariable*) _ShapeFeVariable_New(  SHAPEFEVARIABLE_PASSARGS  );
@@ -120,7 +120,7 @@ void _ShapeFeVariable_Print( void* _shap
 	Journal_PrintPointer( stream, self->shape );
 }
 
-void* _ShapeFeVariable_Copy( void* shapeFeVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _ShapeFeVariable_Copy( const void* shapeFeVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	/* ShapeFeVariable*	self = (ShapeFeVariable*)shapeFeVariable; */
 	ShapeFeVariable* newShapeFeVariable;
 	
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/ShapeFeVariable.h
--- a/Discretisation/src/ShapeFeVariable.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/ShapeFeVariable.h	Wed May 11 13:27:34 2011 -0700
@@ -85,7 +85,7 @@
 
 	void _ShapeFeVariable_Print( void* _swarmVariable, Stream* stream );
 
-	void* _ShapeFeVariable_Copy( void* swarmVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _ShapeFeVariable_Copy( const void* swarmVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	/* 'Stg_Component' Virtual Implementations */
 	void _ShapeFeVariable_AssignFromXML( void* swarmVariable, Stg_ComponentFactory* cf, void* data );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/TrilinearElementType.c
--- a/Discretisation/src/TrilinearElementType.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/TrilinearElementType.c	Wed May 11 13:27:34 2011 -0700
@@ -82,7 +82,7 @@ void* _TrilinearElementType_DefaultNew( 
 }
 
 TrilinearElementType* TrilinearElementType_New( Name name ) {
-	TrilinearElementType* self = _TrilinearElementType_DefaultNew( name );
+  TrilinearElementType* self = (TrilinearElementType*)_TrilinearElementType_DefaultNew( name );
 
 	self->isConstructed = True;
 	_ElementType_Init( (ElementType*)self, _TrilinearElementType_NodeCount );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/src/TrilinearInnerElType.c
--- a/Discretisation/src/TrilinearInnerElType.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/src/TrilinearInnerElType.c	Wed May 11 13:27:34 2011 -0700
@@ -82,7 +82,7 @@ void* _TrilinearInnerElType_DefaultNew( 
 }
 
 TrilinearInnerElType* TrilinearInnerElType_New( Name name ) {
-	TrilinearInnerElType* self = _TrilinearInnerElType_DefaultNew( name );
+  TrilinearInnerElType* self = (TrilinearInnerElType*)_TrilinearInnerElType_DefaultNew( name );
 
 	self->isConstructed = True;
 	_ElementType_Init( (ElementType*)self, _TrilinearInnerElType_NodeCount );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/tests/C2GeneratorSuite.c
--- a/Discretisation/tests/C2GeneratorSuite.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/tests/C2GeneratorSuite.c	Wed May 11 13:27:34 2011 -0700
@@ -92,14 +92,14 @@ void C2GeneratorSuite_TestElementVertexI
 	unsigned	gNode0, gNode1, gNode2;
 	int		checkNodes;
 
-	for( el_i = 0; el_i < Mesh_GetLocalSize( data->mesh, dim ); el_i++ ) {
+	for( el_i = 0; el_i < Mesh_GetLocalSize( data->mesh, (MeshTopology_Dim)dim ); el_i++ ) {
 		gEl = Sync_DomainToGlobal( elSync, el_i );
 		Grid_Lift( elGrid, gEl, dimInds );
 		dimInds[0] *= 2; dimInds[1] *= 2; dimInds[2] *= 2;
 
 		MeshTopology_GetIncidence( (IGraph*)data->mesh->topo, dim, el_i, MT_VERTEX, inc );
 		nIncVerts = IArray_GetSize( inc );
-		incVerts = IArray_GetPtr( inc );
+		incVerts = (unsigned*)IArray_GetPtr( inc );
 
 		pcu_check_true( nIncVerts == 27 );
 
@@ -335,7 +335,7 @@ void C2GeneratorSuite_TestEdgeVertexInc(
 
 		MeshTopology_GetIncidence( (IGraph*)data->mesh->topo, MT_EDGE, edge_i, MT_VERTEX, inc );
 		nIncVerts = IArray_GetSize( inc );
-		incVerts = IArray_GetPtr( inc );
+		incVerts = (unsigned*)IArray_GetPtr( inc );
 
 		pcu_check_true( nIncVerts == 3 );
 
@@ -460,7 +460,7 @@ void C2GeneratorSuite_TestFaceVertexInc(
 
 		MeshTopology_GetIncidence( (IGraph*)data->mesh->topo, MT_FACE, face_i, MT_VERTEX, inc );
 		nIncVerts = IArray_GetSize( inc );
-		incVerts = IArray_GetPtr( inc );
+		incVerts = (unsigned*)IArray_GetPtr( inc );
 
 		pcu_check_true( nIncVerts == 9 );
 
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/tests/ElementTypeSuite.c
--- a/Discretisation/tests/ElementTypeSuite.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/tests/ElementTypeSuite.c	Wed May 11 13:27:34 2011 -0700
@@ -126,8 +126,8 @@ void ElementTypeSuite_TestLinear2D( Elem
 		_ElementType_ConvertGlobalCoordToElLocal( elType, feMesh, el, gCoord, lCoord );
 		ElementType_EvaluateShapeFunctionsAt( elType, lCoord, Ni );
 
-		Mesh_GetIncidence( feMesh, dim, el, MT_VERTEX, inc );
-		elNodes = IArray_GetPtr( inc );
+		Mesh_GetIncidence( feMesh, (MeshTopology_Dim)dim, el, MT_VERTEX, inc );
+		elNodes = (unsigned*)IArray_GetPtr( inc );
 		memset( gCoord_fromLocal, 0, sizeof( double ) * dim );
 		for( elNode_i = 0; elNode_i < elNodeCount; elNode_i++ ) {
 			gCoord_fromLocal[I_AXIS] += Ni[elNode_i] * feMesh->verts[elNodes[elNode_i]][I_AXIS];
@@ -174,8 +174,8 @@ void ElementTypeSuite_TestLinear3D( Elem
 		_ElementType_ConvertGlobalCoordToElLocal( elType, feMesh, el, gCoord, lCoord );
 		ElementType_EvaluateShapeFunctionsAt( elType, lCoord, Ni );
 
-		Mesh_GetIncidence( feMesh, dim, el, MT_VERTEX, inc );
-		elNodes = IArray_GetPtr( inc );
+		Mesh_GetIncidence( feMesh, (MeshTopology_Dim)dim, el, MT_VERTEX, inc );
+		elNodes = (unsigned*)IArray_GetPtr( inc );
 		memset( gCoord_fromLocal, 0, sizeof( double ) * dim );
 		for( elNode_i = 0; elNode_i < elNodeCount; elNode_i++ ) {
 			gCoord_fromLocal[I_AXIS] += Ni[elNode_i] * feMesh->verts[elNodes[elNode_i]][I_AXIS];
@@ -223,8 +223,8 @@ void ElementTypeSuite_TestQuadratic2D( E
 		_ElementType_ConvertGlobalCoordToElLocal( elType, feMesh, el, gCoord, lCoord );
 		ElementType_EvaluateShapeFunctionsAt( elType, lCoord, Ni );
 
-		Mesh_GetIncidence( feMesh, dim, el, MT_VERTEX, inc );
-		elNodes = IArray_GetPtr( inc );
+		Mesh_GetIncidence( feMesh, (MeshTopology_Dim)dim, el, MT_VERTEX, inc );
+		elNodes = (unsigned*)IArray_GetPtr( inc );
 		memset( gCoord_fromLocal, 0, sizeof( double ) * dim );
 		for( elNode_i = 0; elNode_i < elNodeCount; elNode_i++ ) {
 			gCoord_fromLocal[I_AXIS] += Ni[elNode_i] * feMesh->verts[elNodes[elNode_i]][I_AXIS];
@@ -271,8 +271,8 @@ void ElementTypeSuite_TestQuadratic3D( E
 		_ElementType_ConvertGlobalCoordToElLocal( elType, feMesh, el, gCoord, lCoord );
 		ElementType_EvaluateShapeFunctionsAt( elType, lCoord, Ni );
 
-		Mesh_GetIncidence( feMesh, dim, el, MT_VERTEX, inc );
-		elNodes = IArray_GetPtr( inc );
+		Mesh_GetIncidence( feMesh, (MeshTopology_Dim)dim, el, MT_VERTEX, inc );
+		elNodes = (unsigned*)IArray_GetPtr( inc );
 		memset( gCoord_fromLocal, 0, sizeof( double ) * dim );
 		for( elNode_i = 0; elNode_i < elNodeCount; elNode_i++ ) {
 			gCoord_fromLocal[I_AXIS] += Ni[elNode_i] * feMesh->verts[elNodes[elNode_i]][I_AXIS];
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/tests/FeEquationNumberSuite.c
--- a/Discretisation/tests/FeEquationNumberSuite.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/tests/FeEquationNumberSuite.c	Wed May 11 13:27:34 2011 -0700
@@ -86,9 +86,9 @@ FeEquationNumber* buildEqNum() {
    arrayPtrs[0] = Memory_Alloc_Array_Unnamed( double, arraySize );
    arrayPtrs[1] = Memory_Alloc_Array_Unnamed( double, arraySize );
    vars[0] = Variable_New( "one", NULL, 1, &dataOffs, &dataType, (unsigned*)&nDataTypes, 
-		&dataNames, &structSize, (unsigned*)&arraySize, NULL, arrayPtrs, varReg );
+                           (Name*)(&dataNames), &structSize, (unsigned*)&arraySize, NULL, arrayPtrs, varReg );
    vars[1] = Variable_New( "two", NULL, 1, &dataOffs, &dataType, (unsigned*)&nDataTypes, 
-		&dataNames, &structSize, (unsigned*)&arraySize, NULL, arrayPtrs + 1, varReg );
+                           (Name*)(&dataNames), &structSize, (unsigned*)&arraySize, NULL, arrayPtrs + 1, varReg );
 
    dofs = DofLayout_New( "", NULL, varReg, 0, feMesh );
    dofs->nBaseVariables = 2;
@@ -154,9 +154,9 @@ FeEquationNumber* buildEqNumBCs() {
    arrayPtrs[0] = Memory_Alloc_Array_Unnamed( double, arraySize );
    arrayPtrs[1] = Memory_Alloc_Array_Unnamed( double, arraySize );
    vars[0] = Variable_New( "one", NULL, 1, &dataOffs, &dataType, (unsigned*)&nDataTypes, 
-		&dataNames, &structSize, (unsigned*)&arraySize, NULL, arrayPtrs, varReg );
+                           (Name*)(&dataNames), &structSize, (unsigned*)&arraySize, NULL, arrayPtrs, varReg );
 	vars[1] = Variable_New( "two", NULL, 1, &dataOffs, &dataType, (unsigned*)&nDataTypes, 
-		&dataNames, &structSize, (unsigned*)&arraySize, NULL, arrayPtrs + 1, varReg );
+                                (Name*)(&dataNames), &structSize, (unsigned*)&arraySize, NULL, arrayPtrs + 1, varReg );
 
    dofs = DofLayout_New( "", NULL, varReg, 0, feMesh );
    dofs->nBaseVariables = 2;
@@ -217,7 +217,7 @@ void FeEquationNumberSuite_TestLocal( Fe
       if( dof_i < nDofs )
 	 break;
    }
-   pcu_check_true( n_i == Mesh_GetLocalSize( feMesh, 0 ) );
+   pcu_check_true( n_i == Mesh_GetLocalSize( feMesh, (MeshTopology_Dim)0 ) );
 
    FreeObject( eqNum );
 }
@@ -263,7 +263,7 @@ void FeEquationNumberSuite_TestShadow( F
       else
 	 curEqNum += 2;
    }
-   pcu_check_true( n_i == Mesh_GetDomainSize( feMesh, 0 ) );
+   pcu_check_true( n_i == Mesh_GetDomainSize( feMesh, (MeshTopology_Dim)0 ) );
 
    FreeObject( eqNum );
 }
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/tests/FeVariableSuite.c
--- a/Discretisation/tests/FeVariableSuite.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/tests/FeVariableSuite.c	Wed May 11 13:27:34 2011 -0700
@@ -109,7 +109,7 @@ FeVariable* BuildFeVariable_AsPosition( 
 	fieldReg = FieldVariable_Register_New();
 	feVar = FeVariable_New( "velocity", NULL, feMesh, NULL, dofs, NULL, NULL, NULL, dim, True, False, False, fieldReg );
 
-	for( n_i = 0; n_i < Mesh_GetLocalSize( feMesh, 0 ); n_i++ ) {
+	for( n_i = 0; n_i < Mesh_GetLocalSize( feMesh, (MeshTopology_Dim)0 ); n_i++ ) {
 		double* pos = Mesh_GetVertex( feMesh, n_i );
 		Variable_SetValue( var, n_i, pos );
 	}
@@ -179,7 +179,7 @@ FeVariable* BuildFeVariable_AsConstant( 
 	fieldReg = FieldVariable_Register_New();
 	feVar = FeVariable_New( "pressure", NULL, feMesh, NULL, dofs, NULL, NULL, NULL, dim, True, False, False, fieldReg );
 
-	for( n_i = 0; n_i < Mesh_GetLocalSize( feMesh, 0 ); n_i++ ) {
+	for( n_i = 0; n_i < Mesh_GetLocalSize( feMesh, (MeshTopology_Dim)0 ); n_i++ ) {
 		Variable_SetValue( var, n_i, constant );
 	}
 
@@ -227,10 +227,10 @@ void FeVariableSuite_Interpolate( FeVari
 	InterpolationResult	interpRes;
 	unsigned		dim_i;
 
-	for( el_i = 0; el_i < Mesh_GetDomainSize( feVar->feMesh, 3 ); el_i++ ) {
-		Mesh_GetIncidence( feVar->feMesh, 3, el_i, MT_VERTEX, inc );
+	for( el_i = 0; el_i < Mesh_GetDomainSize( feVar->feMesh, (MeshTopology_Dim)3 ); el_i++ ) {
+          Mesh_GetIncidence( feVar->feMesh, (MeshTopology_Dim)3, el_i, MT_VERTEX, inc );
 		nVerts = IArray_GetSize( inc );
-		verts = IArray_GetPtr( inc );
+		verts = (unsigned*)IArray_GetPtr( inc );
 
 		for( vert_i = 0; vert_i < nVerts; vert_i++ ) {
 			vert = Mesh_GetVertex( feVar->feMesh, verts[vert_i] );
diff -r 980fabd2e8d6 -r 8917eb4bcedf Discretisation/tests/TrilinearElementTypeSuite.c
--- a/Discretisation/tests/TrilinearElementTypeSuite.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/Discretisation/tests/TrilinearElementTypeSuite.c	Wed May 11 13:27:34 2011 -0700
@@ -95,11 +95,11 @@ void TrilinearElementTypeSuite_TestShape
    Stg_Component_Initialise( mesh, data, True );
 
    nDims = Mesh_GetDimSize( mesh );
-   nEls = Mesh_GetDomainSize( mesh, nDims );
+   nEls = Mesh_GetDomainSize( mesh, (MeshTopology_Dim)nDims );
    inc = IArray_New();
 
    for( e_i = 0; e_i < nEls; e_i++ ) {
-		Mesh_GetIncidence( mesh, nDims, e_i, 0, inc );
+     Mesh_GetIncidence( mesh, (MeshTopology_Dim)nDims, e_i, (MeshTopology_Dim)0, inc );
       nVerts = IArray_GetSize( inc );
       verts = IArray_GetPtr( inc );
 
diff -r 980fabd2e8d6 -r 8917eb4bcedf SConscript
--- a/SConscript	Wed Apr 13 14:07:16 2011 -0700
+++ b/SConscript	Wed May 11 13:27:34 2011 -0700
@@ -88,10 +88,8 @@ env.Install('include/StgFEM', Glob('libS
 
 dirs = ['libStgFEM/Toolbox',
      'plugins/CompareFeVariableAgainstReferenceSolution',
-     'plugins/Document',
      'plugins/FeVariableImportExporters/FeVariable_ImportExport_ABAQUS',
      'plugins/FeVariableImportExporters/FeVariable_ImportExport_SpecRidge2D',
-#  'plugins/FileAnalyticSolution',
      'plugins/Output/CPUTime',
      'plugins/Output/CPUTimeAndNumberOfIterationsForInnerAndOuterSolve',
      'plugins/Output/FrequentOutput',
@@ -166,10 +164,10 @@ if env['static_libs']:
         n = n[:-6]
         reg_c += 'extern void (%s_MetaAsDictionary)();\n'%n
         reg_c += 'extern void (%s_GetName)();\n'%n
-        reg_c += 'extern void (%s_Register)();\n'%n
+        reg_c += 'extern void (%s_Register)(PluginsManager* pluginsManager);\n'%n
         if n.find('Toolbox') != -1:
-            reg_c += 'extern void (%s_Initialise)();\n'%n
-            reg_c += 'extern void (%s_Finalise)();\n'%n
+            reg_c += 'extern void (%s_Initialise)(PluginsManager* pluginsManager, int * argc, char *** argv);\n'%n
+            reg_c += 'extern void (%s_Finalise)(PluginsManager* pluginsManager);\n'%n
     reg_c += '\n'
 
     reg_c += 'void stgfem_register_static_modules() {\n'
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/ProvidedSystems/AdvectionDiffusion/src/AdvectionDiffusionSLE.c
--- a/SLE/ProvidedSystems/AdvectionDiffusion/src/AdvectionDiffusionSLE.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/ProvidedSystems/AdvectionDiffusion/src/AdvectionDiffusionSLE.c	Wed May 11 13:27:34 2011 -0700
@@ -142,7 +142,7 @@ void _AdvectionDiffusionSLE_Init(
 		/* Create a specific name for the calcDt hook */
 		char* tmpName = Memory_Alloc_Array_Unnamed( char, strlen(self->name) + 7 + 1 );
 		sprintf( tmpName, "%s_CalcDt", self->name );
-		EntryPoint_AppendClassHook( self->context->calcDtEP, tmpName, AdvectionDiffusionSLE_CalculateDt, self->type, self );
+		EntryPoint_AppendClassHook( self->context->calcDtEP, tmpName, (void*)AdvectionDiffusionSLE_CalculateDt, self->type, self );
 		//EP_AppendClassHook( self->context->calcDtEP, AdvectionDiffusionSLE_CalculateDt, self );
 		Memory_Free( tmpName );
 	}
@@ -194,11 +194,11 @@ void _AdvectionDiffusionSLE_Print( void*
 }
 
 
-void* _AdvectionDiffusionSLE_Copy( void* _sle, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _AdvectionDiffusionSLE_Copy( const void* _sle, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	AdvectionDiffusionSLE*	self = (AdvectionDiffusionSLE*) _sle;
 	AdvectionDiffusionSLE*	newSLE;
 	
-	newSLE = _SystemLinearEquations_Copy( self, dest, deep, nameExt, ptrMap );
+	newSLE = (AdvectionDiffusionSLE*)_SystemLinearEquations_Copy( self, dest, deep, nameExt, ptrMap );
 	
 	/* TODO: Copy Method */
 	abort();
@@ -225,7 +225,7 @@ void* _AdvectionDiffusionSLE_DefaultNew(
 	SystemLinearEquations_MG_SelectStiffMatsFunc*        _mgSelectStiffMats = _SystemLinearEquations_MG_SelectStiffMats;
 
 	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType                                            nameAllocationType = ZERO;
+	AllocationType                                            nameAllocationType = (AllocationType)ZERO;
 	SystemLinearEquations_UpdateSolutionOntoNodesFunc*  _updateSolutionOntoNodes = ZERO;
 
 	return (void*) _AdvectionDiffusionSLE_New(  ADVECTIONDIFFUSIONSLE_PASSARGS  );
@@ -307,7 +307,7 @@ void _AdvectionDiffusionSLE_Build( void*
 		Stg_Component_Build( self->phiField->feMesh, NULL, False );
 
 		assert( Class_IsSuper( self->phiField->feMesh->topo, IGraph ) );
-		nodeDomainCountPtr = &((IGraph*)self->phiField->feMesh->topo)->remotes[MT_VERTEX]->nDomains;
+		nodeDomainCountPtr = (unsigned*)(&((IGraph*)self->phiField->feMesh->topo)->remotes[MT_VERTEX]->nDomains);
 
  		/* must create unique names otherwise multiple instances of this component
 		* will index incorrect instances of this component's data */
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/ProvidedSystems/AdvectionDiffusion/src/AdvectionDiffusionSLE.h
--- a/SLE/ProvidedSystems/AdvectionDiffusion/src/AdvectionDiffusionSLE.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/ProvidedSystems/AdvectionDiffusion/src/AdvectionDiffusionSLE.h	Wed May 11 13:27:34 2011 -0700
@@ -114,7 +114,7 @@
 
 	void _AdvectionDiffusionSLE_Print( void* sle, Stream* stream );
 
-	void* _AdvectionDiffusionSLE_Copy( void* sle, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _AdvectionDiffusionSLE_Copy( const void* sle, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 
 	/** Virtual Functions from "Stg_Component" Class */
 	void* _AdvectionDiffusionSLE_DefaultNew( Name name );
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/ProvidedSystems/AdvectionDiffusion/src/Residual.c
--- a/SLE/ProvidedSystems/AdvectionDiffusion/src/Residual.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/ProvidedSystems/AdvectionDiffusion/src/Residual.c	Wed May 11 13:27:34 2011 -0700
@@ -216,7 +216,7 @@ void _AdvDiffResidualForceTerm_AssignFro
 	Name														upwindParamFuncName;
 	double													defaultDiffusivity;
 	Materials_Register*		materials_Register;
-	AdvDiffResidualForceTerm_UpwindParamFuncType	upwindFuncType = 0;
+	AdvDiffResidualForceTerm_UpwindParamFuncType	upwindFuncType = (AdvDiffResidualForceTerm_UpwindParamFuncType)0;
         Swarm *picSwarm;
 
 	/* Construct Parent */
@@ -235,7 +235,7 @@ void _AdvDiffResidualForceTerm_AssignFro
 		Journal_Firewall( False, Journal_Register( Error_Type, (Name)self->type  ), "Cannot understand '%s'\n", upwindParamFuncName );
 
 	defaultDiffusivity = Stg_ComponentFactory_GetDouble( cf, self->name, (Dictionary_Entry_Key)"defaultDiffusivity", 1.0  );
-	picSwarm       = Stg_ComponentFactory_ConstructByName( cf, (Name)"picIntegrationPoints", IntegrationPointsSwarm, True, data  ) ;
+	picSwarm       = (Swarm*)Stg_ComponentFactory_ConstructByName( cf, (Name)"picIntegrationPoints", IntegrationPointsSwarm, True, data  ) ;
 	materials_Register = ((PICelleratorContext*)(self->context))->materials_Register;
 
 	_AdvDiffResidualForceTerm_Init( self, velocityField, defaultDiffusivity,
@@ -248,12 +248,12 @@ void _AdvDiffResidualForceTerm_Build( vo
 	AdvDiffResidualForceTerm_MaterialExt*   materialExt;
 	Material_Index                   material_I;
 	Material*                        material;
-	Materials_Register*              materials_Register = self->materials_Register;
+	Materials_Register*              materials_Register = (Materials_Register*)(self->materials_Register);
 	IntegrationPointsSwarm*          swarm              = (IntegrationPointsSwarm*)self->picSwarm;
 	MaterialPointsSwarm**            materialSwarms;
 	Index                            materialSwarm_I;
 	Stg_ComponentFactory*            cf;
-	Name                             name;
+	char*                            name;
 
 	cf = self->context->CF;
 
@@ -268,7 +268,7 @@ void _AdvDiffResidualForceTerm_Build( vo
 			sizeof(AdvDiffResidualForceTerm_MaterialExt) );
 	for ( material_I = 0 ; material_I < Materials_Register_GetCount( materials_Register ) ; material_I++) {
 		material = Materials_Register_GetByIndex( materials_Register, material_I );
-		materialExt = ExtensionManager_GetFunc( material->extensionMgr, material, self->materialExtHandle );
+		materialExt = (AdvDiffResidualForceTerm_MaterialExt*)ExtensionManager_GetFunc( material->extensionMgr, material, self->materialExtHandle );
 
 		materialExt->diffusivity = Stg_ComponentFactory_GetDouble( cf, material->name,
                                                                            (Dictionary_Entry_Key)"diffusivity",
@@ -277,7 +277,7 @@ void _AdvDiffResidualForceTerm_Build( vo
 	
 	/* Create Swarm Variables of each material swarm this ip swarm is mapped against */
 	materialSwarms = IntegrationPointMapper_GetMaterialPointsSwarms( swarm->mapper, &(self->materialSwarmCount) );
-	self->diffusivitySwarmVariables = Memory_Alloc_Array( MaterialSwarmVariable*, self->materialSwarmCount, "DiffusivityVariables" );
+	self->diffusivitySwarmVariables = (void**)Memory_Alloc_Array( MaterialSwarmVariable*, self->materialSwarmCount, "DiffusivityVariables" );
 	
 	for ( materialSwarm_I = 0; materialSwarm_I < self->materialSwarmCount; ++materialSwarm_I ) {
 		name = Stg_Object_AppendSuffix( materialSwarms[materialSwarm_I], (Name)"Diffusivity"  );
@@ -286,7 +286,7 @@ void _AdvDiffResidualForceTerm_Build( vo
 				(AbstractContext*)self->context,
 				materialSwarms[materialSwarm_I], 
 				1, 
-				self->materials_Register, 
+				(Materials_Register*)self->materials_Register, 
 				self->materialExtHandle, 
 				GetOffsetOfMember( *materialExt, diffusivity ) );
 		Memory_Free( name );
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/ProvidedSystems/AdvectionDiffusion/src/UpwindParameter.c
--- a/SLE/ProvidedSystems/AdvectionDiffusion/src/UpwindParameter.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/ProvidedSystems/AdvectionDiffusion/src/UpwindParameter.c	Wed May 11 13:27:34 2011 -0700
@@ -125,7 +125,7 @@ double AdvDiffResidualForceTerm_UpwindDi
 	incArray = self->incarray;
 	FeMesh_GetElementNodes( mesh, lElement_I, incArray );
 	nInc = IArray_GetSize( incArray );
-	inc = IArray_GetPtr( incArray );
+	inc = (unsigned*)IArray_GetPtr( incArray );
 	
 	
 	nodeIndex_LeastValues = inc[0];
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/ProvidedSystems/AdvectionDiffusion/tests/LumpedMassMatrixSuite.c
--- a/SLE/ProvidedSystems/AdvectionDiffusion/tests/LumpedMassMatrixSuite.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/ProvidedSystems/AdvectionDiffusion/tests/LumpedMassMatrixSuite.c	Wed May 11 13:27:34 2011 -0700
@@ -87,7 +87,7 @@ FeMesh* LumpedMassMatrixSuite_buildFeMes
 	FeMesh_SetElementFamily( feMesh, "linear" );
 
 	Mesh_SetTopologyDataSize( feMesh, MT_VERTEX, sizeof(Node) );
-	Mesh_SetTopologyDataSize( feMesh, nDims, sizeof(Element) );
+	Mesh_SetTopologyDataSize( feMesh, (MeshTopology_Dim)nDims, sizeof(Element) );
 
 	Stg_Component_Build( feMesh, NULL, False );
 	Stg_Component_Initialise( feMesh, NULL, False );
@@ -176,7 +176,7 @@ void LumpedMassMatrixSuite_TestLumpedMas
 	
 	feMesh = (FeMesh*) LumpedMassMatrixSuite_buildFeMesh( nDims, meshSize, minCrds, maxCrds, extensionMgr_Register, elementType_Register );
 	nDomainVerts = Mesh_GetDomainSize( feMesh, MT_VERTEX );
-	nodes = Mesh_GetTopologyData( feMesh, MT_VERTEX );
+	nodes = (Node*)Mesh_GetTopologyData( feMesh, MT_VERTEX );
 	
 	/* Create variable register */
 	variableRegister = Variable_Register_New();
@@ -197,7 +197,7 @@ void LumpedMassMatrixSuite_TestLumpedMas
 	/* Create Swarm */
 	if ( 3 == dim ) 
 		dimExists[K_AXIS] = True;
-	singleCellLayout= (CellLayout*)SingleCellLayout_New( "SingleCellLayout", (AbstractContext*)context, dimExists, NULL, NULL );
+	singleCellLayout= (CellLayout*)SingleCellLayout_New( "SingleCellLayout", (AbstractContext*)context, (Bool*)dimExists, NULL, NULL );
 	gaussParticleLayout = (ParticleLayout*)GaussParticleLayout_New( "GaussParticleLayout", NULL, LocalCoordSystem, True, dim, particlesPerDim );
 	swarm = Swarm_New( "gaussSwarm", (AbstractContext*)context, singleCellLayout, gaussParticleLayout,
 		dim, sizeof(IntegrationPoint), extensionMgr_Register, context->variable_Register, MPI_COMM_WORLD, NULL );
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/ProvidedSystems/Energy/src/Energy_SLE.c
--- a/SLE/ProvidedSystems/Energy/src/Energy_SLE.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/ProvidedSystems/Energy/src/Energy_SLE.c	Wed May 11 13:27:34 2011 -0700
@@ -69,7 +69,7 @@ Energy_SLE* Energy_SLE_New(
 	SolutionVector*			solutionVec,
 	ForceVector*				fVector )
 {
-	Energy_SLE* self = _Energy_SLE_DefaultNew( name );
+  Energy_SLE* self = (Energy_SLE*)_Energy_SLE_DefaultNew( name );
 
 	self->isConstructed = True;
 	_SystemLinearEquations_Init( self, solver, NULL, context, False, isNonLinear, nonLinearTolerance,
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/ProvidedSystems/Energy/src/Energy_SLE_Solver.c
--- a/SLE/ProvidedSystems/Energy/src/Energy_SLE_Solver.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/ProvidedSystems/Energy/src/Energy_SLE_Solver.c	Wed May 11 13:27:34 2011 -0700
@@ -140,11 +140,11 @@ void _Energy_SLE_Solver_Print( void* sol
 }
 
 
-void* _Energy_SLE_Solver_Copy( void* standardSleSolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _Energy_SLE_Solver_Copy( const void* standardSleSolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	Energy_SLE_Solver*	self = (Energy_SLE_Solver*)standardSleSolver;
 	Energy_SLE_Solver*	newEnergySleSolver;
 
-	newEnergySleSolver = _SLE_Solver_Copy( self, dest, deep, nameExt, ptrMap );
+	newEnergySleSolver = (Energy_SLE_Solver*)_SLE_Solver_Copy( self, dest, deep, nameExt, ptrMap );
 	
 	newEnergySleSolver->matrixSolver = self->matrixSolver;
 	
@@ -246,7 +246,7 @@ void _Energy_SLE_Solver_Solve( void* sle
 	KSPSolve( self->matrixSolver,
 		    ((ForceVector*) sle->forceVectors->data[0])->vector, 
 		    ((SolutionVector*) sle->solutionVectors->data[0])->vector );
-	KSPGetIterationNumber( self->matrixSolver, &iterations );
+	KSPGetIterationNumber( self->matrixSolver, (PetscInt*)(&iterations) );
 
 	Journal_DPrintf( self->debug, "Solved after %u iterations.\n", iterations );
 	Stream_UnIndentBranch( StgFEM_SLE_ProvidedSystems_Energy_Debug );
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/ProvidedSystems/Energy/src/Energy_SLE_Solver.h
--- a/SLE/ProvidedSystems/Energy/src/Energy_SLE_Solver.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/ProvidedSystems/Energy/src/Energy_SLE_Solver.h	Wed May 11 13:27:34 2011 -0700
@@ -109,7 +109,7 @@
 	#define Energy_SLE_Solver_DeepCopy( self ) \
 		(Energy_SLE_Solver*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
 	
-	void* _Energy_SLE_Solver_Copy( void* standardSleSolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _Energy_SLE_Solver_Copy( const void* standardSleSolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 
 	/* Stg_Component_Build() implementation */
 	void _Energy_SLE_Solver_Build( void* sleSolver, void* standardSLE );
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_PenaltySolver.c
--- a/SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_PenaltySolver.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_PenaltySolver.c	Wed May 11 13:27:34 2011 -0700
@@ -140,11 +140,11 @@ void _Stokes_SLE_PenaltySolver_Print( vo
 }
 
 
-void* _Stokes_SLE_PenaltySolver_Copy( void* stokesSlePenaltySolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _Stokes_SLE_PenaltySolver_Copy( const void* stokesSlePenaltySolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	Stokes_SLE_PenaltySolver* self = (Stokes_SLE_PenaltySolver*)stokesSlePenaltySolver;
 	Stokes_SLE_PenaltySolver*	newStokesSlePenaltySolver;
 	
-	newStokesSlePenaltySolver = _SLE_Solver_Copy( self, dest, deep, nameExt, ptrMap );
+	newStokesSlePenaltySolver = (Stokes_SLE_PenaltySolver*)_SLE_Solver_Copy( self, dest, deep, nameExt, ptrMap );
 	
 	return (void*) newStokesSlePenaltySolver;
 }
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_PenaltySolver.h
--- a/SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_PenaltySolver.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_PenaltySolver.h	Wed May 11 13:27:34 2011 -0700
@@ -110,7 +110,7 @@
 	#define Stokes_SLE_PenaltySolver_DeepCopy( self ) \
 		(SLE_Solver*)Class_DeepCopy( self, NULL, True, NULL, NULL )
 	
-	void* _Stokes_SLE_PenaltySolver_Copy( void* stokesSlePenaltySolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _Stokes_SLE_PenaltySolver_Copy( const void* stokesSlePenaltySolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 
 	/** Stg_Component_Build() implementations: allocates the 2 MatrixSolvers and additional Vectors */
 	void _Stokes_SLE_PenaltySolver_Build( void* solver, void* stokesSLE );
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_UzawaSolver.c
--- a/SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_UzawaSolver.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_UzawaSolver.c	Wed May 11 13:27:34 2011 -0700
@@ -92,7 +92,7 @@ Stokes_SLE_UzawaSolver* Stokes_SLE_Uzawa
 		Bool                                        useAbsoluteTolerance,
                 Bool                                        monitor )
 {		
-	Stokes_SLE_UzawaSolver* self = _Stokes_SLE_UzawaSolver_DefaultNew( name );
+  Stokes_SLE_UzawaSolver* self = (Stokes_SLE_UzawaSolver*)_Stokes_SLE_UzawaSolver_DefaultNew( name );
 
 	Stokes_SLE_UzawaSolver_InitAll( self, useStatSolve, statReps, preconditioner, maxUzawaIterations, minUzawaIterations, tolerance, useAbsoluteTolerance, monitor );
 
@@ -172,11 +172,11 @@ void _Stokes_SLE_UzawaSolver_Print( void
 }
 
 
-void* _Stokes_SLE_UzawaSolver_Copy( void* stokesSleUzawaSolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _Stokes_SLE_UzawaSolver_Copy( const void* stokesSleUzawaSolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	Stokes_SLE_UzawaSolver* self = (Stokes_SLE_UzawaSolver*)stokesSleUzawaSolver;
 	Stokes_SLE_UzawaSolver*	newStokesSleUzawaSolver;
 	
-	newStokesSleUzawaSolver = _SLE_Solver_Copy( self, dest, deep, nameExt, ptrMap );
+	newStokesSleUzawaSolver = (Stokes_SLE_UzawaSolver*)_SLE_Solver_Copy( self, dest, deep, nameExt, ptrMap );
 	
 	newStokesSleUzawaSolver->velSolver           = self->velSolver;
 	newStokesSleUzawaSolver->pcSolver            = self->pcSolver;
@@ -551,7 +551,7 @@ void _Stokes_SLE_UzawaSolver_Solve( void
 	
 	KSPSetTolerances( velSolver, self->tolerance, PETSC_DEFAULT, PETSC_DEFAULT, PETSC_DEFAULT );
 	KSPSolve( velSolver, fVec, vStarVec );
-	KSPGetIterationNumber( velSolver, &innerLoopIterations );
+	KSPGetIterationNumber( velSolver, (PetscInt*)(&innerLoopIterations) );
 	
 	Journal_DPrintfL( self->debug, 2, "Fhat inner solution: Number of iterations: %d\n", innerLoopIterations );
 	
@@ -731,7 +731,7 @@ void _Stokes_SLE_UzawaSolver_Solve( void
 		self->inneritsinitialtime = 0;
 		self->inneritsendtime = 0;
 		
-		KSPGetIterationNumber( velSolver, &innerLoopIterations );
+		KSPGetIterationNumber( velSolver, (PetscInt*)(&innerLoopIterations) );
 		/* add the inner loop iterations to the total inner iterations */
 		self->totalnuminnerits = self->totalnuminnerits + innerLoopIterations;
 		
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_UzawaSolver.h
--- a/SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_UzawaSolver.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_UzawaSolver.h	Wed May 11 13:27:34 2011 -0700
@@ -155,7 +155,7 @@
 	#define Stokes_SLE_UzawaSolver_DeepCopy( self ) \
 		(SLE_Solver*)Class_DeepCopy( self, NULL, True, NULL, NULL )
 	
-	void* _Stokes_SLE_UzawaSolver_Copy( void* stokesSleUzawaSolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _Stokes_SLE_UzawaSolver_Copy( const void* stokesSleUzawaSolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 
 	/** Stg_Component_Build() implementations: allocates the 2 MatrixSolvers and additional Vectors */
 	void _Stokes_SLE_UzawaSolver_Build( void* solver, void* stokesSLE );
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/Assembler.c
--- a/SLE/SystemSetup/src/Assembler.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/Assembler.c	Wed May 11 13:27:34 2011 -0700
@@ -264,13 +264,13 @@ void Assembler_LoopMatrixElement( void* 
 	rowDofs = rowVar->dofLayout;			assert( rowDofs );
 	colDofs = colVar->dofLayout;			assert( colDofs );
 	nDims = Mesh_GetDimSize( rowMesh );		assert( nDims );
-	Mesh_GetIncidence( rowMesh, nDims, element, MT_VERTEX, self->rowInc );
+	Mesh_GetIncidence( rowMesh, (MeshTopology_Dim)nDims, element, MT_VERTEX, self->rowInc );
 	nRowElNodes = IArray_GetSize( self->rowInc );
-	rowElNodes = IArray_GetPtr( self->rowInc );
+	rowElNodes = (unsigned*)IArray_GetPtr( self->rowInc );
 	Mesh_GetIncidence( colMesh, Mesh_GetDimSize( colMesh ), element, MT_VERTEX, 
 			   self->colInc );
 	nColElNodes = IArray_GetSize( self->colInc );
-	colElNodes = IArray_GetPtr( self->colInc );
+	colElNodes = (unsigned*)IArray_GetPtr( self->colInc );
 	assert( FeMesh_GetElementLocalSize( rowMesh ) == FeMesh_GetElementLocalSize( colMesh ) );
 	assert( nDims == Mesh_GetDimSize( colMesh ) );
 	assert( rowEqNum->locationMatrix );
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/EntryPoint.c
--- a/SLE/SystemSetup/src/EntryPoint.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/EntryPoint.c	Wed May 11 13:27:34 2011 -0700
@@ -58,7 +58,7 @@ const Type FeEntryPoint_Type = "FeEntryP
 const Type FeEntryPoint_Type = "FeEntryPoint";
 
 
-FeEntryPoint* FeEntryPoint_New( const Name name, unsigned int castType ) {
+FeEntryPoint* FeEntryPoint_New( Name name, unsigned int castType ) {
 	/* Variables set in this function */
 	SizeT                       _sizeOfSelf = sizeof(FeEntryPoint);
 	Type                               type = FeEntryPoint_Type;
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/FiniteElementContext.c
--- a/SLE/SystemSetup/src/FiniteElementContext.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/FiniteElementContext.c	Wed May 11 13:27:34 2011 -0700
@@ -75,7 +75,7 @@ FiniteElementContext* FiniteElementConte
 	MPI_Comm		communicator,
 	Dictionary*	dictionary )
 {
-	FiniteElementContext* self = FiniteElementContext_DefaultNew( name );
+  FiniteElementContext* self = (FiniteElementContext*)FiniteElementContext_DefaultNew( name );
 
 	self->isConstructed = True;
 	_AbstractContext_Init( (AbstractContext*) self );
@@ -140,39 +140,39 @@ void _FiniteElementContext_Init( FiniteE
 	EntryPoint_Prepend( 
 		Context_GetEntryPoint( self, AbstractContext_EP_Build ),
 		"_FiniteElementContext_Build", 
-		_FiniteElementContext_Build, 
+		(void*)_FiniteElementContext_Build, 
 		FiniteElementContext_Type );
 	EntryPoint_Prepend( 
 		Context_GetEntryPoint( self, AbstractContext_EP_Initialise ),
 		"_FiniteElementContext_Initialise", 
-		_FiniteElementContext_Initialise, 
+		(void*)_FiniteElementContext_Initialise, 
 		FiniteElementContext_Type );
 	EntryPoint_Append( 
 		Context_GetEntryPoint( self, AbstractContext_EP_Solve ),
 		"_FiniteElementContext_Solve", 
-		_FiniteElementContext_Solve, 
+		(void*)_FiniteElementContext_Solve, 
 		FiniteElementContext_Type );
 	EntryPoint_Append( 
 		Context_GetEntryPoint( self, AbstractContext_EP_Solve ),
 		"_FiniteElementContext_PostSolve", 
-		_FiniteElementContext_PostSolve, 
+		(void*)_FiniteElementContext_PostSolve, 
 		FiniteElementContext_Type );
 	EntryPoint_Append( 
 		Context_GetEntryPoint( self, AbstractContext_EP_Dt ),
 		"_FiniteElementContext_GetDt", 
-		_FiniteElementContext_GetDt, 
+		(void*)_FiniteElementContext_GetDt, 
 		FiniteElementContext_Type );
 
 	EntryPoint_Append(
 		Context_GetEntryPoint( self, AbstractContext_EP_Save ),
 		"_FiniteElementContext_SaveFeVariables",
-		_FiniteElementContext_SaveFeVariables,
+		(void*)_FiniteElementContext_SaveFeVariables,
 		FiniteElementContext_Type );
 
 	EntryPoint_Append(
 		Context_GetEntryPoint( self, AbstractContext_EP_DataSave ),
 		"_FiniteElementContext_SaveFeVariables",
-		_FiniteElementContext_SaveFeVariables,
+		(void*)_FiniteElementContext_SaveFeVariables,
 		FiniteElementContext_Type );
 	/* The FEM context needs to save gauss swarms so they can be re-loaded for restart later.
 	   This will automatically save material point swarms too if PICellerator is used.
@@ -180,19 +180,19 @@ void _FiniteElementContext_Init( FiniteE
 	EntryPoint_Append(
 		Context_GetEntryPoint( self, AbstractContext_EP_Save ),
 		"_FiniteElementContext_SaveSwarms",
-		_FiniteElementContext_SaveSwarms,
+		(void*)_FiniteElementContext_SaveSwarms,
 		FiniteElementContext_Type );
 
 	EntryPoint_Append(
 		Context_GetEntryPoint( self, AbstractContext_EP_Save ),
 		"_FiniteElementContext_SaveMesh",
-		_FiniteElementContext_SaveMesh,
+		(void*)_FiniteElementContext_SaveMesh,
 		FiniteElementContext_Type );
 
 	EntryPoint_Append(
 		Context_GetEntryPoint( self, AbstractContext_EP_DataSave ),
 		"_FiniteElementContext_SaveMesh",
-		_FiniteElementContext_SaveMesh,
+		(void*)_FiniteElementContext_SaveMesh,
 		FiniteElementContext_Type );
 }
 
@@ -691,7 +691,7 @@ void _FiniteElementContext_DumpMeshHDF5(
        
       /* Write vertex coords to file */   
       /* Create our output space and data objects. */
-      totalVerts = Mesh_GetGlobalSize( mesh, 0 );
+      totalVerts = Mesh_GetGlobalSize( mesh, (MeshTopology_Dim)0 );
       size[0] = (hsize_t)totalVerts;
       size[1] = (hsize_t)nDims;
       
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/ForceTerm.c
--- a/SLE/SystemSetup/src/ForceTerm.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/ForceTerm.c	Wed May 11 13:27:34 2011 -0700
@@ -151,7 +151,7 @@ void _ForceTerm_Print( void* forceTerm, 
 }
 
 
-void* _ForceTerm_Copy( void* forceTerm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _ForceTerm_Copy( const void* forceTerm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	ForceTerm*	self = (ForceTerm*)forceTerm;
 	ForceTerm*	newForceTerm;
 	PtrMap*		map = ptrMap;
@@ -162,7 +162,7 @@ void* _ForceTerm_Copy( void* forceTerm, 
 		ownMap = True;
 	}
 	
-	newForceTerm = _Stg_Component_Copy( self, dest, deep, nameExt, map );
+	newForceTerm = (ForceTerm*)_Stg_Component_Copy( self, dest, deep, nameExt, map );
 	
 	newForceTerm->extraInfo = self->extraInfo;
 	if( deep ) {
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/ForceTerm.h
--- a/SLE/SystemSetup/src/ForceTerm.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/ForceTerm.h	Wed May 11 13:27:34 2011 -0700
@@ -119,7 +119,7 @@
 	#define ForceTerm_DeepCopy( self ) \
 		(ForceTerm*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
 
-	void* _ForceTerm_Copy( void* forceTerm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _ForceTerm_Copy( const void* forceTerm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	/* 'Stg_Component' Virtual Functions */
 	void* _ForceTerm_DefaultNew( Name name );
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/ForceVector.c
--- a/SLE/SystemSetup/src/ForceVector.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/ForceVector.c	Wed May 11 13:27:34 2011 -0700
@@ -76,11 +76,11 @@ ForceVector* ForceVector_New(
 	void*							entryPoint_Register,
 	MPI_Comm						comm )		
 {
-	ForceVector* self = _ForceVector_DefaultNew( name );
+  ForceVector* self = (ForceVector*)_ForceVector_DefaultNew( name );
 
 	self->isConstructed = True;
 	_SolutionVector_Init( (SolutionVector*)self, context, comm, feVariable ); 
-	_ForceVector_Init( self, dim, entryPoint_Register );
+	_ForceVector_Init( self, dim, (EntryPoint_Register*)entryPoint_Register );
 
 	return self;
 }
@@ -125,7 +125,7 @@ void _ForceVector_Init( void* forceVecto
 	self->debug = Stream_RegisterChild( StgFEM_SLE_SystemSetup_Debug, self->type );
 	
 	/* Create Entry Point for assembleForceVector */
-	Stg_asprintf( &self->_assembleForceVectorEPName, "%s-%s", self->name, ForceVector_assembleForceVectorStr );
+	Stg_asprintf( (char**)(&self->_assembleForceVectorEPName), "%s-%s", self->name, ForceVector_assembleForceVectorStr );
 	self->assembleForceVector = FeEntryPoint_New( self->_assembleForceVectorEPName, FeEntryPoint_AssembleForceVector_CastType );
 	EntryPoint_Register_Add( self->entryPoint_Register, self->assembleForceVector );	
 
@@ -171,7 +171,7 @@ void _ForceVector_Print( void* forceVect
 }
 
 
-void* _ForceVector_Copy( void* forceVector, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _ForceVector_Copy( const void* forceVector, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	ForceVector*	self = (ForceVector*)forceVector;
 	ForceVector*	newForceVector;
 	PtrMap*		map = ptrMap;
@@ -182,7 +182,7 @@ void* _ForceVector_Copy( void* forceVect
 		ownMap = True;
 	}
 	
-	newForceVector = _SolutionVector_Copy( self, dest, deep, nameExt, map );
+	newForceVector = (ForceVector*)_SolutionVector_Copy( self, dest, deep, nameExt, map );
 	
 	/* TODO: copy vector? */
 	newForceVector->entryPoint_Register = self->entryPoint_Register;
@@ -194,9 +194,9 @@ void* _ForceVector_Copy( void* forceVect
 			if( nameExt ) {
 				unsigned	nameLen = strlen( self->_assembleForceVectorEPName );
 				
-				newForceVector->_assembleForceVectorEPName = Memory_Alloc_Bytes_Unnamed( nameLen + strlen( nameExt ) + 1, "FV->vecEPName" );
-				memcpy( newForceVector->_assembleForceVectorEPName, self->_assembleForceVectorEPName, nameLen );
-				strcpy( newForceVector->_assembleForceVectorEPName + nameLen, nameExt );
+				newForceVector->_assembleForceVectorEPName = (char*)Memory_Alloc_Bytes_Unnamed( nameLen + strlen( nameExt ) + 1, "FV->vecEPName" );
+				memcpy( (char*)(newForceVector->_assembleForceVectorEPName), self->_assembleForceVectorEPName, nameLen );
+				strcpy( (char*)(newForceVector->_assembleForceVectorEPName) + nameLen, nameExt );
 			}
 			else {
 				newForceVector->_assembleForceVectorEPName = StG_Strdup( self->_assembleForceVectorEPName );
@@ -233,7 +233,7 @@ void _ForceVector_AssignFromXML( void* f
 	entryPointRegister = (void*)self->context->entryPoint_Register;
 	assert( entryPointRegister  );
 	
-	_ForceVector_Init( self, dim, entryPointRegister );
+	_ForceVector_Init( self, dim, (EntryPoint_Register*)entryPointRegister );
 }
 
 void _ForceVector_Build( void* forceVector, void* data ) {
@@ -345,7 +345,7 @@ void ForceVector_PrintElementForceVector
 	incArray = IArray_New();
 	FeMesh_GetElementNodes( feMesh, element_lI, incArray );
 	nInc = IArray_GetSize( incArray );
-	inc = IArray_GetPtr( incArray );
+	inc = (unsigned*)IArray_GetPtr( incArray );
 	dofsPerNode = dofLayout->dofCounts[inc[0]];
 	nodesThisEl = nInc;
 
@@ -412,7 +412,7 @@ void ForceVector_GlobalAssembly_General(
 		
 			FeMesh_GetElementNodes( feVar->feMesh, element_lI, self->inc );
 			nInc = IArray_GetSize( self->inc );
-			inc = IArray_GetPtr( self->inc );
+			inc = (unsigned*)IArray_GetPtr( self->inc );
 			nodeCountCurrElement = nInc;
 			/* Get the local node ids */
 			nodeIdsInCurrElement = inc;
@@ -544,7 +544,7 @@ Bool ForceVector_BCAsm_RowR( void* force
 				       assm->rowNodeInd, 
 				       assm->rowDofInd );
 	//Vector_AddEntries( ((ForceVector*)forceVec)->vector, 1, &assm->rowEq, &bc );
-	VecSetValues( ((ForceVector*)forceVec)->vector, 1, &assm->rowEq, &bc, ADD_VALUES );
+	VecSetValues( ((ForceVector*)forceVec)->vector, 1, (PetscInt*)(&assm->rowEq), &bc, ADD_VALUES );
 	return True;
 }
 
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/ForceVector.h
--- a/SLE/SystemSetup/src/ForceVector.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/ForceVector.h	Wed May 11 13:27:34 2011 -0700
@@ -68,7 +68,7 @@
 		Dimension_Index			dim;  \
 		EntryPoint_Register*		entryPoint_Register;  \
 		FeEntryPoint*				assembleForceVector;  \
-		Name							_assembleForceVectorEPName;  \
+		char*							_assembleForceVectorEPName;  \
 		Stg_ObjectList*			forceTermList;  \
 		Stg_Component*				applicationDepExtraInfo; /**< Default is NULL: passed to elForceVec during assembly */\
 		Assembler*					bcAsm;  \
@@ -118,7 +118,7 @@
 	#define ForceVector_DeepCopy( self ) \
 		(ForceVector*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
 
-	void* _ForceVector_Copy( void* forceVector, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _ForceVector_Copy( const void* forceVector, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	/* 'Stg_Component' Virtual Functions */
 	void* _ForceVector_DefaultNew( Name name );
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/MGOpGenerator.c
--- a/SLE/SystemSetup/src/MGOpGenerator.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/MGOpGenerator.c	Wed May 11 13:27:34 2011 -0700
@@ -57,7 +57,7 @@ MGOpGenerator* _MGOpGenerator_New(  MGOP
 	self = (MGOpGenerator*)_Stg_Component_New(  STG_COMPONENT_PASSARGS  );
 
 	/* stuff previously housed in the MatrixSolver class */
-	self->solver = malloc( sizeof( MGSolver_PETScData ) );
+	self->solver = (MGSolver_PETScData*)malloc( sizeof( MGSolver_PETScData ) );
 	self->solver->ksp = PETSC_NULL;
 	self->solver->matrix = PETSC_NULL;
 	self->solver->inversion = PETSC_NULL;
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/MultigridSolver.c
--- a/SLE/SystemSetup/src/MultigridSolver.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/MultigridSolver.c	Wed May 11 13:27:34 2011 -0700
@@ -116,7 +116,7 @@ void _MultigridSolver_Init( MultigridSol
 	assert( self && Stg_CheckType( self, MultigridSolver ) );
 
 	/* these initialisations previously done in the MatrixSolver_Init func */
-	self->mgData = malloc( sizeof( MGSolver_PETScData ) );
+	self->mgData = (MGSolver_PETScData*)malloc( sizeof( MGSolver_PETScData ) );
 
 	self->mgData->comm = MPI_COMM_WORLD;
 	KSPCreate( MPI_COMM_WORLD, &self->mgData->ksp );
@@ -142,7 +142,7 @@ void _MultigridSolver_Init( MultigridSol
 	self->rnorm = 0.0;
 	self->useInitial = False;
 	//self->outerSolver = NULL;
-	self->outerSolver = malloc( sizeof( MGSolver_PETScData ) );
+	self->outerSolver = (MGSolver_PETScData*)malloc( sizeof( MGSolver_PETScData ) );
 	self->outerSolver->ksp = PETSC_NULL;
 	self->outerSolver->matrix = PETSC_NULL;
 	self->outerSolver->inversion = PETSC_NULL;
@@ -351,7 +351,7 @@ MGSolver_Status _GetSolveStatus( MGSolve
 		rnorm = _GetResidualNorm( mgData );
 		KSPGetIterationNumber( mgData->ksp, &curIt );
 		//PETScMatrixSolver_SetNormType( self, MultigridSolver_NormType_Preconditioned );
-		KSPSetNormType( mgData->ksp, MultigridSolver_NormType_Preconditioned );
+		KSPSetNormType( mgData->ksp, (KSPNormType)MultigridSolver_NormType_Preconditioned );
 		ec = KSPDefaultConverged( mgData->ksp, curIt, (PetscScalar)rnorm, &reason, PETSC_NULL );
 		CheckPETScError( ec );
 	}
@@ -360,7 +360,7 @@ MGSolver_Status _GetSolveStatus( MGSolve
 		CheckPETScError( ec );
 	}
 
-	return reason;
+	return (MGSolver_Status)reason;
 }
 
 /* end of functions formerly defined in the PETScMatrixSolver class */
@@ -414,8 +414,8 @@ void MultigridSolver_Setup( void* matrix
 	assert( self && Stg_CheckType( self, MultigridSolver ) );
 
 	//_MatrixSolver_Setup( self, rhs, solution );
-	self->mgData->curRHS = rhs;
-	self->mgData->curSolution = solution;
+	self->mgData->curRHS = (struct _p_Vec*)rhs;
+	self->mgData->curSolution = (struct _p_Vec*)solution;
 	self->mgData->expiredResidual = True;
 
 	/* Need to rebuild the operators? */
@@ -526,10 +526,10 @@ void MultigridSolver_SetLevels( void* ma
 		MultigridSolver_Level*	level = self->levels + l_i;
 
 		//level->downSolver = NULL;
-		level->downSolver = malloc( sizeof( MGSolver_PETScData ) );
+		level->downSolver = (MGSolver_PETScData*)malloc( sizeof( MGSolver_PETScData ) );
 		level->nDownIts = 1;
 		//level->upSolver = NULL;
-		level->upSolver = malloc( sizeof( MGSolver_PETScData ) );
+		level->upSolver = (MGSolver_PETScData*)malloc( sizeof( MGSolver_PETScData ) );
 		level->nUpIts = l_i ? 1 : 0;
 		level->nCycles = 1;
 
@@ -604,7 +604,7 @@ void MultigridSolver_SetLevelDownSolver(
 		if( level->downSolver->curSolution != PETSC_NULL ) VecDestroy( level->downSolver->curSolution );
 		free( level->downSolver );
 	}
-	level->downSolver = solver;
+	level->downSolver = (MGSolver_PETScData*)solver;
 	//if( solver )
 	//	Stg_Class_AddRef( solver );
 }
@@ -640,7 +640,7 @@ void MultigridSolver_SetLevelUpSolver( v
 		if( level->upSolver->curSolution != PETSC_NULL ) VecDestroy( level->upSolver->curSolution );
 		free( level->upSolver );
 	}
-	level->upSolver = solver;
+	level->upSolver = (MGSolver_PETScData*)solver;
 	//if( solver )
 	//	Stg_Class_AddRef( solver );
 }
@@ -1067,7 +1067,7 @@ void MultigridSolver_UpdateWorkVectors( 
 
 MGSolver_PETScData* MultigridSolver_CreateOuterSolver( MultigridSolver* self, Mat matrix ) {
 	//MatrixSolver*	outerSolver;
-	MGSolver_PETScData* 	outerSolver = malloc( sizeof(MGSolver_PETScData) );
+  MGSolver_PETScData* 	outerSolver = (MGSolver_PETScData*)malloc( sizeof(MGSolver_PETScData) );
 	PC			pc;
 
 	/*
@@ -1089,14 +1089,14 @@ MGSolver_PETScData* MultigridSolver_Crea
 	KSPSetOperators( outerSolver->ksp, matrix, matrix, DIFFERENT_NONZERO_PATTERN );
 	KSPSetTolerances( outerSolver->ksp, PETSC_DEFAULT, PETSC_DEFAULT, PETSC_DEFAULT, (PetscInt)3 );
 	KSPSetInitialGuessNonzero( outerSolver->ksp, (PetscTruth)True );
-	KSPSetNormType( outerSolver->ksp, MultigridSolver_NormType_Preconditioned );
+	KSPSetNormType( outerSolver->ksp, (KSPNormType)MultigridSolver_NormType_Preconditioned );
 
 	return outerSolver;
 }
 
 MGSolver_PETScData* MultigridSolver_CreateSmoother( MultigridSolver* self, Mat matrix ) {
 	//MatrixSolver*	smoother;
-	MGSolver_PETScData* smoother = malloc( sizeof( MGSolver_PETScData ) );
+  MGSolver_PETScData* smoother = (MGSolver_PETScData*)malloc( sizeof( MGSolver_PETScData ) );
 	//unsigned	nBlocks;
 	//KSP*		ksps;
 	PC		pc;
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/PETScMGSolver.c
--- a/SLE/SystemSetup/src/PETScMGSolver.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/PETScMGSolver.c	Wed May 11 13:27:34 2011 -0700
@@ -113,7 +113,7 @@ void _PETScMGSolver_Init( PETScMGSolver*
 void _PETScMGSolver_Init( PETScMGSolver* self ) {
 	assert( self && Stg_CheckType( self, PETScMGSolver ) );
 
-	self->mgData = malloc( sizeof( MGSolver_PETScData ) );
+	self->mgData = (MGSolver_PETScData*)malloc( sizeof( MGSolver_PETScData ) );
 
 	/* from the depreciated MatrixSolver_Init func */
 	self->mgData->comm = MPI_COMM_WORLD;
@@ -255,8 +255,8 @@ void PETScMGSolver_Setup( void* matrixSo
 	wallTime = MPI_Wtime();
 		
 	//_MatrixSolver_Setup( self, rhs, solution );
-	self->mgData->curRHS = rhs;
-	self->mgData->curSolution = solution;
+	self->mgData->curRHS = (struct _p_Vec*)rhs;
+	self->mgData->curSolution = (struct _p_Vec*)solution;
 	self->mgData->expiredResidual = True;
 
    	PetscPrintf( PETSC_COMM_WORLD, "_MatrixSolver_Setup %g\n", MPI_Wtime() - wallTime);
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/SLE_Solver.c
--- a/SLE/SystemSetup/src/SLE_Solver.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/SLE_Solver.c	Wed May 11 13:27:34 2011 -0700
@@ -118,7 +118,7 @@ void SLE_Solver_InitAll( void* sleSolver
 	_SLE_Solver_Init( (SLE_Solver*) sleSolver, useStatSolve, statReps );
 }
 
-void* _SLE_Solver_Copy( void* sleSolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _SLE_Solver_Copy( const void* sleSolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	SLE_Solver*		self = (SLE_Solver*)sleSolver;
 	SLE_Solver*		newSleSolver;
 	PtrMap*			map = ptrMap;
@@ -129,7 +129,7 @@ void* _SLE_Solver_Copy( void* sleSolver,
 		ownMap = True;
 	}
 	
-	newSleSolver = _Stg_Component_Copy( self, dest, deep, nameExt, map );
+	newSleSolver = (SLE_Solver*)_Stg_Component_Copy( self, dest, deep, nameExt, map );
 	
 	/* virtual functions */
 	newSleSolver->_solverSetup  = self->_solverSetup;
@@ -157,18 +157,18 @@ void* _SLE_Solver_Copy( void* sleSolver,
 	newSleSolver->previoustimestep = self->previoustimestep;
 	
 	if( deep ) {
-		if( (newSleSolver->debug = PtrMap_Find( map, self->debug )) == NULL ) {
-			newSleSolver->debug = Stg_Class_Copy( self->debug, NULL, deep, nameExt, map );
+          if( (newSleSolver->debug = (Stream*)PtrMap_Find( map, self->debug )) == NULL ) {
+			newSleSolver->debug = (Stream*)Stg_Class_Copy( self->debug, NULL, deep, nameExt, map );
 			PtrMap_Append( map, self->debug, newSleSolver->debug );
 		}
-		if( (newSleSolver->extensionManager = PtrMap_Find( map, self->extensionManager )) == NULL ) {
-			newSleSolver->extensionManager = Stg_Class_Copy( self->extensionManager, NULL, deep, nameExt, map );
+          if( (newSleSolver->extensionManager = (ExtensionManager*)PtrMap_Find( map, self->extensionManager )) == NULL ) {
+			newSleSolver->extensionManager = (ExtensionManager*)Stg_Class_Copy( self->extensionManager, NULL, deep, nameExt, map );
 			PtrMap_Append( map, self->extensionManager, newSleSolver->extensionManager );
 		}
 	}
 	else {
 		newSleSolver->debug = self->debug;
-		newSleSolver->extensionManager = Stg_Class_Copy( self->extensionManager, NULL, deep, nameExt, map );
+		newSleSolver->extensionManager = (ExtensionManager*)Stg_Class_Copy( self->extensionManager, NULL, deep, nameExt, map );
 	}
 	
 	if( ownMap ) {
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/SLE_Solver.h
--- a/SLE/SystemSetup/src/SLE_Solver.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/SLE_Solver.h	Wed May 11 13:27:34 2011 -0700
@@ -144,7 +144,7 @@
 	/* --- Virtual function implementations --- */
 	
 	/** Class Virtual Functions Implementations */
-	void* _SLE_Solver_Copy( void* sleSolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _SLE_Solver_Copy( const void* sleSolver, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 
 	void _SLE_Solver_Delete( void* sleSolver );
 
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/SROpGenerator.c
--- a/SLE/SystemSetup/src/SROpGenerator.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/SROpGenerator.c	Wed May 11 13:27:34 2011 -0700
@@ -494,8 +494,8 @@ void SROpGenerator_GenLevelOp( SROpGener
 	localCoord = AllocArray( double, nDims );
 
 	maxInc = 0;
-	for( e_i = 0; e_i < Mesh_GetDomainSize( cMesh, nDims ); e_i++ ) {
-		nInc = Mesh_GetIncidenceSize( cMesh, nDims, e_i, MT_VERTEX );
+	for( e_i = 0; e_i < Mesh_GetDomainSize( cMesh, (MeshTopology_Dim)nDims ); e_i++ ) {
+          nInc = Mesh_GetIncidenceSize( cMesh, (MeshTopology_Dim)nDims, e_i, MT_VERTEX );
 		if( nInc > maxInc )
 			maxInc = nInc;
 	}
@@ -520,15 +520,15 @@ void SROpGenerator_GenLevelOp( SROpGener
 			insist( Mesh_SearchElements( cMesh, Mesh_GetVertex( fMesh, n_i ), &ind ), == True );
 			FeMesh_CoordGlobalToLocal( cMesh, ind, Mesh_GetVertex( fMesh, n_i ), localCoord );
 			FeMesh_EvalBasis( cMesh, ind, localCoord, basis );
-			Mesh_GetIncidence( cMesh, nDims, ind, MT_VERTEX, incArray );
+			Mesh_GetIncidence( cMesh, (MeshTopology_Dim)nDims, ind, MT_VERTEX, incArray );
 			nInc = IArray_GetSize( incArray );
-			inc = IArray_GetPtr( incArray );
+			inc = (unsigned*)IArray_GetPtr( incArray );
 			for( inc_i = 0; inc_i < nInc; inc_i++ ) {
 				cTopNode = self->topMaps[level - 1][inc[inc_i]];
 				cEqNum = self->eqNums[level - 1][inc[inc_i]][dof_i];
 				if( cEqNum != (unsigned)-1 && !Num_Approx( basis[inc_i], 0.0 ) )
 					//Matrix_InsertEntries( P, 1, &fEqNum, 1, &cEqNum, basis + inc_i );
-					MatSetValues( P, 1, &fEqNum, 1, &cEqNum, basis + inc_i, INSERT_VALUES );
+                                  MatSetValues( P, 1, (PetscInt*)(&fEqNum), 1, (PetscInt*)(&cEqNum), basis + inc_i, INSERT_VALUES );
 			}
 		}
 	}
@@ -608,9 +608,9 @@ void SROpGenerator_CalcOpNonZeros( SROpG
 				}
 			}
 			else {
-				Mesh_GetIncidence( cMesh, dim, ind, MT_VERTEX, incArray );
+				Mesh_GetIncidence( cMesh, (MeshTopology_Dim)dim, ind, MT_VERTEX, incArray );
 				nInc = IArray_GetSize( incArray );
-				inc = IArray_GetPtr( incArray );
+				inc = (unsigned*)IArray_GetPtr( incArray );
 				for( inc_i = 0; inc_i < nInc; inc_i++ ) {
 					cTopNode = self->topMaps[level - 1][inc[inc_i]];
 					for( dof_j = 0; dof_j < dofLayout->dofCounts[cTopNode]; dof_j++ ) {
@@ -854,16 +854,16 @@ Mat SROpGenerator_SimpleFinestLevel( SRO
    offsGrid = Grid_New();
    Grid_SetNumDims( grid[0], nDims );
    Grid_SetNumDims( offsGrid, nDims );
-   Grid_SetSizes( grid[0], sideSizes[0] );
+   Grid_SetSizes( grid[0], (unsigned*)(sideSizes[0]) );
 
    /* Determine preallocation information */
    MatGetVecs( P, PETSC_NULL, &vec_d_nnz );
    VecDuplicate( vec_d_nnz, &vec_o_nnz );
 
    /* Loop over fine nodes. */
-   for( ii = 0; ii < Mesh_GetLocalSize( mesh, 0 ); ii++ ) {
-      nodeInd = Mesh_DomainToGlobal( mesh, 0, ii );
-      Grid_Lift( vertGrid, nodeInd, inds[1] );
+   for( ii = 0; ii < Mesh_GetLocalSize( mesh, (MeshTopology_Dim)0 ); ii++ ) {
+      nodeInd = Mesh_DomainToGlobal( mesh, (MeshTopology_Dim)0, ii );
+      Grid_Lift( vertGrid, nodeInd, (unsigned*)(inds[1]) );
 
       /* An odd grid index means we need to interpolate from surrounding
          coarse nodes in the current dimension. */
@@ -874,14 +874,14 @@ Mat SROpGenerator_SimpleFinestLevel( SRO
 
       /* 'Multiply' the offsets to build the set of nodes we need to
          interpolate from. */
-      Grid_SetSizes( offsGrid, nOffs );
+      Grid_SetSizes( offsGrid, (unsigned*)nOffs );
       for( jj = 0; jj < offsGrid->nPoints; jj++ ) {
-         Grid_Lift( offsGrid, jj, offsInds );
+         Grid_Lift( offsGrid, jj, (unsigned*)offsInds );
          for( kk = 0; kk < nDims; kk++ )
             inds[0][kk] = (inds[1][kk] >> 1) + offsInds[kk];
 
          /* Store the coarse global node number. */
-         nodes[jj] = Grid_Project( grid[0], inds[0] );
+         nodes[jj] = Grid_Project( grid[0], (unsigned*)(inds[0]) );
       }
 
       /* Insert this row into the operator matrix. */
@@ -968,12 +968,12 @@ Mat SROpGenerator_SimpleFinestLevel( SRO
    }
 
    /* Loop over fine nodes. */
-   for( ii = 0; ii < Mesh_GetLocalSize( mesh, 0 ); ii++ ) {
+   for( ii = 0; ii < Mesh_GetLocalSize( mesh, (MeshTopology_Dim)0 ); ii++ ) {
 //      if( ii%5000 == 0 ) {
 //        PetscPrintf( PETSC_COMM_WORLD, "Done %d of %d \n", ii, Mesh_GetLocalSize( mesh, 0 ) );
 //      }
-      nodeInd = Mesh_DomainToGlobal( mesh, 0, ii );
-      Grid_Lift( vertGrid, nodeInd, inds[1] );
+      nodeInd = Mesh_DomainToGlobal( mesh, (MeshTopology_Dim)0, ii );
+      Grid_Lift( vertGrid, nodeInd, (unsigned*)(inds[1]) );
 
       /* An odd grid index means we need to interpolate from surrounding
          coarse nodes in the current dimension. */
@@ -984,14 +984,14 @@ Mat SROpGenerator_SimpleFinestLevel( SRO
 
       /* 'Multiply' the offsets to build the set of nodes we need to
          interpolate from. */
-      Grid_SetSizes( offsGrid, nOffs );
+      Grid_SetSizes( offsGrid, (unsigned*)nOffs );
       for( jj = 0; jj < offsGrid->nPoints; jj++ ) {
-         Grid_Lift( offsGrid, jj, offsInds );
+         Grid_Lift( offsGrid, jj, (unsigned*)offsInds );
          for( kk = 0; kk < nDims; kk++ )
             inds[0][kk] = (inds[1][kk] >> 1) + offsInds[kk];
 
          /* Store the coarse global node number. */
-         nodes[jj] = Grid_Project( grid[0], inds[0] );
+         nodes[jj] = Grid_Project( grid[0], (unsigned*)(inds[0]) );
       }
 
       /* Insert this row into the operator matrix. */
@@ -1165,8 +1165,8 @@ Mat SROpGenerator_SimpleCoarserLevel( SR
    Grid_SetNumDims( grid[1], nDims );
    Grid_SetNumDims( grid[0], nDims );
    Grid_SetNumDims( offsGrid, nDims );
-   Grid_SetSizes( grid[1], sideSizes[1] );
-   Grid_SetSizes( grid[0], sideSizes[0] );
+   Grid_SetSizes( grid[1], (unsigned*)(sideSizes[1]) );
+   Grid_SetSizes( grid[0], (unsigned*)(sideSizes[0]) );
 
    /* Determine preallocation */
    MatGetVecs( P, PETSC_NULL, &vec_d_nnz );
@@ -1181,7 +1181,7 @@ Mat SROpGenerator_SimpleCoarserLevel( SR
       /* Convert the global equation number to the global node index. */
       nodeInd = ii / nDofsPerNode;
       rowDof = ii - nodeInd * nDofsPerNode;
-      Grid_Lift( grid[1], nodeInd, inds[1] );
+      Grid_Lift( grid[1], nodeInd, (unsigned*)(inds[1]) );
 
       /* An odd grid index means we need to interpolate from surrounding
          coarse nodes in the current dimension. */
@@ -1192,14 +1192,14 @@ Mat SROpGenerator_SimpleCoarserLevel( SR
 
       /* 'Multiply' the offsets to build the set of nodes we need to
          interpolate from. */
-      Grid_SetSizes( offsGrid, nOffs );
+      Grid_SetSizes( offsGrid, (unsigned*)(nOffs) );
       for( jj = 0; jj < offsGrid->nPoints; jj++ ) {
-         Grid_Lift( offsGrid, jj, offsInds );
+        Grid_Lift( offsGrid, jj, (unsigned*)(offsInds) );
          for( kk = 0; kk < nDims; kk++ )
             inds[0][kk] = (inds[1][kk] >> 1) + offsInds[kk];
 
          /* Store the coarse global node number. */
-         nodes[jj] = Grid_Project( grid[0], inds[0] );
+         nodes[jj] = Grid_Project( grid[0], (unsigned*)(inds[0]) );
       }
 
       /* Insert this row into the operator matrix. */
@@ -1273,7 +1273,7 @@ Mat SROpGenerator_SimpleCoarserLevel( SR
       /* Convert the global equation number to the global node index. */
       nodeInd = ii / nDofsPerNode;
       rowDof = ii - nodeInd * nDofsPerNode;
-      Grid_Lift( grid[1], nodeInd, inds[1] );
+      Grid_Lift( grid[1], nodeInd, (unsigned*)(inds[1]) );
 
       /* An odd grid index means we need to interpolate from surrounding
          coarse nodes in the current dimension. */
@@ -1284,14 +1284,14 @@ Mat SROpGenerator_SimpleCoarserLevel( SR
 
       /* 'Multiply' the offsets to build the set of nodes we need to
          interpolate from. */
-      Grid_SetSizes( offsGrid, nOffs );
+      Grid_SetSizes( offsGrid, (unsigned*)(nOffs) );
       for( jj = 0; jj < offsGrid->nPoints; jj++ ) {
-         Grid_Lift( offsGrid, jj, offsInds );
+        Grid_Lift( offsGrid, jj, (unsigned*)(offsInds) );
          for( kk = 0; kk < nDims; kk++ )
             inds[0][kk] = (inds[1][kk] >> 1) + offsInds[kk];
 
          /* Store the coarse global node number. */
-         nodes[jj] = Grid_Project( grid[0], inds[0] );
+         nodes[jj] = Grid_Project( grid[0], (unsigned*)(inds[0]) );
       }
 
       /* Insert this row into the operator matrix. */
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/SolutionVector.c
--- a/SLE/SystemSetup/src/SolutionVector.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/SolutionVector.c	Wed May 11 13:27:34 2011 -0700
@@ -73,7 +73,7 @@ void _SolutionVector_ShareValuesNotStore
 	double*					localSolnVecValues );
 
 SolutionVector* SolutionVector_New( Name name, FiniteElementContext* context, MPI_Comm comm, FeVariable* feVariable ) {
-	SolutionVector* self = _SolutionVector_DefaultNew( name );
+  SolutionVector* self = (SolutionVector*)_SolutionVector_DefaultNew( name );
 
 	self->isConstructed = True;
 	_SolutionVector_Init( self, context, comm, feVariable );
@@ -156,7 +156,7 @@ void _SolutionVector_Print( void* soluti
 }
 
 
-void* _SolutionVector_Copy( void* solutionVector, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _SolutionVector_Copy( const void* solutionVector, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	SolutionVector*	self = (SolutionVector*)solutionVector;
 	SolutionVector*	newSolutionVector;
 	PtrMap*		map = ptrMap;
@@ -167,7 +167,7 @@ void* _SolutionVector_Copy( void* soluti
 		ownMap = True;
 	}
 	
-	newSolutionVector = _Stg_Component_Copy( self, dest, deep, nameExt, map );
+	newSolutionVector = (SolutionVector*)_Stg_Component_Copy( self, dest, deep, nameExt, map );
 	
 	/* TODO: copy vector? */
 	newSolutionVector->vector = self->vector;
@@ -756,7 +756,7 @@ void SolutionVector_LoadCurrentFeVariabl
 			value = DofLayout_GetValueDouble( feVar->dofLayout, node_lI, dof_I );
 			insertionIndex = feVar->eqNum->destinationArray[node_lI][dof_I];
 			//Vector_InsertEntries( self->vector, 1, &insertionIndex, &value );
-			VecSetValues( self->vector, 1, &insertionIndex, &value, INSERT_VALUES );
+			VecSetValues( self->vector, 1, (PetscInt*)(&insertionIndex), &value, INSERT_VALUES );
 		}	
 	}
 
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/SolutionVector.h
--- a/SLE/SystemSetup/src/SolutionVector.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/SolutionVector.h	Wed May 11 13:27:34 2011 -0700
@@ -115,7 +115,7 @@
 	#define SolutionVector_DeepCopy( self ) \
 		(ForceVector*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
 	
-	void* _SolutionVector_Copy( void* solutionVector, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _SolutionVector_Copy( const void* solutionVector, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	void _SolutionVector_Build( void* solutionVector, void* data );
 	
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/StiffnessMatrix.c
--- a/SLE/SystemSetup/src/StiffnessMatrix.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/StiffnessMatrix.c	Wed May 11 13:27:34 2011 -0700
@@ -291,7 +291,7 @@ void _StiffnessMatrix_Print( void* stiff
 	Journal_Printf( stiffnessMatrixStream, "\tallowZeroElementContributions: %s\n", StG_BoolToStringMap[self->allowZeroElementContributions] );
 }
 
-void* _StiffnessMatrix_Copy( void* stiffnessMatrix, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _StiffnessMatrix_Copy( const void* stiffnessMatrix, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	StiffnessMatrix*	self = (StiffnessMatrix*)stiffnessMatrix;
 	StiffnessMatrix*	newStiffnessMatrix;
 	PtrMap*			map = ptrMap;
@@ -302,7 +302,7 @@ void* _StiffnessMatrix_Copy( void* stiff
 		ownMap = True;
 	}
 	
-	newStiffnessMatrix = _Stg_Component_Copy( self, dest, deep, nameExt, map );
+	newStiffnessMatrix = (StiffnessMatrix*)_Stg_Component_Copy( self, dest, deep, nameExt, map );
 	
 	/* Virtual functions */
 	newStiffnessMatrix->_calculateNonZeroEntries = self->_calculateNonZeroEntries;
@@ -340,7 +340,7 @@ void* _StiffnessMatrix_Copy( void* stiff
 		}
 		
 		/* Arrays */
-		if( (newStiffnessMatrix->diagonalNonZeroIndices = PtrMap_Find( map, self->diagonalNonZeroIndices )) == NULL ) {
+		if( (newStiffnessMatrix->diagonalNonZeroIndices = (Index*)PtrMap_Find( map, self->diagonalNonZeroIndices )) == NULL ) {
 			if( self->diagonalNonZeroIndices ) {
 				newStiffnessMatrix->diagonalNonZeroIndices = Memory_Alloc_Array( Index, 
 												 newStiffnessMatrix->rowLocalSize, "diagonalNonZeroIndices" );
@@ -353,7 +353,7 @@ void* _StiffnessMatrix_Copy( void* stiff
 			}
 		}
 		
-		if( (newStiffnessMatrix->offDiagonalNonZeroIndices = PtrMap_Find( map, self->offDiagonalNonZeroIndices )) == NULL ) {
+		if( (newStiffnessMatrix->offDiagonalNonZeroIndices = (Index*)PtrMap_Find( map, self->offDiagonalNonZeroIndices )) == NULL ) {
 			if( self->offDiagonalNonZeroIndices ) {
 				newStiffnessMatrix->offDiagonalNonZeroIndices = Memory_Alloc_Array( Index, 
 												    newStiffnessMatrix->rowLocalSize, "diagonalNonZeroIndices" );
@@ -658,7 +658,7 @@ void _StiffnessMatrix_CalcAndUpdateNonZe
 
 	FeMesh_GetNodeElements( rFeMesh, rowNode_lI, self->rowInc );
 	nNodeInc = IArray_GetSize( self->rowInc );
-	nodeInc = IArray_GetPtr( self->rowInc );
+	nodeInc = (unsigned*)IArray_GetPtr( self->rowInc );
 	for ( rowNodeElement_I = 0; rowNodeElement_I < nNodeInc; rowNodeElement_I++ ) {
 		unsigned	nElInc;
 
@@ -764,7 +764,7 @@ void _StiffnessMatrix_CalculatedListOfUn
 
 	FeMesh_GetNodeElements( rFeMesh, rowNode_lI, self->rowInc );
 	nNodeInc = IArray_GetSize( self->rowInc );
-	nodeInc = IArray_GetPtr( self->rowInc );
+	nodeInc = (unsigned*)IArray_GetPtr( self->rowInc );
 	Journal_DPrintfL( self->debug, 3, "Searching the %d elements this node belongs to for unique related col nodes:\n",
 			  nNodeInc );
 	
@@ -781,7 +781,7 @@ void _StiffnessMatrix_CalculatedListOfUn
 		Stream_Indent( self->debug );
 		FeMesh_GetElementNodes( cFeMesh, element_dI, self->colInc );
 		nElInc = IArray_GetSize( self->colInc );
-		elInc = IArray_GetPtr( self->colInc );
+		elInc = (unsigned*)IArray_GetPtr( self->colInc );
 		Journal_DPrintfL( self->debug, 3, "Searching the %d column var nodes in this el:\n", nElInc );
 		for ( colElLocalNode_I =0; colElLocalNode_I < nElInc; colElLocalNode_I++ ) {
 			colNode_dI = elInc[colElLocalNode_I];
@@ -944,7 +944,7 @@ void StiffnessMatrix_GlobalAssembly_Gene
 			FeMesh_GetElementNodes( feVars[feVar_I]->feMesh, element_lI, 
 						self->rowInc );
 			nodeCountThisEl = IArray_GetSize( self->rowInc );
-			nodeIdsThisEl = IArray_GetPtr( self->rowInc );
+			nodeIdsThisEl = (unsigned*)IArray_GetPtr( self->rowInc );
 
 			/* Set value of elementLM: will automatically use large one if built */
 			elementLM[feVar_I] = FeEquationNumber_BuildOneElementLocationMatrix( feEqNum, element_lI );
@@ -1015,7 +1015,7 @@ void StiffnessMatrix_GlobalAssembly_Gene
 				FeMesh_GetElementNodes( feVars[feVar_I]->feMesh, element_lI, 
 							self->rowInc );
 				nNodeInc = IArray_GetSize( self->rowInc );
-				nodeInc = IArray_GetPtr( self->rowInc );
+				nodeInc = (unsigned*)IArray_GetPtr( self->rowInc );
 				_StiffnessMatrix_UpdateBC_CorrectionTables(
 					self,
 					feVars[feVar_I]->eqNum, 
@@ -1132,8 +1132,8 @@ void StiffnessMatrix_GlobalAssembly_Gene
 
 		/* Add to the global matrix. */
 		matAddingStart = MPI_Wtime();
-		MatSetValues( matrix, *totalDofsThisElement[ROW_VAR], (Index *)(elementLM[ROW_VAR][0]), *totalDofsThisElement[COL_VAR], 
-				(Index *)(elementLM[COL_VAR][0]), elStiffMatToAdd[0], ADD_VALUES );
+		MatSetValues( matrix, *totalDofsThisElement[ROW_VAR], elementLM[ROW_VAR][0], *totalDofsThisElement[COL_VAR], 
+				elementLM[COL_VAR][0], elStiffMatToAdd[0], ADD_VALUES );
 		matAddingTime += MPI_Wtime() - matAddingStart;	
 		
 		
@@ -1195,8 +1195,8 @@ void StiffnessMatrix_GlobalAssembly_Gene
 					double	bcVal = DofLayout_GetValueDouble( dofLayout, node_i, dof_i );
 					double	one = 1.0;
 
-					VecSetValues( self->rhs->vector, 1, &eqInd, &bcVal, INSERT_VALUES );
-					MatSetValues( matrix, 1, &eqInd, 1, &eqInd, &one, INSERT_VALUES );
+					VecSetValues( self->rhs->vector, 1, (PetscInt*)(&eqInd), &bcVal, INSERT_VALUES );
+					MatSetValues( matrix, 1, (PetscInt*)(&eqInd), 1, (PetscInt*)(&eqInd), &one, INSERT_VALUES );
 				}
 			}
 		}
@@ -1336,8 +1336,8 @@ inline void StiffMatAssLog_AccumulateTim
 
 inline void StiffMatAssLog_GetOperatorDimensions( struct StiffMatAss_Log *log, Mat matrix )
 {
-	MatGetSize( matrix, (unsigned*)&log->nr, (unsigned*)&log->nc );
-	MatGetLocalSize( matrix, (unsigned*)&log->local_nr, (unsigned*)&log->local_nc );
+  MatGetSize( matrix, (PetscInt*)(&log->nr), (PetscInt*)(&log->nc) );
+  MatGetLocalSize( matrix, (PetscInt*)(&log->local_nr), (PetscInt*)(&log->local_nc) );
 }
 
 void StiffMatAssLog_Delete( struct StiffMatAss_Log** _log )
@@ -1499,10 +1499,10 @@ void _StiffMatAss( struct StiffMatAss_Lo
         for( e_i = 0; e_i < nRowEls; e_i++ ) {
                 FeMesh_GetElementNodes( rowMesh, e_i, self->rowInc );
                 nRowNodes = IArray_GetSize( self->rowInc );
-                rowNodes = IArray_GetPtr( self->rowInc );
+                rowNodes = (unsigned*)IArray_GetPtr( self->rowInc );
                 FeMesh_GetElementNodes( colMesh, e_i, self->colInc );
                 nColNodes = IArray_GetSize( self->colInc );
-                colNodes = IArray_GetPtr( self->colInc );
+                colNodes = (unsigned*)IArray_GetPtr( self->colInc );
 
                 /* Do we need more space to assemble this element? */
                 nRowDofs = 0;
@@ -1530,7 +1530,7 @@ void _StiffMatAss( struct StiffMatAss_Lo
                 /* Assemble the element. */
                 memset( elStiffMat[0], 0, nDofs * sizeof(double) );
                 StiffMatAssLog_InitTimer_ElementAssembly( log );
-		StiffnessMatrix_AssembleElement( self, e_i, sle, _context, elStiffMat );
+		StiffnessMatrix_AssembleElement( self, e_i, sle, (FiniteElementContext*)_context, elStiffMat );
 		StiffMatAssLog_AccumulateTime_ElementAssembly( log );
 
 
@@ -1541,8 +1541,8 @@ void _StiffMatAss( struct StiffMatAss_Lo
                 /* Add to stiffness matrix. */
 		StiffMatAssLog_InitTimer_ElementInsertion( log );
                 MatSetValues( matrix,
-                              nRowDofs, (unsigned*)rowEqNum->locationMatrix[e_i][0],
-                              nColDofs, (unsigned*)colEqNum->locationMatrix[e_i][0],
+                              nRowDofs, (PetscInt*)rowEqNum->locationMatrix[e_i][0],
+                              nColDofs, (PetscInt*)colEqNum->locationMatrix[e_i][0],
                               elStiffMat[0], INSERT_VALUES );
 
 		StiffMatAssLog_AccumulateTime_ElementInsertion( log ); /* update time */
@@ -1636,10 +1636,10 @@ void _StiffMatAss_vector_corrections(  s
         for( e_i = 0; e_i < nRowEls; e_i++ ) {
                 FeMesh_GetElementNodes( rowMesh, e_i, self->rowInc );
                 nRowNodes = IArray_GetSize( self->rowInc );
-                rowNodes = IArray_GetPtr( self->rowInc );
+                rowNodes = (unsigned*)IArray_GetPtr( self->rowInc );
                 FeMesh_GetElementNodes( colMesh, e_i, self->colInc );
                 nColNodes = IArray_GetSize( self->colInc );
-                colNodes = IArray_GetPtr( self->colInc );
+                colNodes = (unsigned*)IArray_GetPtr( self->colInc );
 
                 /* Do we need more space to assemble this element? */
                 nRowDofs = 0;
@@ -1696,7 +1696,7 @@ void _StiffMatAss_vector_corrections(  s
 		memset( elStiffMat[0], 0, nDofs * sizeof(double) );
 		StiffMatAssLog_InitTimer_ElementAssembly( log );
 		
-		StiffnessMatrix_AssembleElement( self, e_i, sle, _context, elStiffMat );
+		StiffnessMatrix_AssembleElement( self, e_i, sle, (FiniteElementContext*)_context, elStiffMat );
 		
 		StiffMatAssLog_AccumulateTime_ElementAssembly( log ); /* update time */
 		StiffMatAssLog_UpdateElementsAssembled( log ); /* update counter */
@@ -1711,7 +1711,7 @@ void _StiffMatAss_vector_corrections(  s
 			/* int I; */
 			memset( rhs, 0, maxRCDofs * sizeof(double) );
 
-			_get_bc_values( colVar, nColNodes, c_dof, colNodes, bcVals );
+			_get_bc_values( colVar, nColNodes, c_dof, (int*)colNodes, bcVals );
 			_make_dirichlet_corrections_to_rhs( n_rows, row_index_to_keep, n_cols, col_index_to_keep, elStiffMat, -1, bcVals, rhs );
 /*
 			printf("f: e = %d \n", e_i );
@@ -1720,7 +1720,7 @@ void _StiffMatAss_vector_corrections(  s
 				printf("  I=%d : %d -- bcval = %f : rhs = %f \n", I, rowEqNum->locationMatrix[e_i][0][I], bcVals[I], rhs[I] );
 			}
 */
-			VecSetValues( vector, nRowDofs, (unsigned*)rowEqNum->locationMatrix[e_i][0], rhs, ADD_VALUES );
+			VecSetValues( vector, nRowDofs, (PetscInt*)rowEqNum->locationMatrix[e_i][0], rhs, ADD_VALUES );
 			StiffMatAssLog_UpdateElementsAssembledForBC_Corrections( log );
 			bc_cnt++;
 		}
@@ -1843,10 +1843,10 @@ void _StiffMatAss_vector_corrections_fro
         for( e_i = 0; e_i < nRowEls; e_i++ ) {
                 FeMesh_GetElementNodes( rowMesh, e_i, self->rowInc );
                 nRowNodes = IArray_GetSize( self->rowInc );
-                rowNodes = IArray_GetPtr( self->rowInc );
+                rowNodes = (unsigned*)IArray_GetPtr( self->rowInc );
                 FeMesh_GetElementNodes( colMesh, e_i, self->colInc );
                 nColNodes = IArray_GetSize( self->colInc );
-                colNodes = IArray_GetPtr( self->colInc );
+                colNodes = (unsigned*)IArray_GetPtr( self->colInc );
 
                 /* Do we need more space to assemble this element? */
                 nRowDofs = 0;
@@ -1914,7 +1914,7 @@ void _StiffMatAss_vector_corrections_fro
 		/* Assemble the element stiffness matrix */	     
 		StiffMatAssLog_InitTimer_ElementAssembly( log );
 
-		StiffnessMatrix_AssembleElement( self, e_i, sle, _context, elStiffMat );
+		StiffnessMatrix_AssembleElement( self, e_i, sle, (FiniteElementContext*)_context, elStiffMat );
 
 		StiffMatAssLog_AccumulateTime_ElementAssembly( log );		
 		StiffMatAssLog_UpdateElementsAssembled( log );
@@ -1932,7 +1932,7 @@ void _StiffMatAss_vector_corrections_fro
 				bcVals[II] = rhs[II] = 0.0;
 			}
 			*/
-			_get_bc_values( rowVar, nRowNodes, r_dof, rowNodes, bcVals );
+			_get_bc_values( rowVar, nRowNodes, r_dof, (int*)rowNodes, bcVals );
 
 			_make_dirichlet_corrections_to_rhs_transpose( n_cols, col_index_to_keep, n_rows, row_index_to_keep, elStiffMat, -1, bcVals, rhs );
 /*
@@ -1942,7 +1942,7 @@ void _StiffMatAss_vector_corrections_fro
 			}
 */
 
-			VecSetValues( transVector, nColDofs, (unsigned*)colEqNum->locationMatrix[e_i][0], rhs, INSERT_VALUES );
+			VecSetValues( transVector, nColDofs, colEqNum->locationMatrix[e_i][0], rhs, INSERT_VALUES );
 			StiffMatAssLog_UpdateElementsAssembledForBC_Corrections( log );
 			bc_cnt++;
 		}
@@ -2006,15 +2006,15 @@ void StiffnessMatrix_NewAssemble( void* 
 	log = StiffMatAssLog_New();
 
 
-	_StiffMatAss( log, stiffnessMatrix, removeBCs, _sle, _context );
+	_StiffMatAss( log, stiffnessMatrix, removeBCs, _sle, (FiniteElementContext*)_context );
 	StiffMatAssLog_Report( self, log );
 
 	if( vector ) {
-		_StiffMatAss_vector_corrections( log, stiffnessMatrix, removeBCs, _sle, _context );
+		_StiffMatAss_vector_corrections( log, stiffnessMatrix, removeBCs, _sle, (FiniteElementContext*)_context );
 		StiffMatAssLog_Report( self, log );
 	}
 	if( transVector ) {
-		_StiffMatAss_vector_corrections_from_transpose( log, stiffnessMatrix, removeBCs, _sle, _context );
+		_StiffMatAss_vector_corrections_from_transpose( log, stiffnessMatrix, removeBCs, _sle, (FiniteElementContext*)_context );
 		StiffMatAssLog_Report( self, log );
 	}
 	//	__StiffnessMatrix_NewAssemble( stiffnessMatrix, removeBCs, _sle, _context );
@@ -2080,10 +2080,10 @@ void __StiffnessMatrix_NewAssemble( void
 	for( e_i = 0; e_i < nRowEls; e_i++ ) {
 		FeMesh_GetElementNodes( rowMesh, e_i, self->rowInc );
 		nRowNodes = IArray_GetSize( self->rowInc );
-		rowNodes = IArray_GetPtr( self->rowInc );
+		rowNodes = (unsigned*)IArray_GetPtr( self->rowInc );
 		FeMesh_GetElementNodes( colMesh, e_i, self->colInc );
 		nColNodes = IArray_GetSize( self->colInc );
-		colNodes = IArray_GetPtr( self->colInc );
+		colNodes = (unsigned*)IArray_GetPtr( self->colInc );
 
 		/* Do we need more space to assemble this element? */
 		nRowDofs = 0;
@@ -2106,7 +2106,7 @@ void __StiffnessMatrix_NewAssemble( void
 
 		/* Assemble the element. */
 		memset( elStiffMat[0], 0, nDofs * sizeof(double) );
-		StiffnessMatrix_AssembleElement( self, e_i, sle, _context, elStiffMat );
+		StiffnessMatrix_AssembleElement( self, e_i, sle, (FiniteElementContext*)_context, elStiffMat );
 
 		/* Correct for BCs providing I'm not keeping them in. */
 		if( vector && removeBCs ) {
@@ -2134,7 +2134,7 @@ void __StiffnessMatrix_NewAssemble( void
                         }
 
 			//Vector_AddEntries( vector, nRowDofs, (unsigned*)rowEqNum->locationMatrix[e_i][0], bcVals );
-			VecSetValues( vector, nRowDofs, (unsigned*)rowEqNum->locationMatrix[e_i][0], bcVals, ADD_VALUES );
+			VecSetValues( vector, nRowDofs, rowEqNum->locationMatrix[e_i][0], bcVals, ADD_VALUES );
 		}
 		if( transVector && removeBCs ) {
 			memset( bcVals, 0, nColDofs * sizeof(double) );
@@ -2160,7 +2160,7 @@ void __StiffnessMatrix_NewAssemble( void
                            }
                         }
 
-			VecSetValues( transVector, nColDofs, (unsigned*)colEqNum->locationMatrix[e_i][0], bcVals, ADD_VALUES );
+			VecSetValues( transVector, nColDofs, colEqNum->locationMatrix[e_i][0], bcVals, ADD_VALUES );
 		}
 
 		/* If keeping BCs in, zero corresponding entries in the element stiffness matrix. */
@@ -2190,8 +2190,8 @@ void __StiffnessMatrix_NewAssemble( void
 
 		/* Add to stiffness matrix. */
 		MatSetValues( matrix, 
-			      nRowDofs, (unsigned*)rowEqNum->locationMatrix[e_i][0], 
-			      nColDofs, (unsigned*)colEqNum->locationMatrix[e_i][0], 
+			      nRowDofs, rowEqNum->locationMatrix[e_i][0], 
+			      nColDofs, colEqNum->locationMatrix[e_i][0], 
 			      elStiffMat[0], ADD_VALUES );
 	}
 
@@ -2486,10 +2486,10 @@ void _StiffnessMatrix_CorrectForceVector
 		colDofs = colEqNum->dofLayout;
 		Mesh_GetIncidence( rowMesh, Mesh_GetDimSize( rowMesh ), elementInd, MT_VERTEX, self->rowInc );
 		nRowElNodes = IArray_GetSize( self->rowInc );
-		rowElNodes = IArray_GetPtr( self->rowInc );
+		rowElNodes = (unsigned*)IArray_GetPtr( self->rowInc );
 		Mesh_GetIncidence( colMesh, Mesh_GetDimSize( colMesh ), elementInd, MT_VERTEX, self->colInc );
 		nColElNodes = IArray_GetSize( self->colInc );
-		colElNodes = IArray_GetPtr( self->colInc );
+		colElNodes = (unsigned*)IArray_GetPtr( self->colInc );
 		nRowDofs = rowDofs->dofCounts[0];
 		nColDofs = colDofs->dofCounts[0];
 
@@ -2532,10 +2532,10 @@ void _StiffnessMatrix_CorrectForceVector
 		colDofs = colEqNum->dofLayout;
 		Mesh_GetIncidence( rowMesh, Mesh_GetDimSize( rowMesh ), elementInd, MT_VERTEX, self->rowInc );
 		nRowElNodes = IArray_GetSize( self->rowInc );
-		rowElNodes = IArray_GetPtr( self->rowInc );
+		rowElNodes = (unsigned*)IArray_GetPtr( self->rowInc );
 		Mesh_GetIncidence( colMesh, Mesh_GetDimSize( colMesh ), elementInd, MT_VERTEX, self->colInc );
 		nColElNodes = IArray_GetSize( self->colInc );
-		colElNodes = IArray_GetPtr( self->colInc );
+		colElNodes = (unsigned*)IArray_GetPtr( self->colInc );
 		nRowDofs = rowDofs->dofCounts[0];
 		nColDofs = colDofs->dofCounts[0];
 
@@ -2577,7 +2577,7 @@ void _StiffnessMatrix_CorrectForceVector
 	}
 #endif
 
-	VecSetValues( self->rhs->vector, *totalDofsThisElement[COL_VAR], (Index *)(elementLM[COL_VAR][0]), h2Add, ADD_VALUES );
+	VecSetValues( self->rhs->vector, *totalDofsThisElement[COL_VAR], elementLM[COL_VAR][0], h2Add, ADD_VALUES );
 	
 	/* assume that K is symetric, so corrections are made with KTrans.
 	   this allows us to use this func with G, when we want velocity
@@ -2638,10 +2638,10 @@ void _StiffnessMatrix_PrintElementStiffn
 
 	FeMesh_GetElementNodes( rFeMesh, element_lI, self->rowInc );
 	nRowElInc = IArray_GetSize( self->rowInc );
-	rowElInc = IArray_GetPtr( self->rowInc );
+	rowElInc = (unsigned*)IArray_GetPtr( self->rowInc );
 	FeMesh_GetElementNodes( cFeMesh, element_lI, self->colInc );
 	nColElInc = IArray_GetSize( self->colInc );
-	colElInc = IArray_GetPtr( self->colInc );
+	colElInc = (unsigned*)IArray_GetPtr( self->colInc );
 
 	rowDofsPerNode = self->rowVariable->dofLayout->dofCounts[rowElInc[0]];
 	colDofsPerNode = self->columnVariable->dofLayout->dofCounts[colElInc[0]];
@@ -2748,9 +2748,9 @@ void StiffnessMatrix_RefreshMatrix( Stif
 
 		if( self->diagonalNonZeroIndices || self->offDiagonalNonZeroIndices ) {
 			if( nProcs > 1 )
-				MatMPIAIJSetPreallocation( self->matrix, PETSC_NULL, self->diagonalNonZeroIndices, PETSC_NULL, self->offDiagonalNonZeroIndices );
+                          MatMPIAIJSetPreallocation( self->matrix, PETSC_NULL, (PetscInt*)(self->diagonalNonZeroIndices), PETSC_NULL, (PetscInt*)(self->offDiagonalNonZeroIndices) );
 			else
-				MatSeqAIJSetPreallocation( self->matrix, PETSC_NULL, self->diagonalNonZeroIndices );
+                          MatSeqAIJSetPreallocation( self->matrix, PETSC_NULL, (PetscInt*)(self->diagonalNonZeroIndices) );
 		}
 		else {
 			if( nProcs > 1 )
@@ -2845,8 +2845,8 @@ void StiffnessMatrix_CalcNonZeros( void*
 			}
       }
    }
-   self->diagonalNonZeroIndices = nDiagNonZeros;
-   self->offDiagonalNonZeroIndices = nOffDiagNonZeros;
+        self->diagonalNonZeroIndices = (Index*)nDiagNonZeros;
+   self->offDiagonalNonZeroIndices = (Index*)nOffDiagNonZeros;
 
    {
       int tmp;
@@ -2892,7 +2892,7 @@ Bool StiffnessMatrix_DiagBCsAsm_RowR( vo
 Bool StiffnessMatrix_DiagBCsAsm_RowR( void* stiffMat, Assembler* assm ) {
 	static const double	one = 1.0;
 
-	MatSetValues( ((StiffnessMatrix*)stiffMat)->matrix, 1, &assm->rowEq, 1, &assm->rowEq, (double*)&one, ADD_VALUES );
+	MatSetValues( ((StiffnessMatrix*)stiffMat)->matrix, 1, (PetscInt*)(&assm->rowEq), 1, (PetscInt*)(&assm->rowEq), (double*)&one, ADD_VALUES );
 
 	return True;
 }
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/StiffnessMatrix.h
--- a/SLE/SystemSetup/src/StiffnessMatrix.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/StiffnessMatrix.h	Wed May 11 13:27:34 2011 -0700
@@ -91,7 +91,7 @@
 		EntryPoint_Register*                              entryPoint_Register;            \
 		Stg_ObjectList*                                   stiffnessMatrixTermList;        \
 		FeEntryPoint*                                     assembleStiffnessMatrix;        \
-		Name                                              _assembleStiffnessMatrixEPName; \
+		char*                                              _assembleStiffnessMatrixEPName; \
 		MPI_Comm                                          comm;                           \
 		Index                                             rowLocalSize;                   \
 		Index                                             colLocalSize;                   \
@@ -193,7 +193,7 @@
 	#define StiffnessMatrix_DeepCopy( self ) \
 		(StiffnessMatrix*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
 	
-	void* _StiffnessMatrix_Copy( void* stiffnessMatrix, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _StiffnessMatrix_Copy( const void* stiffnessMatrix, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	/* Build */
 	void _StiffnessMatrix_Build( void* stiffnessMatrix, void* data );
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/StiffnessMatrixTerm.c
--- a/SLE/SystemSetup/src/StiffnessMatrixTerm.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/StiffnessMatrixTerm.c	Wed May 11 13:27:34 2011 -0700
@@ -140,7 +140,7 @@ void _StiffnessMatrixTerm_Print( void* s
 }
 
 
-void* _StiffnessMatrixTerm_Copy( void* stiffnessMatrixTerm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _StiffnessMatrixTerm_Copy( const void* stiffnessMatrixTerm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	StiffnessMatrixTerm*	self = (StiffnessMatrixTerm*)stiffnessMatrixTerm;
 	StiffnessMatrixTerm*	newStiffnessMatrixTerm;
 	PtrMap*		map = ptrMap;
@@ -151,7 +151,7 @@ void* _StiffnessMatrixTerm_Copy( void* s
 		ownMap = True;
 	}
 	
-	newStiffnessMatrixTerm = _Stg_Component_Copy( self, dest, deep, nameExt, map );
+	newStiffnessMatrixTerm = (StiffnessMatrixTerm*)_Stg_Component_Copy( self, dest, deep, nameExt, map );
 	
 	newStiffnessMatrixTerm->extraInfo = self->extraInfo;
 	if( deep ) {
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/StiffnessMatrixTerm.h
--- a/SLE/SystemSetup/src/StiffnessMatrixTerm.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/StiffnessMatrixTerm.h	Wed May 11 13:27:34 2011 -0700
@@ -113,7 +113,7 @@
 		(StiffnessMatrixTerm*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
 	#define StiffnessMatrixTerm_DeepCopy( self ) \
 		(StiffnessMatrixTerm*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
-	void* _StiffnessMatrixTerm_Copy( void* stiffnessMatrixTerm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _StiffnessMatrixTerm_Copy( const void* stiffnessMatrixTerm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	/* 'Stg_Component' Virtual Functions */
 	void* _StiffnessMatrixTerm_DefaultNew( Name name );
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/SystemLinearEquations.c
--- a/SLE/SystemSetup/src/SystemLinearEquations.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/SystemLinearEquations.c	Wed May 11 13:27:34 2011 -0700
@@ -67,7 +67,7 @@ SystemLinearEquations* SystemLinearEquat
 	EntryPoint_Register*		entryPoint_Register,
 	MPI_Comm						comm )
 {
-	SystemLinearEquations* self = _SystemLinearEquations_DefaultNew( name );
+  SystemLinearEquations* self = (SystemLinearEquations*)_SystemLinearEquations_DefaultNew( name );
 
 	self->isConstructed = True;
 	_SystemLinearEquations_Init(
@@ -204,14 +204,14 @@ void _SystemLinearEquations_Init(
 	self->executeEP = EntryPoint_New( self->executeEPName, EntryPoint_2VoidPtr_CastType );
 
 	/* Add default hooks to Execute E.P. */
-	EntryPoint_Append( self->executeEP, "BC_Setup", SystemLinearEquations_BC_Setup, self->type);
-	EntryPoint_Append( self->executeEP, "LM_Setup", SystemLinearEquations_LM_Setup, self->type);
-	EntryPoint_Append( self->executeEP, "IntegrationSetup", SystemLinearEquations_IntegrationSetup, self->type );
-	EntryPoint_Append( self->executeEP, "ZeroAllVectors", SystemLinearEquations_ZeroAllVectors, self->type);
-	EntryPoint_Append( self->executeEP, "MatrixSetup", SystemLinearEquations_MatrixSetup, self->type);
-	EntryPoint_Append( self->executeEP, "VectorSetup", SystemLinearEquations_VectorSetup, self->type);
-	EntryPoint_Append( self->executeEP, "ExecuteSolver", SystemLinearEquations_ExecuteSolver, self->type);
-	EntryPoint_Append( self->executeEP, "UpdateSolutionOntoNodes",SystemLinearEquations_UpdateSolutionOntoNodes,self->type);
+	EntryPoint_Append( self->executeEP, "BC_Setup", (void*)SystemLinearEquations_BC_Setup, self->type);
+	EntryPoint_Append( self->executeEP, "LM_Setup", (void*)SystemLinearEquations_LM_Setup, self->type);
+	EntryPoint_Append( self->executeEP, "IntegrationSetup", (void*)SystemLinearEquations_IntegrationSetup, self->type );
+	EntryPoint_Append( self->executeEP, "ZeroAllVectors", (void*)SystemLinearEquations_ZeroAllVectors, self->type);
+	EntryPoint_Append( self->executeEP, "MatrixSetup", (void*)SystemLinearEquations_MatrixSetup, self->type);
+	EntryPoint_Append( self->executeEP, "VectorSetup", (void*)SystemLinearEquations_VectorSetup, self->type);
+	EntryPoint_Append( self->executeEP, "ExecuteSolver", (void*)SystemLinearEquations_ExecuteSolver, self->type);
+	EntryPoint_Append( self->executeEP, "UpdateSolutionOntoNodes",(void*)SystemLinearEquations_UpdateSolutionOntoNodes,self->type);
 
 	/* Create Integration Setup EP */
 	Stg_asprintf( &self->integrationSetupEPName, "%s-integrationSetup", self->name );
@@ -257,7 +257,7 @@ void _SystemLinearEquations_Print( void*
 	Stg_Class_Print( self->solver, stream );
 }
 
-void* _SystemLinearEquations_Copy( void* sle, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+void* _SystemLinearEquations_Copy( const void* sle, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	SystemLinearEquations*	self = (SystemLinearEquations*)sle;
 	SystemLinearEquations*	newSLE;
 	PtrMap*			map = ptrMap;
@@ -268,7 +268,7 @@ void* _SystemLinearEquations_Copy( void*
 		ownMap = True;
 	}
 	
-	newSLE = _Stg_Component_Copy( sle, dest, deep, nameExt, map );
+	newSLE = (SystemLinearEquations*)_Stg_Component_Copy( sle, dest, deep, nameExt, map );
 	
 	/* Virtual methods */
 	newSLE->_LM_Setup = self->_LM_Setup;
@@ -284,8 +284,8 @@ void* _SystemLinearEquations_Copy( void*
 		newSLE->stiffnessMatrices = (StiffnessMatrixList*)Stg_Class_Copy( self->stiffnessMatrices, NULL, deep, nameExt, map );
 		newSLE->forceVectors = (ForceVectorList*)Stg_Class_Copy( self->forceVectors, NULL, deep, nameExt, map );
 		newSLE->solutionVectors = (SolutionVectorList*)Stg_Class_Copy( self->solutionVectors, NULL, deep, nameExt, map );
-		if( (newSLE->extensionManager = PtrMap_Find( map, self->extensionManager )) == NULL ) {
-			newSLE->extensionManager = Stg_Class_Copy( self->extensionManager, NULL, deep, nameExt, map );
+		if( (newSLE->extensionManager = (ExtensionManager*)PtrMap_Find( map, self->extensionManager )) == NULL ) {
+                  newSLE->extensionManager = (ExtensionManager*)Stg_Class_Copy( self->extensionManager, NULL, deep, nameExt, map );
 			PtrMap_Append( map, self->extensionManager, newSLE->extensionManager );
 		}
 	}
@@ -388,7 +388,7 @@ void _SystemLinearEquations_AssignFromXM
 		nonLinearMinIterations,
 		nonLinearSolutionType,
 		optionsPrefix,
-		entryPointRegister,
+		(EntryPoint_Register*)entryPointRegister,
 		MPI_COMM_WORLD );
 
 	VecCreate( self->comm, &self->X );
@@ -853,7 +853,7 @@ void SystemLinearEquations_NonLinearExec
 		}
 			
 		/* Check if residual is below tolerance */
-		converged = (residual < tolerance);
+		converged = (residual < tolerance) ? True : False;
 		
 		Journal_Printf(self->info,"Non linear solver - Residual %.8e; Tolerance %.4e%s%s - %6.6e (secs)\n\n", residual, tolerance, 
 			(converged) ? " - Converged" : " - Not converged",
@@ -918,27 +918,27 @@ void SystemLinearEquations_NonLinearExec
 
 }
 
-void SystemLinearEquations_AddNonLinearSetupEP( void* sle, const char* name, EntryPoint_2VoidPtr_Cast func ) {
+void SystemLinearEquations_AddNonLinearSetupEP( void* sle, Name name, EntryPoint_2VoidPtr_Cast func ) {
 	SystemLinearEquations* self = (SystemLinearEquations*)sle;
 
 	SystemLinearEquations_SetToNonLinear( self );
-	EntryPoint_Append( self->nlSetupEP, (char*)name, func, self->type );
+	EntryPoint_Append( self->nlSetupEP, (char*)name, (void*)func, self->type );
 }
 
-void SystemLinearEquations_AddPostNonLinearEP( void* sle, const char* name, EntryPoint_2VoidPtr_Cast func ) {
+void SystemLinearEquations_AddPostNonLinearEP( void* sle, Name name, EntryPoint_2VoidPtr_Cast func ) {
 	SystemLinearEquations* self = (SystemLinearEquations*)sle;
 
-	EntryPoint_Append( self->postNlEP, (char*)name, func, self->type );
+	EntryPoint_Append( self->postNlEP, (char*)name, (void*)func, self->type );
 }
 
 void SystemLinearEquations_AddNonLinearConvergedEP( void* sle,
-						    const char* name,
+						    Name name,
 						    EntryPoint_2VoidPtr_Cast func )
 {
 	SystemLinearEquations* self = (SystemLinearEquations*)sle;
 
 	SystemLinearEquations_SetToNonLinear( self );
-	EntryPoint_Append( self->nlConvergedEP, (char*)name, func, self->type );
+	EntryPoint_Append( self->nlConvergedEP, (char*)name, (void*)func, self->type );
 }
 
 /*
@@ -1275,11 +1275,11 @@ void SystemLinearEquations_PicardExecute
 
 ///////////////
 
-void SystemLinearEquations_AddNonLinearEP( void* sle, const char* name, EntryPoint_2VoidPtr_Cast func ) {
+void SystemLinearEquations_AddNonLinearEP( void* sle, Name name, EntryPoint_2VoidPtr_Cast func ) {
 	SystemLinearEquations* self = (SystemLinearEquations*)sle;
 
 	SystemLinearEquations_SetToNonLinear( self );
-	EntryPoint_Append( self->nlEP, (char*)name, func, self->type );
+	EntryPoint_Append( self->nlEP, (char*)name, (void*)func, self->type );
 }
 
 
@@ -1311,11 +1311,11 @@ void SystemLinearEquations_SetToNonLinea
 			context = self->context;
 
 			nonLinearInitHook = Hook_New( "NewtonInitialise", 
-						SystemLinearEquations_NewtonInitialise, self->name );
+						(void*)SystemLinearEquations_NewtonInitialise, self->name );
 			_EntryPoint_PrependHook_AlwaysFirst( Context_GetEntryPoint( context, AbstractContext_EP_Solve ), 
 								nonLinearInitHook );
 			nonLinearFinaliseHook = Hook_New( "NewtonFinalise",
-						SystemLinearEquations_NewtonFinalise, self->name );
+						(void*)SystemLinearEquations_NewtonFinalise, self->name );
 			_EntryPoint_AppendHook_AlwaysLast( Context_GetEntryPoint( context, AbstractContext_EP_Solve ), 
 						nonLinearFinaliseHook );
 			self->_execute = SystemLinearEquations_NewtonExecute;
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/src/SystemLinearEquations.h
--- a/SLE/SystemSetup/src/SystemLinearEquations.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/src/SystemLinearEquations.h	Wed May 11 13:27:34 2011 -0700
@@ -102,9 +102,9 @@
 		SolutionVectorList*											solutionVectors; \
 		SLE_Solver*														solver; \
 		FiniteElementContext*										context; \
-		Name																executeEPName; \
+		char*																executeEPName; \
 		EntryPoint*														executeEP; \
-		Name																integrationSetupEPName; \
+		char*																integrationSetupEPName; \
 		EntryPoint*														integrationSetupEP; \
 		EntryPoint_Register*											entryPoint_Register; \
 		\
@@ -153,9 +153,9 @@
 		SystemLinearEquations_SetFFunc*							_setFFunc; \
 		SystemLinearEquations_ConfigureNonlinearSolver*		_configureNLSolverFunc; \
 		SystemLinearEquations_SetFFunc*							_updateOldFields; \
-		Name																optionsPrefix; \
+		char*																optionsPrefix; \
 		/* parameter and methods relevant to PICARD */ \
-		Name																picard_form_function_type; \
+		char*																picard_form_function_type; \
 		double															alpha; \
 		double															rtol,ttol,xtol,abstol; \
 		Bool																picard_monitor; \
@@ -231,7 +231,7 @@
 	#define SystemLinearEquations_DeepCopy( self ) \
 		(SystemLinearEquations*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
 		
-	void* _SystemLinearEquations_Copy( void* sle, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void* _SystemLinearEquations_Copy( const void* sle, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	/* +++ Virtual Functions +++ */
 	void* _SystemLinearEquations_DefaultNew( Name name ) ;
@@ -330,11 +330,11 @@
 
 	void SystemLinearEquations_NonLinearExecute( void* sle, void* data );
 
-	void SystemLinearEquations_AddNonLinearSetupEP( void* sle, const char* name, EntryPoint_2VoidPtr_Cast func );
+	void SystemLinearEquations_AddNonLinearSetupEP( void* sle, Name name, EntryPoint_2VoidPtr_Cast func );
 
-	void SystemLinearEquations_AddNonLinearEP( void* sle, const char* name, EntryPoint_2VoidPtr_Cast func );
+	void SystemLinearEquations_AddNonLinearEP( void* sle, Name name, EntryPoint_2VoidPtr_Cast func );
 
-	void SystemLinearEquations_AddPostNonLinearEP( void* sle, const char* name, EntryPoint_2VoidPtr_Cast func );
+	void SystemLinearEquations_AddPostNonLinearEP( void* sle, Name name, EntryPoint_2VoidPtr_Cast func );
 
 	void SystemLinearEquations_SetToNonLinear( void* sle );
 
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/tests/SolutionVectorSuite.c
--- a/SLE/SystemSetup/tests/SolutionVectorSuite.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/tests/SolutionVectorSuite.c	Wed May 11 13:27:34 2011 -0700
@@ -94,7 +94,7 @@ FeVariable* SolutionVectorSuite_buildFeV
    feVar = FeVariable_New( "velocity", NULL, feMesh, NULL, dofs, bcs, NULL, NULL, 2, True, 
 		False, False, fieldReg );
 
-   for( n_i = 0; n_i < Mesh_GetLocalSize( feMesh, 0 ); n_i++ ) {
+   for( n_i = 0; n_i < Mesh_GetLocalSize( feMesh, (MeshTopology_Dim)0 ); n_i++ ) {
       /*const double pi=acos(-1.0);*/
       double* pos = Mesh_GetVertex( feMesh, n_i );
 
@@ -146,11 +146,11 @@ void SolutionVectorSuite_TestSolutionVec
 
 	mesh = feVar->feMesh;
 	nDims = Mesh_GetDimSize( mesh );
-	nEls = Mesh_GetDomainSize( mesh, nDims );
+	nEls = Mesh_GetDomainSize( mesh, (MeshTopology_Dim)nDims );
 	incArray = IArray_New();
 
 	for( e_i = 0; e_i < nEls; e_i++ ) {
-		Mesh_GetIncidence( mesh, nDims, e_i, 0, incArray );
+		Mesh_GetIncidence( mesh, (MeshTopology_Dim)nDims, e_i, (MeshTopology_Dim)0, incArray );
 		nVerts = IArray_GetSize( incArray );
 		verts = IArray_GetPtr( incArray );
 		for( v_i = 0; v_i < nVerts; v_i++ ) {
diff -r 980fabd2e8d6 -r 8917eb4bcedf SLE/SystemSetup/tests/StiffnessMatrixSuite.c
--- a/SLE/SystemSetup/tests/StiffnessMatrixSuite.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SLE/SystemSetup/tests/StiffnessMatrixSuite.c	Wed May 11 13:27:34 2011 -0700
@@ -92,7 +92,7 @@ FeVariable* buildFeVar() {
    feVar = FeVariable_New( "velocity", NULL, feMesh, NULL, dofs, bcs, NULL, NULL, 2, True, 
 		False, False, fieldReg );
 
-   for( n_i = 0; n_i < Mesh_GetLocalSize( feMesh, 0 ); n_i++ ) {
+   for( n_i = 0; n_i < Mesh_GetLocalSize( feMesh, (MeshTopology_Dim)0 ); n_i++ ) {
       /*const double pi=acos(-1.0);*/
       double* pos = Mesh_GetVertex( feMesh, n_i );
 
diff -r 980fabd2e8d6 -r 8917eb4bcedf SysTest/AnalyticPlugins/AdvDiffSteadyState1D/AdvDiffSteadyState1D.c
--- a/SysTest/AnalyticPlugins/AdvDiffSteadyState1D/AdvDiffSteadyState1D.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SysTest/AnalyticPlugins/AdvDiffSteadyState1D/AdvDiffSteadyState1D.c	Wed May 11 13:27:34 2011 -0700
@@ -82,7 +82,7 @@ void AdvDiffSteadyState1D_TemperatureBC(
 	mesh       = feVariable->feMesh;
 	coord      = Mesh_GetVertex( mesh, node_lI );
 
-	AdvDiffSteadyState1D_TemperatureFunction( self, coord, temperature );
+	AdvDiffSteadyState1D_TemperatureFunction( self, coord, (double*)temperature );
 }
 
 
diff -r 980fabd2e8d6 -r 8917eb4bcedf SysTest/AnalyticPlugins/LinearVelocityAnalytic/LinearVelocityAnalytic.c
--- a/SysTest/AnalyticPlugins/LinearVelocityAnalytic/LinearVelocityAnalytic.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/SysTest/AnalyticPlugins/LinearVelocityAnalytic/LinearVelocityAnalytic.c	Wed May 11 13:27:34 2011 -0700
@@ -90,16 +90,16 @@ void LinearVelocityAnalytic_GetCornerNod
 
 	/* Find global indicies of nodes */
 	self->cornerNodeCount = 4;
-	nodeMapper[0] = Grid_ProjectIJK_MinMax( vertGrid, 0, 0, 0 );
-	nodeMapper[1] = Grid_ProjectIJK_MinMax( vertGrid, 1, 0, 0 );
-	nodeMapper[2] = Grid_ProjectIJK_MinMax( vertGrid, 0, 1, 0 );
-	nodeMapper[3] = Grid_ProjectIJK_MinMax( vertGrid, 1, 1, 0 );
+	nodeMapper[0] = Grid_ProjectIJK_MinMax( vertGrid, False, False, False );
+	nodeMapper[1] = Grid_ProjectIJK_MinMax( vertGrid, True, False, False );
+	nodeMapper[2] = Grid_ProjectIJK_MinMax( vertGrid, False, True, False );
+	nodeMapper[3] = Grid_ProjectIJK_MinMax( vertGrid, True, True, False );
 	if ( dim == 3 ) {
 		self->cornerNodeCount = 8;
-		nodeMapper[4] = Grid_ProjectIJK_MinMax( vertGrid, 0, 0, 1 );
-		nodeMapper[5] = Grid_ProjectIJK_MinMax( vertGrid, 1, 0, 1 );
-		nodeMapper[6] = Grid_ProjectIJK_MinMax( vertGrid, 0, 1, 1 );
-		nodeMapper[7] = Grid_ProjectIJK_MinMax( vertGrid, 1, 1, 1 );
+		nodeMapper[4] = Grid_ProjectIJK_MinMax( vertGrid, False, False, True );
+		nodeMapper[5] = Grid_ProjectIJK_MinMax( vertGrid, True, False, True );
+		nodeMapper[6] = Grid_ProjectIJK_MinMax( vertGrid, False, True, True );
+		nodeMapper[7] = Grid_ProjectIJK_MinMax( vertGrid, True, True, True );
 	}
 
 	/* Loop over corner nodes */
diff -r 980fabd2e8d6 -r 8917eb4bcedf libStgFEM/src/Init.c
--- a/libStgFEM/src/Init.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/libStgFEM/src/Init.c	Wed May 11 13:27:34 2011 -0700
@@ -51,6 +51,7 @@
 
 /** Initialises the Linear Algebra package, then any init for this package
 such as streams etc */
+Bool StgFEM_StandardConditionFunctions_Init( int * argc, char ** argv[] );
 Bool StgFEM_Init( int* argc, char** argv[] ) {
 	/* This init function tells StGermain of all the component types, etc this module contributes. Because it can be linked at compile
 	   time or linked in by a toolbox at runtime, we need to make sure it isn't run twice (compiled in and loaded through a toolbox.*/
diff -r 980fabd2e8d6 -r 8917eb4bcedf libStgFEM/tests/LibStgFEMSuite.c
--- a/libStgFEM/tests/LibStgFEMSuite.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/libStgFEM/tests/LibStgFEMSuite.c	Wed May 11 13:27:34 2011 -0700
@@ -23,7 +23,7 @@ void LibStgFEMSuite_Teardown( LibStgFEMS
 
 void LibStgFEMSuite_DirectoryStGermain( LibStgFEMSuiteData* data ) {
     Stg_Object* testDirectoryStGermain;
-    testDirectoryStGermain = Stg_ObjectList_Get( Project_XMLSearchPaths, (Name)"StGermain" );
+    testDirectoryStGermain = (Stg_Object*)Stg_ObjectList_Get( Project_XMLSearchPaths, (Name)"StGermain" );
     pcu_check_true( testDirectoryStGermain != NULL );
 }
 
@@ -31,8 +31,8 @@ void LibStgFEMSuite_DirectoryStgFEM( Lib
     Stg_Object* testDirectoryStGermain;
     Stg_Object* testDirectoryStgFEM;
 
-    testDirectoryStGermain = Stg_ObjectList_Get( Project_XMLSearchPaths, (Name)"StGermain"  );
-    testDirectoryStgFEM= Stg_ObjectList_Get( Project_XMLSearchPaths, (Name)"StgFEM" );
+    testDirectoryStGermain = (Stg_Object*)Stg_ObjectList_Get( Project_XMLSearchPaths, (Name)"StGermain"  );
+    testDirectoryStgFEM= (Stg_Object*)Stg_ObjectList_Get( Project_XMLSearchPaths, (Name)"StgFEM" );
 
     pcu_check_true( ( strcmp((char* )LIB_DIR, (char*)testDirectoryStGermain) ) || ( testDirectoryStgFEM != NULL ) );
 }
diff -r 980fabd2e8d6 -r 8917eb4bcedf plugins/CompareFeVariableAgainstReferenceSolution/CompareFeVariableAgainstReferenceSolution.c
--- a/plugins/CompareFeVariableAgainstReferenceSolution/CompareFeVariableAgainstReferenceSolution.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/plugins/CompareFeVariableAgainstReferenceSolution/CompareFeVariableAgainstReferenceSolution.c	Wed May 11 13:27:34 2011 -0700
@@ -227,7 +227,7 @@ void CompareFeVariableAgainstReferenceSo
 		feVarToTest = (FeVariable*)Stg_ObjectList_At( self->variables, var_I );
 		tolerance = ((Stg_PrimitiveObject*)Stg_ObjectList_At( self->tolerances, var_I ))->value.asDouble;
 		relativeErrorMeasure = ((Stg_PrimitiveObject*)Stg_ObjectList_At( self->relativeErrorMeasure, var_I ))->value.asInt;
-		CompareFeVariableAgainstReferenceSolution_TestVariable( self, feVarToTest, tolerance, relativeErrorMeasure );
+		CompareFeVariableAgainstReferenceSolution_TestVariable( self, feVarToTest, tolerance, relativeErrorMeasure ? True : False );
 	}
 }
 
@@ -237,8 +237,8 @@ void CompareFeVariableAgainstReferenceSo
 	Variable_Register*       variable_Register;
 	Variable*                referenceDataVariable;
 	Variable*                roundedDataVariable;
-	Name                     referenceVariableName[9];
-	Name                     roundedVariableName[9];
+	char*                    referenceVariableName[9];
+	char*                    roundedVariableName[9];
 	Variable_Index           variable_I;
 	DofLayout*               referenceDofLayout;
 	DofLayout*               roundedDofLayout;
@@ -269,7 +269,7 @@ void CompareFeVariableAgainstReferenceSo
 	variable_Register = self->context->variable_Register;
 
 	componentsCount = feVarToTest->fieldComponentCount;
-	scalar = componentsCount == 1;
+	scalar = (componentsCount == 1) ? True : False;
 
 	/* Ok:- here, we know that the reference, or benchmark, FeVariable that we are
 	comparing against may have been rounded off already, and we don't want to give
@@ -310,7 +310,7 @@ void CompareFeVariableAgainstReferenceSo
 				self->context,
 				Variable_DataType_Double,
 				componentsCount,
-				&((IGraph*)feVarToTest->feMesh->topo)->remotes[MT_VERTEX]->nDomains, 
+				(Index*)(&((IGraph*)feVarToTest->feMesh->topo)->remotes[MT_VERTEX]->nDomains), 
 				NULL,
 				(void**)NULL,
 				variable_Register,
@@ -329,7 +329,7 @@ void CompareFeVariableAgainstReferenceSo
 				self->context,
 				Variable_DataType_Double,
 				componentsCount,
-				&((IGraph*)feVarToTest->feMesh->topo)->remotes[MT_VERTEX]->nDomains, 
+				(Index*)(&((IGraph*)feVarToTest->feMesh->topo)->remotes[MT_VERTEX]->nDomains), 
 				NULL,
 				(void**)NULL,
 				variable_Register,
diff -r 980fabd2e8d6 -r 8917eb4bcedf plugins/Document/Document.c
--- a/plugins/Document/Document.c	Wed Apr 13 14:07:16 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**	Melbourne, 3053, Australia.
-**
-** Primary Contributing Organisations:
-**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**	Monash Cluster Computing - http://www.mcc.monash.edu.au
-**	Computational Infrastructure for Geodynamics - http://www.geodynamics.org
-**
-** Contributors:
-**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** $Id: Document.c 964 2007-10-11 08:03:06Z SteveQuenette $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-
-void StgFEM_Document_Register( AbstractContext* context ) {
-	DocumentationComponentFactory* cf;
-	Stream* componentListStream;
-
-	/* Print list of all components */
-	componentListStream = Journal_Register( Info_Type, (Name)"componentList"  );
-	Stream_RedirectFile_WithPrependedPath( componentListStream, context->outputPath, "ComponentList.txt" );
-	Stg_ComponentRegister_PrintAllTypes( Stg_ComponentRegister_Get_ComponentRegister(), componentListStream );
-
-	/* Print info for one component */
-	cf = DocumentationComponentFactory_New( );
-	Stream_RedirectFile_WithPrependedPath( cf->infoStream, context->outputPath, "Documentation.txt" );
-	DocumentationComponentFactory_DocumentType( cf, Dictionary_GetString( context->dictionary, (Dictionary_Entry_Key)"documentType" ) );
-	
-	exit( EXIT_SUCCESS  );
-}
-
-
diff -r 980fabd2e8d6 -r 8917eb4bcedf plugins/FeVariableImportExporters/FeVariable_ImportExport_ABAQUS/FeVariable_ImportExport_ABAQUS.c
--- a/plugins/FeVariableImportExporters/FeVariable_ImportExport_ABAQUS/FeVariable_ImportExport_ABAQUS.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/plugins/FeVariableImportExporters/FeVariable_ImportExport_ABAQUS/FeVariable_ImportExport_ABAQUS.c	Wed May 11 13:27:34 2011 -0700
@@ -47,10 +47,10 @@
 #include <string.h>
 
 const Type   StgFEM_FeVariable_ImportExport_ABAQUS_Type = "StgFEM_FeVariable_ImportExport_ABAQUS";
-const char*  ABAQUS_ImportExportType = "ABAQUS";
+Name  ABAQUS_ImportExportType = "ABAQUS";
 
 
-void FeVariable_ReadNodalValuesFromFile_ABAQUS( void* _feVariable, const char* prefixStr, unsigned int timeStep ) {
+void FeVariable_ReadNodalValuesFromFile_ABAQUS( void* _feVariable, Name prefixStr, unsigned int timeStep ) {
 	FeVariable*        feVariable = (FeVariable*)_feVariable;
 	char*              filename;
 	Node_LocalIndex    lNode_I = 0;
@@ -98,7 +98,7 @@ void FeVariable_ReadNodalValuesFromFile_
 		}
 	}
 
-	if ( False == inputFile ) {
+	if ( NULL==inputFile ) {
 		Stream*    errorStr = Journal_Register( Error_Type, (Name)feVariable->type  );
 		Journal_Printf( errorStr, "Error- in %s(), for feVariable \"%s\": Couldn't find checkpoint file with "
 			"prefix \"%s\", timestep %d - thus full filename \"%s\" - aborting.\n", __func__, feVariable->name,
@@ -201,7 +201,7 @@ void FeVariable_ReadNodalValuesFromFile_
 }			
 
 
-void FeVariable_SaveNodalValuesToFile_ABAQUS( void* _feVariable, const char* prefixStr, unsigned int timeStep ) {
+void FeVariable_SaveNodalValuesToFile_ABAQUS( void* _feVariable, Name prefixStr, unsigned int timeStep ) {
 	FeVariable*      feVariable = (FeVariable*)_feVariable;
 	Stream*          errorStream = Journal_Register( Error_Type, (Name)StgFEM_FeVariable_ImportExport_ABAQUS_Type  );
 
diff -r 980fabd2e8d6 -r 8917eb4bcedf plugins/FeVariableImportExporters/FeVariable_ImportExport_SpecRidge2D/FeVariable_ImportExport_SpecRidge2D.c
--- a/plugins/FeVariableImportExporters/FeVariable_ImportExport_SpecRidge2D/FeVariable_ImportExport_SpecRidge2D.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/plugins/FeVariableImportExporters/FeVariable_ImportExport_SpecRidge2D/FeVariable_ImportExport_SpecRidge2D.c	Wed May 11 13:27:34 2011 -0700
@@ -47,10 +47,10 @@
 #include <string.h>
 
 const Type   StgFEM_FeVariable_ImportExport_SpecRidge2D_Type = "StgFEM_FeVariable_ImportExport_SpecRidge2D";
-const char*  SpecRidge2D_ImportExportType = "SpecRidge2D";
+Name  SpecRidge2D_ImportExportType = "SpecRidge2D";
 
 
-void FeVariable_ReadNodalValuesFromFile_SpecRidge2D( void* _feVariable, const char* prefixStr, unsigned int timeStep ) {
+void FeVariable_ReadNodalValuesFromFile_SpecRidge2D( void* _feVariable, Name prefixStr, unsigned int timeStep ) {
 	FeVariable*        feVariable = (FeVariable*)_feVariable;
 	char*              filename;
 	Node_LocalIndex    lNode_I = 0;
@@ -97,7 +97,7 @@ void FeVariable_ReadNodalValuesFromFile_
 		}
 	}
 
-	if ( False == inputFile ) {
+	if ( NULL == inputFile ) {
 		Stream*    errorStr = Journal_Register( Error_Type, (Name)feVariable->type  );
 		Journal_Printf( errorStr, "Error- in %s(), for feVariable \"%s\": Couldn't find checkpoint file with "
 			"prefix \"%s\", timestep %d - thus full filename \"%s\" - aborting.\n", __func__, feVariable->name,
@@ -204,7 +204,7 @@ void FeVariable_ReadNodalValuesFromFile_
 }			
 
 
-void FeVariable_SaveNodalValuesToFile_SpecRidge2D( void* _feVariable, const char* prefixStr, unsigned int timeStep ) {
+void FeVariable_SaveNodalValuesToFile_SpecRidge2D( void* _feVariable, Name prefixStr, unsigned int timeStep ) {
 	FeVariable*      feVariable = (FeVariable*)_feVariable;
 	Stream*          errorStream = Journal_Register( Error_Type, (Name)StgFEM_FeVariable_ImportExport_SpecRidge2D_Type  );
 
diff -r 980fabd2e8d6 -r 8917eb4bcedf plugins/Output/PrintFeVariableDiscreteValues/Plugin.c
--- a/plugins/Output/PrintFeVariableDiscreteValues/Plugin.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/plugins/Output/PrintFeVariableDiscreteValues/Plugin.c	Wed May 11 13:27:34 2011 -0700
@@ -50,7 +50,7 @@
 
 const Type StgFEM_PrintFeVariableDiscreteValues_Type = "StgFEM_PrintFeVariableDiscreteValues";
 
-const char* PRINT_FE_VARIABLE_DISCRETE_VALUES_TAG = "PrintFeVariableDiscreteValues";
+Name PRINT_FE_VARIABLE_DISCRETE_VALUES_TAG = "PrintFeVariableDiscreteValues";
 
 void _StgFEM_PrintFeVariableDiscreteValues_AssignFromXML( void* component, Stg_ComponentFactory* cf, void* data ) {
 	FiniteElementContext* context;
diff -r 980fabd2e8d6 -r 8917eb4bcedf plugins/Output/PrintFeVariableDiscreteValues/Plugin.h
--- a/plugins/Output/PrintFeVariableDiscreteValues/Plugin.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/plugins/Output/PrintFeVariableDiscreteValues/Plugin.h	Wed May 11 13:27:34 2011 -0700
@@ -57,7 +57,7 @@
 		__Codelet
 	} StgFEM_PrintFeVariableDiscreteValues;
 
-	extern const char* PRINT_FE_VARIABLE_DISCRETE_VALUES_TAG;
+	extern Name PRINT_FE_VARIABLE_DISCRETE_VALUES_TAG;
 	
 	Index _StgFEM_PrintFeVariableDiscreteValues_Register( PluginsManager* pluginsManager );
 	void PrintFeVariableDiscreteValues( void* _context );
diff -r 980fabd2e8d6 -r 8917eb4bcedf plugins/Output/PrintFeVariableDiscreteValues_2dBox/Plugin.c
--- a/plugins/Output/PrintFeVariableDiscreteValues_2dBox/Plugin.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/plugins/Output/PrintFeVariableDiscreteValues_2dBox/Plugin.c	Wed May 11 13:27:34 2011 -0700
@@ -50,7 +50,7 @@
 
 const Type StgFEM_PrintFeVariableDiscreteValues_2dBox_Type = "StgFEM_PrintFeVariableDiscreteValues_2dBox";
 
-const char* PRINT_FE_VARIABLE_DISCRETE_VALUES_2D_BOX_TAG = "PrintFeVariableDiscreteValues_2dBox";
+Name PRINT_FE_VARIABLE_DISCRETE_VALUES_2D_BOX_TAG = "PrintFeVariableDiscreteValues_2dBox";
 
 void _StgFEM_PrintFeVariableDiscreteValues_2dBox_AssignFromXML( void* component, Stg_ComponentFactory* cf, void* data ) {
 	FiniteElementContext* context;
diff -r 980fabd2e8d6 -r 8917eb4bcedf plugins/Output/PrintFeVariableDiscreteValues_2dBox/Plugin.h
--- a/plugins/Output/PrintFeVariableDiscreteValues_2dBox/Plugin.h	Wed Apr 13 14:07:16 2011 -0700
+++ b/plugins/Output/PrintFeVariableDiscreteValues_2dBox/Plugin.h	Wed May 11 13:27:34 2011 -0700
@@ -58,7 +58,7 @@
 		__Codelet
 	} StgFEM_PrintFeVariableDiscreteValues_2dBox;
 
-	extern const char* PRINT_FE_VARIABLE_DISCRETE_VALUES_2D_BOX_TAG;
+	extern Name PRINT_FE_VARIABLE_DISCRETE_VALUES_2D_BOX_TAG;
 	
 	Index StgFEM_PrintFeVariableDiscreteValues_2dBox_Register( PluginsManager* pluginsManager );
 	void PrintFeVariableDiscreteValues_2dBox( void* _context );
diff -r 980fabd2e8d6 -r 8917eb4bcedf plugins/StandardConditionFunctions/StandardConditionFunctions.c
--- a/plugins/StandardConditionFunctions/StandardConditionFunctions.c	Wed Apr 13 14:07:16 2011 -0700
+++ b/plugins/StandardConditionFunctions/StandardConditionFunctions.c	Wed May 11 13:27:34 2011 -0700
@@ -150,15 +150,15 @@ void _StgFEM_StandardConditionFunctions_
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_ERF,
-                                         (Name)"ERF");
+                                         (char*)"ERF");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_ERFC,
-                                         (Name)"ERFC");
+                                         (char*)"ERFC");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_RubberSheet,
-                                         (Name)"RubberSheet");
+                                         (char*)"RubberSheet");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 
 	condFunc = ConditionFunction_New( StgFEM_StandardConditionFunctions_MovingStepFunction, (Name)"MovingStepFunction");
@@ -216,42 +216,42 @@ void _StgFEM_StandardConditionFunctions_
         ConditionFunction_Register_Add( condFunc_Register, condFunc );
 
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_WarsTemperature,
-                                         (Name)"WarsTemperature");
+                                         (char*)"WarsTemperature");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_Quadratic,
-                                         (Name)"Quadratic");
+                                         (char*)"Quadratic");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_File1,
-                                         (Name)"File1");
+                                         (char*)"File1");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_File2,
-                                         (Name)"File2");
+                                         (char*)"File2");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_File3,
-                                         (Name)"File3");
+                                         (char*)"File3");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_File4,
-                                         (Name)"File4");
+                                         (char*)"File4");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_File5,
-                                         (Name)"File5");
+                                         (char*)"File5");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_File6,
-                                         (Name)"File6");
+                                         (char*)"File6");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_File7,
-                                         (Name)"File7");
+                                         (char*)"File7");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_File8,
-                                         (Name)"File8");
+                                         (char*)"File8");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_File9,
-                                         (Name)"File9");
+                                         (char*)"File9");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 	condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_File10,
-                                         (Name)"File10");
+                                         (char*)"File10");
 	ConditionFunction_Register_Add( condFunc_Register, condFunc );
 
 }



More information about the CIG-COMMITS mailing list