]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix bug in PETSc initialization.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Fri, 2 Oct 2009 08:23:28 +0000 (08:23 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Fri, 2 Oct 2009 08:23:28 +0000 (08:23 +0000)
git-svn-id: https://svn.dealii.org/trunk@19661 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 7ecc3079e96ca0962daf40d1f426b9b19d015c76..bbf00a608714aa91a817241f2830647ef84d1677 100644 (file)
@@ -166,22 +166,6 @@ namespace PETScWrappers
                                         * significantly more efficient to
                                         * get memory allocation right from
                                         * the start.
-                                        *
-                                        * Despite the fact that it would
-                                        * seem to be an obvious win, setting
-                                        * the @p preset_nonzero_locations
-                                        * flag to @p true doesn't seem to
-                                        * accelerate program. Rather on the
-                                        * contrary, it seems to be able to
-                                        * slow down entire programs
-                                        * somewhat. This is suprising, since
-                                        * we can use efficient function
-                                        * calls into PETSc that allow to
-                                        * create multiple entries at once;
-                                        * nevertheless, given the fact that
-                                        * it is inefficient, the respective
-                                        * flag has a default value equal to
-                                        * @p false.
                                         */
       template <typename SparsityType>
       SparseMatrix (const SparsityType &sparsity_pattern,
index 8295faf3ea8b3c0b2b31c1037bf61f1b3746db11..cf3535145c5f88648aeae86b1b5f76bd80966e87 100644 (file)
@@ -261,19 +261,18 @@ namespace PETScWrappers
                           &row_values[0], INSERT_VALUES);
           }
         compress ();
-      }
-
                                        // In the end, tell the matrix that
                                        // it should not expect any new
                                        // entries.
 #if (PETSC_VERSION_MAJOR <= 2)
-    const int ierr =
-      MatSetOption (matrix, MAT_NO_NEW_NONZERO_LOCATIONS);
+       const int ierr =
+         MatSetOption (matrix, MAT_NO_NEW_NONZERO_LOCATIONS);
 #else
-    const int ierr =
-      MatSetOption (matrix, MAT_NEW_NONZERO_LOCATIONS, PETSC_FALSE);
+       const int ierr =
+         MatSetOption (matrix, MAT_NEW_NONZERO_LOCATIONS, PETSC_FALSE);
 #endif
-    AssertThrow (ierr == 0, ExcPETScError(ierr));
+       AssertThrow (ierr == 0, ExcPETScError(ierr));
+      }
   }
 
 

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.