[cig-commits] commit: Update to Petsc 3.2

Mercurial hg at geodynamics.org
Thu Mar 15 12:51:56 PDT 2012


changeset:   827:2e5c9df86a89
tag:         tip
user:        Walter Landry <wlandry at caltech.edu>
date:        Thu Mar 15 12:51:23 2012 -0700
files:       Assembly/tests/IsoviscousStiffnessSuite.cxx Discretisation/src/Discretisation.h Discretisation/src/FeEquationNumber.cxx SLE/ProvidedSystems/AdvectionDiffusion/src/Multicorrector.cxx SLE/ProvidedSystems/AdvectionDiffusion/tests/LumpedMassMatrixSuite.cxx SLE/ProvidedSystems/Energy/src/Energy_SLE_Solver.cxx SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_PenaltySolver.cxx SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_UzawaSolver.cxx SLE/SystemSetup/src/MGOpGenerator.cxx SLE/SystemSetup/src/MultigridSolver.cxx SLE/SystemSetup/src/PETScMGSolver.cxx SLE/SystemSetup/src/SROpGenerator.cxx SLE/SystemSetup/src/SolutionVector.cxx SLE/SystemSetup/src/StiffnessMatrix.cxx SLE/SystemSetup/src/SystemLinearEquations.cxx
description:
Update to Petsc 3.2


diff -r 773cc6558f7f -r 2e5c9df86a89 Assembly/tests/IsoviscousStiffnessSuite.cxx
--- a/Assembly/tests/IsoviscousStiffnessSuite.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/Assembly/tests/IsoviscousStiffnessSuite.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -76,9 +76,12 @@ void IsoviscousStiffness2D( IsoviscousSt
 	Journal_Printf( infoStream, "Checking with file '%s'\n", filename );
 
 	pcu_filename_expected( filename, expected_file );
-	PetscViewerBinaryOpen( context->communicator, expected_file, FILE_MODE_READ, &expViewer );
+	PetscViewerBinaryOpen( context->communicator, expected_file, FILE_MODE_READ,
+                               &expViewer );
 
-	MatLoad( expViewer, MATAIJ, &expected );
+        MatCreate( context->communicator, &expected );
+        MatSetType( expected, MATAIJ );
+	MatLoad( expected, expViewer );
 
 	MatNorm( expected, NORM_FROBENIUS, &matrixNorm );
 	assert( matrixNorm != 0 );
diff -r 773cc6558f7f -r 2e5c9df86a89 Discretisation/src/Discretisation.h
--- a/Discretisation/src/Discretisation.h	Thu Mar 15 12:50:40 2012 -0700
+++ b/Discretisation/src/Discretisation.h	Thu Mar 15 12:51:23 2012 -0700
@@ -60,7 +60,7 @@
 	#include <petscvec.h>
 	#include <petscmat.h>
 	#include <petscksp.h>
-	#include <petscmg.h>
+	#include <petscpcmg.h>
 	#include <petscsnes.h>
 	#include "PETScErrorChecking.h"
 
diff -r 773cc6558f7f -r 2e5c9df86a89 Discretisation/src/FeEquationNumber.cxx
--- a/Discretisation/src/FeEquationNumber.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/Discretisation/src/FeEquationNumber.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -164,7 +164,7 @@ 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,
+	PetscBool	periodic_x, PetscBool periodic_y, PetscBool 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 );
@@ -2624,7 +2624,7 @@ 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,
+		PetscBool periodic_x, PetscBool periodic_y, PetscBool 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 );
@@ -2718,7 +2718,7 @@ void FeEquationNumber_BuildWithDave( FeE
       GenerateEquationNumbering( vGrid->sizes[0], vGrid->sizes[1], 1,
 				 nLocals, locals,
 				 nDofs, Mesh_GetGlobalSize( self->feMesh, (MeshTopology_Dim)0 ),
-				 (PetscTruth)periodic[0], (PetscTruth)periodic[1], (PetscTruth)False,
+				 (PetscBool)periodic[0], (PetscBool)periodic[1], (PetscBool)False,
 				 nPeriodicInds[0], nPeriodicInds[1], 0,
 				 periodicInds[0], periodicInds[1], NULL,
 				 dstArray[0], &nEqNums );
@@ -2727,7 +2727,7 @@ void FeEquationNumber_BuildWithDave( FeE
       GenerateEquationNumbering( vGrid->sizes[0], vGrid->sizes[1], vGrid->sizes[2],
 				 nLocals, locals,
 				 nDofs, Mesh_GetGlobalSize( self->feMesh, (MeshTopology_Dim)0 ),
-				 (PetscTruth)periodic[0], (PetscTruth)periodic[1], (PetscTruth)periodic[2],
+				 (PetscBool)periodic[0], (PetscBool)periodic[1], (PetscBool)periodic[2],
 				 nPeriodicInds[0], nPeriodicInds[1], nPeriodicInds[2],
 				 periodicInds[0], periodicInds[1], periodicInds[2],
 				 dstArray[0], &nEqNums );
@@ -2881,7 +2881,7 @@ 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,
+		PetscBool periodic_x, PetscBool periodic_y, PetscBool 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 )
@@ -2917,7 +2917,7 @@ int GenerateEquationNumbering(
 	ierr = MPI_Comm_size(PETSC_COMM_WORLD,&size);CHKERRQ(ierr);
 	
 	if( dof>=10 ) {
-		SETERRQ(PETSC_ERR_SUP, "Max allowable degrees of freedom per node = 10. Change static size" );
+          SETERRQ(PETSC_COMM_WORLD, PETSC_ERR_SUP, "Max allowable degrees of freedom per node = 10. Change static size" );
 	}
 	
 	
@@ -2970,7 +2970,8 @@ int GenerateEquationNumbering(
 	for( i=0; i<nlocal; i++ ) {
 		_g_node_id[i] = g_node_id[i]; 
 	}
-	ISCreateGeneralWithArray( PETSC_COMM_WORLD, nlocal, _g_node_id, &is_gnode );
+	ISCreateGeneral( PETSC_COMM_WORLD, nlocal, _g_node_id,
+                         PETSC_USE_POINTER, &is_gnode );
 	VecScatterCreate( g_ownership, is_gnode, local_ownership, PETSC_NULL, &vscat_ownership );
 	
 	
@@ -3006,7 +3007,7 @@ int GenerateEquationNumbering(
 	}
 	total = spanx*spany*spanz;
 	if( total!=global_eqnum_count ) {
-		SETERRQ(PETSC_ERR_SUP, "Something stinks. Computed global size for nodes does not match expected" );
+          SETERRQ(PETSC_COMM_WORLD, PETSC_ERR_SUP, "Something stinks. Computed global size for nodes does not match expected" );
 	}
 	
 	
@@ -3058,7 +3059,8 @@ int GenerateEquationNumbering(
 	VecSetSizes( local_eqnum, PETSC_DECIDE, number_to_fetch);
 	VecSetFromOptions( local_eqnum );
 	
-	ISCreateGeneralWithArray( PETSC_COMM_SELF, number_to_fetch, to_fetch, &is_eqnum );
+	ISCreateGeneral( PETSC_COMM_SELF, number_to_fetch, to_fetch,
+                         PETSC_USE_POINTER, &is_eqnum );
 	VecScatterCreate( global_eqnum, is_eqnum, local_eqnum, PETSC_NULL, &vscat_eqnum );
 	
 	VecSet( local_eqnum, -6699 );
@@ -3099,9 +3101,9 @@ int GenerateEquationNumbering(
 		offset = _seq_offset_list[ rank ];
 		VecRestoreArray( seq_offset_list, &_seq_offset_list );
 	}
-	VecScatterDestroy(vscat_offset);
-	VecDestroy(offset_list);
-	VecDestroy(seq_offset_list);
+	VecScatterDestroy(&vscat_offset);
+	VecDestroy(&offset_list);
+	VecDestroy(&seq_offset_list);
 	
 	/* PetscPrintf( PETSC_COMM_SELF, "[%d]: offset = %d \n", rank, offset ); */
 	
@@ -3157,7 +3159,8 @@ int GenerateEquationNumbering(
 		VecSetSizes( mapped, PETSC_DECIDE, npx*dof );
 		VecSetFromOptions( mapped );
 		
-		ISCreateGeneralWithArray( PETSC_COMM_SELF, npx*dof, from, &is_from );
+		ISCreateGeneral( PETSC_COMM_SELF, npx*dof, from,
+                                 PETSC_USE_POINTER, &is_from );
 		VecScatterCreate( global_eqnum, is_from, mapped, PETSC_NULL, &vscat_p );
 		
 		_VecScatterBeginEnd( vscat_p, global_eqnum, mapped, INSERT_VALUES, SCATTER_FORWARD );
@@ -3170,9 +3173,9 @@ int GenerateEquationNumbering(
 		VecAssemblyBegin(global_eqnum);
 		VecAssemblyEnd(global_eqnum);
 		
-		VecScatterDestroy( vscat_p );
-		ISDestroy( is_from );
-		VecDestroy( mapped );
+		VecScatterDestroy( &vscat_p );
+		ISDestroy( &is_from );
+		VecDestroy( &mapped );
 		PetscFree( from );
 		PetscFree( to );
 	}
@@ -3211,7 +3214,8 @@ int GenerateEquationNumbering(
 		VecSetSizes( mapped, PETSC_DECIDE, npy*dof );
 		VecSetFromOptions( mapped );
 		
-		ISCreateGeneralWithArray( PETSC_COMM_SELF, npy*dof, from, &is_from );
+		ISCreateGeneral( PETSC_COMM_SELF, npy*dof, from,
+                                 PETSC_USE_POINTER, &is_from );
 		VecScatterCreate( global_eqnum, is_from, mapped, PETSC_NULL, &vscat_p );
 		
 		_VecScatterBeginEnd( vscat_p, global_eqnum, mapped, INSERT_VALUES, SCATTER_FORWARD );
@@ -3224,9 +3228,9 @@ int GenerateEquationNumbering(
 		VecAssemblyBegin(global_eqnum);
 		VecAssemblyEnd(global_eqnum);
 		
-		VecScatterDestroy( vscat_p );
-		ISDestroy( is_from );
-		VecDestroy( mapped );
+		VecScatterDestroy( &vscat_p );
+		ISDestroy( &is_from );
+		VecDestroy( &mapped );
 		PetscFree( from );
 		PetscFree( to );
 	}
@@ -3264,7 +3268,8 @@ int GenerateEquationNumbering(
 		VecSetSizes( mapped, PETSC_DECIDE, npz*dof );
 		VecSetFromOptions( mapped );
 		
-		ISCreateGeneralWithArray( PETSC_COMM_SELF, npz*dof, from, &is_from );
+		ISCreateGeneral( PETSC_COMM_SELF, npz*dof, from,
+                                 PETSC_USE_POINTER, &is_from );
 		VecScatterCreate( global_eqnum, is_from, mapped, PETSC_NULL, &vscat_p );
 		
 		_VecScatterBeginEnd( vscat_p, global_eqnum, mapped, INSERT_VALUES, SCATTER_FORWARD );
@@ -3277,9 +3282,9 @@ int GenerateEquationNumbering(
 		VecAssemblyBegin(global_eqnum);
 		VecAssemblyEnd(global_eqnum);
 		
-		VecScatterDestroy( vscat_p );
-		ISDestroy( is_from );
-		VecDestroy( mapped );
+		VecScatterDestroy( &vscat_p );
+		ISDestroy( &is_from );
+		VecDestroy( &mapped );
 		PetscFree( from );
 		PetscFree( to );
 	}
@@ -3310,7 +3315,9 @@ int GenerateEquationNumbering(
 			}
 		}
 		
-		ISCreateGeneralWithArray( PETSC_COMM_SELF, nlocal*dof, all_my_eqnum_index, &is_all_my_eqnums );
+		ISCreateGeneral( PETSC_COMM_SELF, nlocal*dof,
+                                 all_my_eqnum_index, PETSC_USE_POINTER,
+                                 &is_all_my_eqnums );
 		VecCreate( PETSC_COMM_SELF, &all_my_eqnums );
 		VecSetSizes( all_my_eqnums, PETSC_DECIDE, nlocal*dof );
 		VecSetFromOptions( all_my_eqnums );
@@ -3323,9 +3330,9 @@ int GenerateEquationNumbering(
 		}
 		VecRestoreArray( all_my_eqnums, &_all_my_eqnums );
 		
-		VecScatterDestroy( vscat_p );
-		VecDestroy( all_my_eqnums );
-		ISDestroy( is_all_my_eqnums );
+		VecScatterDestroy( &vscat_p );
+		VecDestroy( &all_my_eqnums );
+		ISDestroy( &is_all_my_eqnums );
 		PetscFree( all_my_eqnum_index );
 	}
 	
@@ -3337,17 +3344,17 @@ int GenerateEquationNumbering(
 	VecRestoreArray( local_ownership, &_local_ownership );
 	
 	
-	VecDestroy( g_ownership );
-	VecDestroy( local_ownership );
+	VecDestroy( &g_ownership );
+	VecDestroy( &local_ownership );
 	PetscFree( _g_node_id );
-	ISDestroy( is_gnode );
-	VecScatterDestroy( vscat_ownership );
+	ISDestroy( &is_gnode );
+	VecScatterDestroy( &vscat_ownership );
 	
-	VecDestroy( global_eqnum );
-	VecDestroy( local_eqnum );
+	VecDestroy( &global_eqnum );
+	VecDestroy( &local_eqnum );
 	PetscFree( to_fetch );
-	ISDestroy( is_eqnum );
-	VecScatterDestroy( vscat_eqnum );
+	ISDestroy( &is_eqnum );
+	VecScatterDestroy( &vscat_eqnum );
 	
 	return 0;
 }
diff -r 773cc6558f7f -r 2e5c9df86a89 SLE/ProvidedSystems/AdvectionDiffusion/src/Multicorrector.cxx
--- a/SLE/ProvidedSystems/AdvectionDiffusion/src/Multicorrector.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/SLE/ProvidedSystems/AdvectionDiffusion/src/Multicorrector.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -103,7 +103,7 @@ void _AdvDiffMulticorrector_Delete(void*
   AdvDiffMulticorrector* self = (AdvDiffMulticorrector*)solver;
 
   //FreeObject(self->matrixSolver);
-  KSPDestroy(self->matrixSolver);
+  KSPDestroy(&self->matrixSolver);
 
   _SLE_Solver_Delete(self);
 }
@@ -259,7 +259,7 @@ void _AdvDiffMulticorrector_Solve(void* 
     }
   
   /* Clean Up */
-  VecDestroy(deltaPhiDot);
+  VecDestroy(&deltaPhiDot);
 }
 
 void ViewPETScVector(Vec vec, Stream* stream)
diff -r 773cc6558f7f -r 2e5c9df86a89 SLE/ProvidedSystems/AdvectionDiffusion/tests/LumpedMassMatrixSuite.cxx
--- a/SLE/ProvidedSystems/AdvectionDiffusion/tests/LumpedMassMatrixSuite.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/SLE/ProvidedSystems/AdvectionDiffusion/tests/LumpedMassMatrixSuite.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -138,7 +138,7 @@ void LumpedMassMatrixSuite_TestLumpedMas
 	ForceVector*					massMatrix;
 	Vec								expectedMatrix;
 	PetscViewer						viewer;
-	PetscTruth						flg;
+	PetscBool						flg;
 	LumpedMassMatrixForceTerm*	massMatrixForceTerm;
 	Particle_InCellIndex			particlesPerDim[] = {2,2,2};
 	char								expected_file[PCU_PATH_MAX];
@@ -231,12 +231,14 @@ void LumpedMassMatrixSuite_TestLumpedMas
 		ForceVector_Assemble( massMatrix );
 
 		PetscViewerCreate( MPI_COMM_WORLD, &viewer );
-		PetscViewerSetType( viewer, PETSC_VIEWER_BINARY );
+		PetscViewerSetType( viewer, PETSCVIEWERBINARY );
 
 		pcu_filename_expected( "testLumpedMassMatrix.expected", expected_file );
 		PetscViewerBinaryOpen( MPI_COMM_WORLD, expected_file, FILE_MODE_READ, &viewer );
 	
-		VecLoad( viewer, VECMPI, &expectedMatrix );	
+                VecCreate( MPI_COMM_WORLD, &expectedMatrix);
+                VecSetType( expectedMatrix, VECMPI );
+		VecLoad( expectedMatrix, viewer );	
 
 		/* Try out optimised one */
 		VecSet( massMatrix->vector, 0.0 );
diff -r 773cc6558f7f -r 2e5c9df86a89 SLE/ProvidedSystems/Energy/src/Energy_SLE_Solver.cxx
--- a/SLE/ProvidedSystems/Energy/src/Energy_SLE_Solver.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/SLE/ProvidedSystems/Energy/src/Energy_SLE_Solver.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -55,7 +55,7 @@
 /* Textual name of this class */
 const Type Energy_SLE_Solver_Type = "Energy_SLE_Solver";
 
-PetscTruth Energy_SLE_HasNullSpace( Mat A );
+PetscBool Energy_SLE_HasNullSpace( Mat A );
 
 void* Energy_SLE_Solver_DefaultNew( Name name ) {
 	/* Variables set in this function */
@@ -118,11 +118,11 @@ void _Energy_SLE_Solver_Delete( void* sl
 	Energy_SLE_Solver* self = (Energy_SLE_Solver*)sle;
 
 	//FreeObject( self->matrixSolver );
-	KSPDestroy( self->matrixSolver );
+	KSPDestroy( &self->matrixSolver );
 
 	if( self->residual != PETSC_NULL ) {
 		//FreeObject( self->residual );
-		VecDestroy( self->residual );
+		VecDestroy( &self->residual );
 	}
 }
 
@@ -217,7 +217,7 @@ void _Energy_SLE_Solver_Solve( void* sle
 	Energy_SLE_Solver*     self       = (Energy_SLE_Solver*)sleSolver;
 	SystemLinearEquations* sle        = (SystemLinearEquations*) standardSLE;
 	Iteration_Index        iterations;
-        PetscTruth isNull;
+        PetscBool isNull;
         MatNullSpace nsp;
 
 	
@@ -259,7 +259,7 @@ void _Energy_SLE_Solver_Solve( void* sle
 	VecAYPX( self->residual, -1.0, ((ForceVector**)sle->forceVectors->data)[0]->vector );
 
         if(isNull)
-            MatNullSpaceDestroy(nsp);
+            MatNullSpaceDestroy(&nsp);
 }
 
 
@@ -269,11 +269,11 @@ Vec _Energy_SLE_GetResidual( void* sleSo
 	return self->residual;
 }
 
-PetscTruth Energy_SLE_HasNullSpace( Mat A ) {
+PetscBool Energy_SLE_HasNullSpace( Mat A ) {
     PetscInt N;
     PetscScalar sum;
     PetscReal nrm;
-    PetscTruth isNull;
+    PetscBool isNull;
     Vec r, l;
 
     MatGetVecs(A, &r, &l); /* l = A r */
@@ -290,8 +290,8 @@ PetscTruth Energy_SLE_HasNullSpace( Mat 
     else
 	isNull = PETSC_FALSE;
 
-    VecDestroy(l);
-    VecDestroy(r);
+    VecDestroy(&l);
+    VecDestroy(&r);
 
     return isNull;
 }
diff -r 773cc6558f7f -r 2e5c9df86a89 SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_PenaltySolver.cxx
--- a/SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_PenaltySolver.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_PenaltySolver.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -286,12 +286,12 @@ void _Stokes_SLE_PenaltySolver_Solve( vo
 	VecAXPY( hVec, negOne, hTempVec );    /* hTemp = H - hTemp   : hTemp = H - Div v */
 	MatMult( C_InvMat, hTempVec, pVec );  /* p = CInv hTemp      : p = CInv ( H - Div v ) */
 	
-	if( kHat != PETSC_NULL )     MatDestroy( kHat );
-	if( fTempVec != PETSC_NULL ) VecDestroy( fTempVec );
-	if( hTempVec != PETSC_NULL ) VecDestroy( hTempVec );
-	if( diagC != PETSC_NULL )    VecDestroy( diagC );
-	if( sles_v != PETSC_NULL )   KSPDestroy( sles_v );
-	if( GTrans != PETSC_NULL )   MatDestroy( GTrans );
+	if( kHat != PETSC_NULL )     MatDestroy( &kHat );
+	if( fTempVec != PETSC_NULL ) VecDestroy( &fTempVec );
+	if( hTempVec != PETSC_NULL ) VecDestroy( &hTempVec );
+	if( diagC != PETSC_NULL )    VecDestroy( &diagC );
+	if( sles_v != PETSC_NULL )   KSPDestroy( &sles_v );
+	if( GTrans != PETSC_NULL )   MatDestroy( &GTrans );
 }
 
 
diff -r 773cc6558f7f -r 2e5c9df86a89 SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_UzawaSolver.cxx
--- a/SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_UzawaSolver.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/SLE/ProvidedSystems/StokesFlow/src/Stokes_SLE_UzawaSolver.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -217,11 +217,11 @@ void _Stokes_SLE_UzawaSolver_Build( void
 	else 
 		self->pcSolver = PETSC_NULL;
 
-	if( self->pTempVec != PETSC_NULL ) VecDestroy( self->pTempVec );
-	if( self->rVec != PETSC_NULL )     VecDestroy( self->rVec );
-	if( self->sVec != PETSC_NULL )     VecDestroy( self->sVec );
-	if( self->fTempVec != PETSC_NULL ) VecDestroy( self->fTempVec );
-	if( self->vStarVec != PETSC_NULL ) VecDestroy( self->vStarVec );
+	if( self->pTempVec != PETSC_NULL ) VecDestroy( &self->pTempVec );
+	if( self->rVec != PETSC_NULL )     VecDestroy( &self->rVec );
+	if( self->sVec != PETSC_NULL )     VecDestroy( &self->sVec );
+	if( self->fTempVec != PETSC_NULL ) VecDestroy( &self->fTempVec );
+	if( self->vStarVec != PETSC_NULL ) VecDestroy( &self->vStarVec );
 
  	Journal_DPrintfL( self->debug, 2, "Allocate the auxillary vectors pTemp, r, s, fTemp and vStar.\n" ); 
 	VecDuplicate( sle->pSolnVec->vector, &self->pTempVec );
@@ -272,15 +272,15 @@ void _Stokes_SLE_UzawaSolver_Destroy( vo
 
 	Stream_IndentBranch( StgFEM_Debug );
 	Journal_DPrintfL( self->debug, 2, "Destroying Solver contexts.\n" );
-	KSPDestroy( self->velSolver );
-	KSPDestroy( self->pcSolver );
+	KSPDestroy( &self->velSolver );
+	KSPDestroy( &self->pcSolver );
 
 	Journal_DPrintfL( self->debug, 2, "Destroying temporary solver vectors.\n" );
-	if( self->pTempVec != PETSC_NULL ) VecDestroy( self->pTempVec );
-	if( self->rVec != PETSC_NULL )     VecDestroy( self->rVec );
-	if( self->sVec != PETSC_NULL )     VecDestroy( self->sVec );
-	if( self->fTempVec != PETSC_NULL ) VecDestroy( self->fTempVec );
-	if( self->vStarVec != PETSC_NULL ) VecDestroy( self->vStarVec );
+	if( self->pTempVec != PETSC_NULL ) VecDestroy( &self->pTempVec );
+	if( self->rVec != PETSC_NULL )     VecDestroy( &self->rVec );
+	if( self->sVec != PETSC_NULL )     VecDestroy( &self->sVec );
+	if( self->fTempVec != PETSC_NULL ) VecDestroy( &self->fTempVec );
+	if( self->vStarVec != PETSC_NULL ) VecDestroy( &self->vStarVec );
 	Stream_UnIndentBranch( StgFEM_Debug );
    _SLE_Solver_Destroy( self, data );
 
diff -r 773cc6558f7f -r 2e5c9df86a89 SLE/SystemSetup/src/MGOpGenerator.cxx
--- a/SLE/SystemSetup/src/MGOpGenerator.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/SLE/SystemSetup/src/MGOpGenerator.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -97,11 +97,11 @@ void _MGOpGenerator_Delete( void* mgOpGe
 	/* this stuff was previously taken care of in the MatrixSolver class */
 	if( self->solver ) {
             /*if( self->solver->ksp != PETSC_NULL )         KSPDestroy( self->solver->ksp );*/
-		if( self->solver->matrix != PETSC_NULL )      MatDestroy( self->solver->matrix );
-		if( self->solver->inversion != PETSC_NULL )   MatDestroy( self->solver->inversion );
-		if( self->solver->residual != PETSC_NULL )    VecDestroy( self->solver->residual );
-		if( self->solver->curRHS != PETSC_NULL )      VecDestroy( self->solver->curRHS );
-		if( self->solver->curSolution != PETSC_NULL ) VecDestroy( self->solver->curSolution );
+		if( self->solver->matrix != PETSC_NULL )      MatDestroy( &self->solver->matrix );
+		if( self->solver->inversion != PETSC_NULL )   MatDestroy( &self->solver->inversion );
+		if( self->solver->residual != PETSC_NULL )    VecDestroy( &self->solver->residual );
+		if( self->solver->curRHS != PETSC_NULL )      VecDestroy( &self->solver->curRHS );
+		if( self->solver->curSolution != PETSC_NULL ) VecDestroy( &self->solver->curSolution );
 		free( self->solver );
 	}
 
@@ -120,8 +120,9 @@ void _MGOpGenerator_Print( void* mgOpGen
 }
 
 void _MGOpGenerator_AssignFromXML( void* mgOpGenerator, Stg_ComponentFactory* cf, void* data ) {
+#ifndef NDEBUG
 	MGOpGenerator*		self = (MGOpGenerator*)mgOpGenerator;
-
+#endif
 	assert( self && Stg_CheckType( self, MGOpGenerator ) );
 	assert( cf );
 }
diff -r 773cc6558f7f -r 2e5c9df86a89 SLE/SystemSetup/src/MultigridSolver.cxx
--- a/SLE/SystemSetup/src/MultigridSolver.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/SLE/SystemSetup/src/MultigridSolver.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -223,7 +223,7 @@ void MultigridSolver_SetComm( void* matr
 	self->mgData->comm = comm;
 
 	if( self->mgData->ksp != PETSC_NULL )
-		KSPDestroy( self->mgData->ksp );
+		KSPDestroy( &self->mgData->ksp );
 	KSPCreate( comm, &self->mgData->ksp );
 }
 
@@ -573,7 +573,7 @@ void MultigridSolver_SetProlongation( vo
 	//if( level->P )
 	//	Stg_Class_RemoveRef( level->P );
 	if( level->P != PETSC_NULL )
-		MatDestroy( level->P );
+		MatDestroy( &level->P );
 	level->P = P;
 	//if( P )
 	//	Stg_Class_AddRef( P );
@@ -592,12 +592,12 @@ void MultigridSolver_SetLevelDownSolver(
 		self->solversChanged = True;
 	if( level->downSolver ) {
 	//	Stg_Class_RemoveRef( level->downSolver );
-		if( level->downSolver->ksp != PETSC_NULL )         KSPDestroy( level->downSolver->ksp );
-		if( level->downSolver->matrix != PETSC_NULL )      MatDestroy( level->downSolver->matrix );
-		if( level->downSolver->inversion != PETSC_NULL )   MatDestroy( level->downSolver->inversion );
-		if( level->downSolver->residual != PETSC_NULL )    VecDestroy( level->downSolver->residual );
-		if( level->downSolver->curRHS != PETSC_NULL )      VecDestroy( level->downSolver->curRHS );
-		if( level->downSolver->curSolution != PETSC_NULL ) VecDestroy( level->downSolver->curSolution );
+		if( level->downSolver->ksp != PETSC_NULL )         KSPDestroy( &level->downSolver->ksp );
+		if( level->downSolver->matrix != PETSC_NULL )      MatDestroy( &level->downSolver->matrix );
+		if( level->downSolver->inversion != PETSC_NULL )   MatDestroy( &level->downSolver->inversion );
+		if( level->downSolver->residual != PETSC_NULL )    VecDestroy( &level->downSolver->residual );
+		if( level->downSolver->curRHS != PETSC_NULL )      VecDestroy( &level->downSolver->curRHS );
+		if( level->downSolver->curSolution != PETSC_NULL ) VecDestroy( &level->downSolver->curSolution );
 		free( level->downSolver );
 	}
 	level->downSolver = (MGSolver_PETScData*)solver;
@@ -628,12 +628,12 @@ void MultigridSolver_SetLevelUpSolver( v
 		self->solversChanged = True;
 	if( level->upSolver ) {
 	//	Stg_Class_RemoveRef( level->downSolver );
-		if( level->upSolver->ksp != PETSC_NULL )         KSPDestroy( level->upSolver->ksp );
-		if( level->upSolver->matrix != PETSC_NULL )      MatDestroy( level->upSolver->matrix );
-		if( level->upSolver->inversion != PETSC_NULL )   MatDestroy( level->upSolver->inversion );
-		if( level->upSolver->residual != PETSC_NULL )    VecDestroy( level->upSolver->residual );
-		if( level->upSolver->curRHS != PETSC_NULL )      VecDestroy( level->upSolver->curRHS );
-		if( level->upSolver->curSolution != PETSC_NULL ) VecDestroy( level->upSolver->curSolution );
+		if( level->upSolver->ksp != PETSC_NULL )         KSPDestroy( &level->upSolver->ksp );
+		if( level->upSolver->matrix != PETSC_NULL )      MatDestroy( &level->upSolver->matrix );
+		if( level->upSolver->inversion != PETSC_NULL )   MatDestroy( &level->upSolver->inversion );
+		if( level->upSolver->residual != PETSC_NULL )    VecDestroy( &level->upSolver->residual );
+		if( level->upSolver->curRHS != PETSC_NULL )      VecDestroy( &level->upSolver->curRHS );
+		if( level->upSolver->curSolution != PETSC_NULL ) VecDestroy( &level->upSolver->curSolution );
 		free( level->upSolver );
 	}
 	level->upSolver = (MGSolver_PETScData*)solver;
@@ -871,12 +871,12 @@ void MultigridSolver_UpdateSolvers( Mult
 
 			if( l_i == self->nLevels - 1 )
 				//MatrixSolver_SetUseInitialSolution( level->downSolver, True );
-				KSPSetInitialGuessNonzero( level->downSolver->ksp, (PetscTruth)True );
+				KSPSetInitialGuessNonzero( level->downSolver->ksp, (PetscBool)True );
 			else
 				//MatrixSolver_SetUseInitialSolution( level->downSolver, False );
-				KSPSetInitialGuessNonzero( level->downSolver->ksp, (PetscTruth)False );
+				KSPSetInitialGuessNonzero( level->downSolver->ksp, (PetscBool)False );
 			//MatrixSolver_SetUseInitialSolution( level->upSolver, True );
-			KSPSetInitialGuessNonzero( level->upSolver->ksp, (PetscTruth)True );
+			KSPSetInitialGuessNonzero( level->upSolver->ksp, (PetscBool)True );
 		}
 	}
 
@@ -909,7 +909,7 @@ void MultigridSolver_UpdateMatrices( Mul
 			//if( mat ) {
 			if( mat != PETSC_NULL ) {
 				//KillObject( mat );
-				MatDestroy( mat );
+				MatDestroy( &mat );
 			}
 			MultigridSolver_RestrictMatrix( self, self->levels + l_i + 1, &mat );
 			level->A = mat;
@@ -985,7 +985,7 @@ void MultigridSolver_UpdateOps( Multigri
 			//Stg_Class_AddRef( level->P );
 		}
 		else
-			MatDestroy( pOps[l_i] );
+			MatDestroy( &pOps[l_i] );
 			//Stg_Class_RemoveRef( pOps[l_i] );
 
 
@@ -995,7 +995,7 @@ void MultigridSolver_UpdateOps( Multigri
 			//Stg_Class_AddRef( level->R );
 		}
 		else
-			MatDestroy( rOps[l_i] );
+			MatDestroy( &rOps[l_i] );
 			//Stg_Class_RemoveRef( rOps[l_i] );
 	}
 
@@ -1026,7 +1026,7 @@ void MultigridSolver_UpdateWorkVectors( 
 			//Vector_Duplicate( self->curSolution, (void**)&level->workSol );
 			//Vector_SetLocalSize( level->workSol, rowSize );
 			if( level->workSol != PETSC_NULL )
-				VecDestroy( level->workSol );
+				VecDestroy( &level->workSol );
 			VecCreate( self->mgData->comm, &level->workSol );
 			VecSetSizes( level->workSol, rowSize, PETSC_DECIDE );
 			VecSetFromOptions( level->workSol );
@@ -1045,7 +1045,7 @@ void MultigridSolver_UpdateWorkVectors( 
 			//Vector_Duplicate( self->curSolution, (void**)&level->workRHS );
 			//Vector_SetLocalSize( level->workRHS, rowSize );
 			if( level->workRHS != PETSC_NULL )
-				VecDestroy( level->workRHS );
+				VecDestroy( &level->workRHS );
 			VecCreate( self->mgData->comm, &level->workRHS );
 			VecSetSizes( level->workRHS, rowSize, PETSC_DECIDE );
 			VecSetFromOptions( level->workRHS );
@@ -1077,11 +1077,11 @@ MGSolver_PETScData* MultigridSolver_Crea
 	KSPGetPC( outerSolver->ksp, &pc );
 	PCSetType( pc, PCSOR );
 	if( outerSolver->matrix != PETSC_NULL )
-		MatDestroy( outerSolver->matrix );
+		MatDestroy( &outerSolver->matrix );
 	outerSolver->matrix = matrix;
 	KSPSetOperators( outerSolver->ksp, matrix, matrix, DIFFERENT_NONZERO_PATTERN );
 	KSPSetTolerances( outerSolver->ksp, PETSC_DEFAULT, PETSC_DEFAULT, PETSC_DEFAULT, (PetscInt)3 );
-	KSPSetInitialGuessNonzero( outerSolver->ksp, (PetscTruth)True );
+	KSPSetInitialGuessNonzero( outerSolver->ksp, (PetscBool)True );
 	KSPSetNormType( outerSolver->ksp, (KSPNormType)MultigridSolver_NormType_Preconditioned );
 
 	return outerSolver;
@@ -1108,7 +1108,7 @@ MGSolver_PETScData* MultigridSolver_Crea
 	KSPGetPC( smoother->ksp, &pc );
 	PCSetType( pc, PCSOR );
 	if( smoother->matrix != PETSC_NULL )
-		MatDestroy( smoother->matrix );
+		MatDestroy( &smoother->matrix );
 	smoother->matrix = matrix;
 	KSPSetOperators( smoother->ksp, matrix, matrix, DIFFERENT_NONZERO_PATTERN );
 
@@ -1176,37 +1176,37 @@ void MultigridSolver_DestructLevels( Mul
 		if( level->downSolver ) {
 			//Stg_Class_RemoveRef( MatrixSolver_GetMatrix( level->downSolver ) );
 			//Stg_Class_RemoveRef( level->downSolver );
-			if( level->downSolver->ksp != PETSC_NULL )         KSPDestroy( level->downSolver->ksp );
-			if( level->downSolver->matrix != PETSC_NULL )      MatDestroy( level->downSolver->matrix );
-			if( level->downSolver->inversion != PETSC_NULL )   MatDestroy( level->downSolver->inversion );
-			if( level->downSolver->residual != PETSC_NULL )    VecDestroy( level->downSolver->residual );
-			if( level->downSolver->curRHS != PETSC_NULL )      VecDestroy( level->downSolver->curRHS );
-			if( level->downSolver->curSolution != PETSC_NULL ) VecDestroy( level->downSolver->curSolution );
+			if( level->downSolver->ksp != PETSC_NULL )         KSPDestroy( &level->downSolver->ksp );
+			if( level->downSolver->matrix != PETSC_NULL )      MatDestroy( &level->downSolver->matrix );
+			if( level->downSolver->inversion != PETSC_NULL )   MatDestroy( &level->downSolver->inversion );
+			if( level->downSolver->residual != PETSC_NULL )    VecDestroy( &level->downSolver->residual );
+			if( level->downSolver->curRHS != PETSC_NULL )      VecDestroy( &level->downSolver->curRHS );
+			if( level->downSolver->curSolution != PETSC_NULL ) VecDestroy( &level->downSolver->curSolution );
 			free( level->downSolver );
 		}
 		if( level->upSolver ) {
 			//Stg_Class_RemoveRef( MatrixSolver_GetMatrix( level->upSolver ) );
 			//Stg_Class_RemoveRef( level->upSolver );
-			if( level->upSolver->ksp != PETSC_NULL )         KSPDestroy( level->upSolver->ksp );
-			if( level->upSolver->matrix != PETSC_NULL )      MatDestroy( level->upSolver->matrix );
-			if( level->upSolver->inversion != PETSC_NULL )   MatDestroy( level->upSolver->inversion );
-			if( level->upSolver->residual != PETSC_NULL )    VecDestroy( level->upSolver->residual );
-			if( level->upSolver->curRHS != PETSC_NULL )      VecDestroy( level->upSolver->curRHS );
-			if( level->upSolver->curSolution != PETSC_NULL ) VecDestroy( level->upSolver->curSolution );
+			if( level->upSolver->ksp != PETSC_NULL )         KSPDestroy( &level->upSolver->ksp );
+			if( level->upSolver->matrix != PETSC_NULL )      MatDestroy( &level->upSolver->matrix );
+			if( level->upSolver->inversion != PETSC_NULL )   MatDestroy( &level->upSolver->inversion );
+			if( level->upSolver->residual != PETSC_NULL )    VecDestroy( &level->upSolver->residual );
+			if( level->upSolver->curRHS != PETSC_NULL )      VecDestroy( &level->upSolver->curRHS );
+			if( level->upSolver->curSolution != PETSC_NULL ) VecDestroy( &level->upSolver->curSolution );
 			free( level->upSolver );
 		}
 		if( level->R != PETSC_NULL )
 			//Stg_Class_RemoveRef( level->R );
-			MatDestroy( level->R );
+			MatDestroy( &level->R );
 		if( level->P != PETSC_NULL )
 			//Stg_Class_RemoveRef( level->P );
-			MatDestroy( level->P );
+			MatDestroy( &level->P );
 		if( level->workRHS != PETSC_NULL )
 			//Stg_Class_RemoveRef( level->workRHS );
-			VecDestroy( level->workRHS );
+			VecDestroy( &level->workRHS );
 		if( level->workSol != PETSC_NULL )
 			//Stg_Class_RemoveRef( level->workSol );
-			VecDestroy( level->workSol );
+			VecDestroy( &level->workSol );
 	}
 
 	KillArray( self->levels );
@@ -1216,12 +1216,12 @@ void MultigridSolver_DestructLevels( Mul
 
 	/* Temporary. */
 	//KillObject( self->outerSolver );
-	if( self->outerSolver->ksp )         KSPDestroy( self->outerSolver->ksp );
-	if( self->outerSolver->matrix )      MatDestroy( self->outerSolver->matrix );
-	if( self->outerSolver->inversion )   MatDestroy( self->outerSolver->inversion );
-	if( self->outerSolver->residual )    VecDestroy( self->outerSolver->residual );
-	if( self->outerSolver->curRHS )      VecDestroy( self->outerSolver->curRHS );
-	if( self->outerSolver->curSolution ) VecDestroy( self->outerSolver->curSolution );
+	if( self->outerSolver->ksp )         KSPDestroy( &self->outerSolver->ksp );
+	if( self->outerSolver->matrix )      MatDestroy( &self->outerSolver->matrix );
+	if( self->outerSolver->inversion )   MatDestroy( &self->outerSolver->inversion );
+	if( self->outerSolver->residual )    VecDestroy( &self->outerSolver->residual );
+	if( self->outerSolver->curRHS )      VecDestroy( &self->outerSolver->curRHS );
+	if( self->outerSolver->curSolution ) VecDestroy( &self->outerSolver->curSolution );
 	free( self->outerSolver );
 }
 
diff -r 773cc6558f7f -r 2e5c9df86a89 SLE/SystemSetup/src/PETScMGSolver.cxx
--- a/SLE/SystemSetup/src/PETScMGSolver.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/SLE/SystemSetup/src/PETScMGSolver.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -226,7 +226,7 @@ void PETScMGSolver_SetComm( void* matrix
 	//PETScMatrixSolver_SetComm( self, comm );
 	self->mgData->comm = comm;
 	if( self->mgData->ksp )
-		KSPDestroy( self->mgData->ksp );
+		KSPDestroy( &self->mgData->ksp );
 	KSPCreate( comm, &self->mgData->ksp );
 
 	if( self->pure )
@@ -358,7 +358,7 @@ void PETScMGSolver_SetRestriction( void*
 	//if( level->R )
 	//	Stg_Class_RemoveRef( level->R );
 	if( level->R != PETSC_NULL )
-		MatDestroy( level->R );
+		MatDestroy( &level->R );
 	level->R = R;
 }
 
@@ -379,7 +379,7 @@ void PETScMGSolver_SetProlongation( void
 	//if( level->P )
 	//	Stg_Class_RemoveRef( level->P );
 	if( level->P != PETSC_NULL ) {
-		MatDestroy( level->P );
+		MatDestroy( &level->P );
 		if(level->P == level->R)
 		    level->R = PETSC_NULL;
 	}
@@ -570,7 +570,7 @@ void PETScMGSolver_UpdateWorkVectors( PE
 
 		if( l_i > 0 && (!level->workRes || /*Vector_GetLocalSize( level->workRes )*/vecSize != size) ) {
 			if( level->workRes )
-				VecDestroy( level->workRes );
+				VecDestroy( &level->workRes );
 			//	FreeObject( level->workRes );
 			//Vector_Duplicate( self->curSolution, (void**)&level->workRes );
 			//Vector_SetLocalSize( level->workRes, size );
@@ -592,7 +592,7 @@ void PETScMGSolver_UpdateWorkVectors( PE
 			VecGetLocalSize( level->workSol, &vecSize );
                     if( !level->workSol || /*Vector_GetLocalSize( level->workSol )*/vecSize != size ) {
 				if( level->workSol )
-					VecDestroy( level->workSol );
+					VecDestroy( &level->workSol );
 				//	FreeObject( level->workSol );
 				//Vector_Duplicate( self->curSolution, (void**)&level->workSol );
 				//Vector_SetLocalSize( level->workSol, size );
@@ -613,7 +613,7 @@ void PETScMGSolver_UpdateWorkVectors( PE
 			VecGetLocalSize( level->workRHS, &vecSize );
                     if( !level->workRHS || /*Vector_GetLocalSize( level->workRHS )*/vecSize != size ) {
 				if( level->workRHS )
-					VecDestroy( level->workRHS );
+					VecDestroy( &level->workRHS );
 				//	FreeObject( level->workRHS );
 				//Vector_Duplicate( self->curSolution, (void**)&level->workRHS );
 				//Vector_SetLocalSize( level->workRHS, size );
@@ -640,7 +640,7 @@ void PETScMGSolver_UpdateSolvers( PETScM
 	PC			levelPC;
 	PetscErrorCode		ec;
 	unsigned		l_i;
-	PetscTruth              smoothers_differ, flag;
+	PetscBool              smoothers_differ, flag;
 	PetscMPIInt             size;
         MPI_Comm                comm;
 
@@ -654,7 +654,7 @@ void PETScMGSolver_UpdateSolvers( PETScM
 	ec = PCMGSetType( pc, PC_MG_MULTIPLICATIVE );
 	CheckPETScError( ec );
 
-	ec=PetscOptionsGetTruth( PETSC_NULL, "-pc_mg_different_smoothers", &smoothers_differ, &flag ); CheckPETScError(ec);
+	ec=PetscOptionsGetBool( PETSC_NULL, "-pc_mg_different_smoothers", &smoothers_differ, &flag ); CheckPETScError(ec);
 
 	ec=PetscObjectGetComm( (PetscObject)pc, &comm ); CheckPETScError(ec);
 	MPI_Comm_size( comm, &size );
@@ -734,8 +734,8 @@ void PETScMGSolver_DestructLevels( PETSc
 			Stg_Class_RemoveRef( level->A );
 		*/
 		if( level->R != PETSC_NULL && level->R != level->P )
-                    MatDestroy( level->R );
-		if( level->P != PETSC_NULL ) MatDestroy( level->P );
+                    MatDestroy( &level->R );
+		if( level->P != PETSC_NULL ) MatDestroy( &level->P );
 /*
 		if( level->A != PETSC_NULL ) MatDestroy( level->A );
 */
@@ -744,11 +744,11 @@ void PETScMGSolver_DestructLevels( PETSc
 		//FreeObject( level->workSol );
 		//FreeObject( level->workRHS );
                 if( level->workRes )
-                    VecDestroy( level->workRes );
+                    VecDestroy( &level->workRes );
                 if( level->workSol )
-                    VecDestroy( level->workSol );
+                    VecDestroy( &level->workSol );
                 if( level->workRHS )
-                    VecDestroy( level->workRHS );
+                    VecDestroy( &level->workRHS );
 	}
 
 	KillArray( self->levels );
diff -r 773cc6558f7f -r 2e5c9df86a89 SLE/SystemSetup/src/SROpGenerator.cxx
--- a/SLE/SystemSetup/src/SROpGenerator.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/SLE/SystemSetup/src/SROpGenerator.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -145,8 +145,9 @@ void _SROpGenerator_Destroy( void* srOpG
 }
 
 Bool SROpGenerator_HasExpired( void* srOpGenerator ) {
+#ifndef NDEBUG
 	SROpGenerator*	self = (SROpGenerator*)srOpGenerator;
-
+#endif
 	assert( self && Stg_CheckType( self, SROpGenerator ) );
 
 	return False;
@@ -713,9 +714,9 @@ PetscErrorCode _VecGetOwnershipRanges( V
 
   *_ranges = ranges;
 
-  VecScatterDestroy( scat );
-  VecDestroy( out );
-  VecDestroy( all );
+  VecScatterDestroy( &scat );
+  VecDestroy( &out );
+  VecDestroy( &all );
 
  
   PetscFunctionReturn(0);
@@ -762,7 +763,7 @@ Mat SROpGenerator_SimpleFinestLevel( SRO
    PetscInt sr,er, sc,ec, row_idx;
    Vec vec_o_nnz, vec_d_nnz;
    PetscScalar *v;
-   PetscTruth is_seq;
+   PetscBool is_seq;
    PetscInt p, proc_owner, *rranges,*cranges;
    MPI_Comm comm;
    PetscMPIInt nproc,rank;  
@@ -833,8 +834,8 @@ Mat SROpGenerator_SimpleFinestLevel( SRO
       _VecGetOwnershipRanges( L, &rranges );
       _VecGetOwnershipRanges( R, &cranges );
 
-      VecDestroy( L );
-      VecDestroy( R );
+      VecDestroy( &L );
+      VecDestroy( &R );
     }
   
    PetscMalloc( sizeof(PetscInt)*(er-sr), &o_nnz );
@@ -1029,8 +1030,8 @@ Mat SROpGenerator_SimpleFinestLevel( SRO
 
    Stg_Class_Delete(offsGrid);
 
-   VecDestroy( vec_o_nnz );
-   VecDestroy( vec_d_nnz );
+   VecDestroy( &vec_o_nnz );
+   VecDestroy( &vec_d_nnz );
    PetscFree( o_nnz );
    PetscFree( d_nnz );
    PetscFree( rranges );
@@ -1137,8 +1138,8 @@ Mat SROpGenerator_SimpleCoarserLevel( SR
       _VecGetOwnershipRanges( L, &row_ranges );
       _VecGetOwnershipRanges( R, &col_ranges );
 
-      VecDestroy( L );
-      VecDestroy( R );
+      VecDestroy( &L );
+      VecDestroy( &R );
     }
 
 
@@ -1302,8 +1303,8 @@ Mat SROpGenerator_SimpleCoarserLevel( SR
    Stg_Class_Delete( grid[1] );
    Stg_Class_Delete( offsGrid );
 
-   VecDestroy( vec_o_nnz );
-   VecDestroy( vec_d_nnz );
+   VecDestroy( &vec_o_nnz );
+   VecDestroy( &vec_d_nnz );
    PetscFree( o_nnz );
    PetscFree( d_nnz );
    PetscFree( row_ranges );
diff -r 773cc6558f7f -r 2e5c9df86a89 SLE/SystemSetup/src/SolutionVector.cxx
--- a/SLE/SystemSetup/src/SolutionVector.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/SLE/SystemSetup/src/SolutionVector.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -253,7 +253,7 @@ void _SolutionVector_Destroy( void* solu
 
 	//FreeObject( self->vector );
 	if( self->vector != PETSC_NULL )
-		VecDestroy( self->vector );
+		VecDestroy( &self->vector );
 }
 
 void SolutionVector_ApplyBCsToVariables( void* solutionVector, void* data ) {
diff -r 773cc6558f7f -r 2e5c9df86a89 SLE/SystemSetup/src/StiffnessMatrix.cxx
--- a/SLE/SystemSetup/src/StiffnessMatrix.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/SLE/SystemSetup/src/StiffnessMatrix.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -561,7 +561,7 @@ void _StiffnessMatrix_Destroy( void* sti
 	StiffnessMatrix* self = (StiffnessMatrix*)stiffnessMatrix;
 	
 	Journal_DPrintf( self->debug, "In %s - for matrix %s\n", __func__, self->name );
-	MatDestroy( self->matrix );
+	MatDestroy( &self->matrix );
 	FreeObject( self->stiffnessMatrixTermList );
 	FreeArray( self->_assembleStiffnessMatrixEPName );
 	FreeArray( self->diagonalNonZeroIndices );
@@ -1353,7 +1353,7 @@ void StiffMatAssLog_Init( struct StiffMa
 void StiffMatAssLog_Init( struct StiffMatAss_Log *log, const char type_name[] )
 {
 	if( log->ass_type != NULL ) free( log->ass_type );
-	asprintf( &log->ass_type, "%s", type_name );
+	Stg_asprintf( &log->ass_type, "%s", type_name );
 	
 	/* reset timers and counter */
 	log->total_TIME                           = 0.0;
@@ -2717,7 +2717,7 @@ void StiffnessMatrix_RefreshMatrix( Stif
 	} 
  	else { */
 		if( self->matrix != PETSC_NULL )
-			MatDestroy( self->matrix );
+			MatDestroy( &self->matrix );
 
 		MatCreate( self->comm, &self->matrix );
 		MatSetSizes( self->matrix, self->rowLocalSize, self->colLocalSize, PETSC_DETERMINE, PETSC_DETERMINE );
diff -r 773cc6558f7f -r 2e5c9df86a89 SLE/SystemSetup/src/SystemLinearEquations.cxx
--- a/SLE/SystemSetup/src/SystemLinearEquations.cxx	Thu Mar 15 12:50:40 2012 -0700
+++ b/SLE/SystemSetup/src/SystemLinearEquations.cxx	Thu Mar 15 12:51:23 2012 -0700
@@ -516,10 +516,10 @@ void _SystemLinearEquations_Destroy( voi
 
 	Memory_Free( self->optionsPrefix );
 
-	VecDestroy( self->X );
-	VecDestroy( self->F );
-	MatDestroy( self->A );
-	MatDestroy( self->J );
+	VecDestroy( &self->X );
+	VecDestroy( &self->F );
+	MatDestroy( &self->A );
+	MatDestroy( &self->J );
 
 	/* Free the the MG handles. */
 	FreeArray( self->mgHandles );
@@ -678,7 +678,7 @@ void SystemLinearEquations_NewtonInitial
 
 	/* don't assume that a snes is being used for initial guess, check for this!!! */
 	if( oldSnes && context->timeStep == 0 && !sle->linearSolveInitGuess )
-		SNESDestroy( oldSnes );
+		SNESDestroy( &oldSnes );
 
 	SNESCreate( sle->comm, &snes );
 
@@ -710,7 +710,7 @@ void SystemLinearEquations_NewtonFinalis
 
 	sle->_updateOldFields( &sle->X, context );
 	
-	SNESDestroy( snes );	
+	SNESDestroy( &snes );	
 }
 
 void SystemLinearEquations_NewtonMFFDExecute( void* sle, void* _context ) {
@@ -721,7 +721,7 @@ void SystemLinearEquations_NewtonMFFDExe
 
 	/* creates the nonlinear solver */
 	if( self->nlSolver != PETSC_NULL )
-		SNESDestroy( self->nlSolver );
+		SNESDestroy( &self->nlSolver );
 	SNESCreate( self->comm, &self->nlSolver );
 	SNESSetFunction( self->nlSolver, F, self->_buildF, _context );
 
@@ -902,7 +902,7 @@ void SystemLinearEquations_NonLinearExec
 
 	Stream_UnIndentBranch( StgFEM_Debug );
 
-	VecDestroy( previousVector );
+	VecDestroy( &previousVector );
 	
 	/*Set all the printout variables */
         if( solver->totalnumnonlinearits ) {
@@ -1164,7 +1164,7 @@ void SystemLinearEquations_PicardExecute
   PetscReal snes_ttol, snes_rtol, snes_abstol, snes_xtol;
   PetscInt  snes_maxits;
 
-  PetscTruth monitor_flg;
+  PetscBool monitor_flg;
 
   /* setup temporary some vectors */
   solver->_getSolution( self, solver, &Xstar );
@@ -1266,10 +1266,10 @@ void SystemLinearEquations_PicardExecute
   if (monitor_flg==PETSC_TRUE)
     PetscPrintf( PETSC_COMM_WORLD, "Nonlinear solve converged due to %s \n", SNESConvergedReasons[snes_reason] );
 
-  VecDestroy( X );
-  VecDestroy( F );
-  VecDestroy( Y );
-  VecDestroy( delta_X );
+  VecDestroy( &X );
+  VecDestroy( &F );
+  VecDestroy( &Y );
+  VecDestroy( &delta_X );
 
 }
 



More information about the CIG-COMMITS mailing list