]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Upgraded: PETSc matrix base to migrate to PETSc 3.0.0
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 31 Mar 2009 13:14:12 +0000 (13:14 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 31 Mar 2009 13:14:12 +0000 (13:14 +0000)
git-svn-id: https://svn.dealii.org/trunk@18535 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/petsc_matrix_base.h
deal.II/lac/source/petsc_matrix_base.cc

index 79fae04e69844567aae71cc3637b37928910e123..9f04b4339923feeedb051bec52bfbbcdafaa0c8f 100644 (file)
@@ -1092,9 +1092,10 @@ namespace PETScWrappers
                                         /** 
                                         * Test whether a matrix is Hermitian, 
                                         * i.e. it is the complex conjugate 
-                                        * of its transpose. 
+                                        * of its transpose. Default tolerance 
+                                        * is zero. 
                                         */
-      PetscTruth is_hermitian ();
+      PetscTruth is_hermitian (const double tol = 0.0);
 
                                         /* 
                                         * Abstract PETSc object that helps view 
index 91c046ec9d37a74b528e570f967803fe47dd3286..9de9116a0f5ed591c8caa2187ab4fe4e269504ed 100644 (file)
@@ -526,10 +526,16 @@ namespace PETScWrappers
   }  
 
   void
-  MatrixBase::transpose () 
+  MatrixBase::transpose ()
   {
     int ierr;
+
+#if (PETSC_VERSION_MAJOR <= 2) 
     ierr = MatTranspose(matrix, PETSC_NULL);
+#else
+    ierr = MatTranspose(matrix, MAT_REUSE_MATRIX, &matrix);
+#endif
+
     AssertThrow (ierr == 0, ExcPETScError(ierr));
   }
 
@@ -544,12 +550,17 @@ namespace PETScWrappers
   }  
 
   PetscTruth
-  MatrixBase::is_hermitian () 
+  MatrixBase::is_hermitian (const double tolerance
   {
     PetscTruth truth;
                                        // First flush PETSc caches
     compress ();
+
+#if (PETSC_VERSION_MAJOR <= 2) 
     MatIsHermitian (matrix, &truth);
+#else
+    MatIsHermitian (matrix, tolerance, &truth);
+#endif
     return truth;
   }  
 
@@ -559,10 +570,15 @@ namespace PETScWrappers
                                        // First flush PETSc caches
     compress ();
 
-                                       // Write to screen
+                                       // Set options
+#if (PETSC_VERSION_MAJOR <= 2) 
     PetscViewerSetFormat (PETSC_VIEWER_STDOUT_WORLD,
                          PETSC_VIEWER_ASCII_DEFAULT);
-
+#else
+    PetscViewerSetFormat (PETSC_VIEWER_STDOUT_WORLD,
+                         PETSC_VIEWER_DEFAULT);
+#endif
+                                       // Write to screen
     MatView (matrix,PETSC_VIEWER_STDOUT_WORLD);
   }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.