From 73d01c24ee86c997ca872ff95fab5a6c81b01afc Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 10 Jul 2016 07:25:06 -0400 Subject: [PATCH] Implement PETSc matrix clear_row with clear_rows. These functions are identical up to their signatures. --- source/lac/petsc_matrix_base.cc | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) 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); } -- 2.39.5