]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
After testing, fix compilation for petsc-3.3
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 16 Jun 2012 19:19:12 +0000 (19:19 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 16 Jun 2012 19:19:12 +0000 (19:19 +0000)
git-svn-id: https://svn.dealii.org/trunk@25628 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/lac/petsc_parallel_sparse_matrix.cc
deal.II/source/lac/petsc_solver.cc

index fa3b20306076949c9f5fdff73565ab6cc8520b20..ef7b6c3450497a683d405d9c0a05143fcc0772db 100644 (file)
@@ -195,7 +195,14 @@ namespace PETScWrappers
                                        // for all rows globally
       int ierr;
 
-#ifdef DEAL_II_USE_PETSC_DEV
+#if DEAL_II_PETSC_VERSION_LT(3,3,0)
+      ierr
+        = MatCreateMPIAIJ (communicator,
+                           local_rows, local_columns,
+                           m, n,
+                           n_nonzero_per_row, 0, 0, 0,
+                           &matrix);
+#else
       ierr
         = MatCreateAIJ (communicator,
                         local_rows, local_columns,
@@ -205,13 +212,6 @@ namespace PETScWrappers
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
       ierr = MatSetOption (matrix, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE);
-#else
-      ierr
-        = MatCreateMPIAIJ (communicator,
-                           local_rows, local_columns,
-                           m, n,
-                           n_nonzero_per_row, 0, 0, 0,
-                           &matrix);
 #endif
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
@@ -275,7 +275,14 @@ namespace PETScWrappers
 
       int ierr;
 
-#ifdef DEAL_II_USE_PETSC_DEV
+#if DEAL_II_PETSC_VERSION_LT(3,3,0)
+      ierr
+        = MatCreateMPIAIJ (communicator,
+                           local_rows, local_columns,
+                           m, n,
+                           0, &int_row_lengths[0], 0, 0,
+                           &matrix);
+#else
       ierr
         = MatCreateAIJ (communicator,
                         local_rows, local_columns,
@@ -287,13 +294,6 @@ namespace PETScWrappers
 //TODO: Sometimes the actual number of nonzero entries allocated is greater than the number of nonzero entries, which petsc will complain about unless explicitly disabled with MatSetOption. There is probably a way to prevent a different number nonzero elements being allocated in the first place. (See also previous TODO).
 
       ierr = MatSetOption (matrix, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE);
-#else
-      ierr
-        = MatCreateMPIAIJ (communicator,
-                           local_rows, local_columns,
-                           m, n,
-                           0, &int_row_lengths[0], 0, 0,
-                           &matrix);
 #endif
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
index 7b927e5be37729db9f965dc9b7f66a90fdeb4f5c..03245ad41fbd6edb91ebafe4704450134e0b6ac1 100644 (file)
@@ -285,7 +285,12 @@ namespace PETScWrappers
                                      // for a char*, even though KSPXXXX is of
                                      // type const char*
     int ierr;
+
+#if DEAL_II_PETSC_VERSION_LT(3,3,0)
     ierr = KSPSetType (ksp, const_cast<char *>(KSPCHEBYCHEV));
+#else
+    ierr = KSPSetType (ksp, const_cast<char *>(KSPCHEBYSHEV));
+#endif
     AssertThrow (ierr == 0, ExcPETScError(ierr));
 
                                      // in the deal.II solvers, we always

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.