]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement PETSc matrix clear_row with clear_rows.
authorDavid Wells <wellsd2@rpi.edu>
Sun, 10 Jul 2016 11:25:06 +0000 (07:25 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Tue, 12 Jul 2016 01:37:40 +0000 (21:37 -0400)
These functions are identical up to their signatures.

source/lac/petsc_matrix_base.cc

index 80cbcb4196bdfffdb93472988acfe5a35cd9f05b..350cd548421cde5e4adf61e9b6eab10c5ae95533 100644 (file)
@@ -127,32 +127,8 @@ namespace PETScWrappers
   MatrixBase::clear_row (const size_type   row,
                          const PetscScalar new_diag_value)
   {
-    assert_is_compressed ();
-
-    // now set all the entries of this row to zero
-    const PetscInt petsc_row = row;
-
-    IS index_set;
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-    ISCreateGeneral (get_mpi_communicator(), 1, &petsc_row, &index_set);
-#else
-    ISCreateGeneral (get_mpi_communicator(), 1, &petsc_row, PETSC_COPY_VALUES, &index_set);
-#endif
-
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-    const int ierr
-      = MatZeroRowsIS(matrix, index_set, new_diag_value);
-#else
-    const int ierr
-      = MatZeroRowsIS(matrix, index_set, new_diag_value, PETSC_NULL, PETSC_NULL);
-#endif
-    AssertThrow (ierr == 0, ExcPETScError(ierr));
-
-#if DEAL_II_PETSC_VERSION_LT(3,2,0)
-    ISDestroy (index_set);
-#else
-    ISDestroy (&index_set);
-#endif
+    std::vector<size_type> rows (1, row);
+    clear_rows(rows, new_diag_value);
   }
 
 

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.