From: David Wells Date: Sun, 10 Jul 2016 11:25:06 +0000 (-0400) Subject: Implement PETSc matrix clear_row with clear_rows. X-Git-Tag: v8.5.0-rc1~872^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73d01c24ee86c997ca872ff95fab5a6c81b01afc;p=dealii.git Implement PETSc matrix clear_row with clear_rows. These functions are identical up to their signatures. --- diff --git a/source/lac/petsc_matrix_base.cc b/source/lac/petsc_matrix_base.cc index 80cbcb4196..350cd54842 100644 --- a/source/lac/petsc_matrix_base.cc +++ b/source/lac/petsc_matrix_base.cc @@ -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 rows (1, row); + clear_rows(rows, new_diag_value); }