From: wolf Date: Fri, 21 May 2004 19:10:58 +0000 (+0000) Subject: Accessing matrix rows uses, in fact, the global row number... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25d14d8830b543f017153d42b821af9de5346c0f;p=dealii-svn.git Accessing matrix rows uses, in fact, the global row number... git-svn-id: https://svn.dealii.org/branches/Branch-5-0@9282 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/source/petsc_matrix_base.cc b/deal.II/lac/source/petsc_matrix_base.cc index 9680e7e421..6f6ae79eb4 100644 --- a/deal.II/lac/source/petsc_matrix_base.cc +++ b/deal.II/lac/source/petsc_matrix_base.cc @@ -44,40 +44,6 @@ namespace PETScWrappers // otherwise first flush PETSc caches matrix->compress (); - // next get the number of the row - // relative to the rows this process - // actually stores (remember that - // matrices can be distributed) - signed int local_row = -1; - if ((dynamic_cast(matrix) != 0) - || - (dynamic_cast(matrix) != 0)) - { - local_row = this->a_row; - } - else if (dynamic_cast(matrix) - != 0) - { - // first verify that the requested - // element is actually locally - // available - int ierr; - int begin, end; - ierr = MatGetOwnershipRange (*matrix, &begin, &end); - AssertThrow (ierr == 0, ExcPETScError(ierr)); - - AssertThrow ((this->a_row >= static_cast(begin)) && - (this->a_row < static_cast(end)), - ExcAccessToNonlocalRow (this->a_row, begin, end-1)); - - // alright, so we seem to have this - // particular row on the present - // processor - local_row = this->a_row - begin; - } - else - Assert (false, ExcInternalError()); - // get a representation of the present // row int ncols; @@ -85,7 +51,7 @@ namespace PETScWrappers PetscScalar *values; int ierr; - ierr = MatGetRow(*matrix, local_row, &ncols, &colnums, &values); + ierr = MatGetRow(*matrix, this->a_row, &ncols, &colnums, &values); AssertThrow (ierr == 0, MatrixBase::ExcPETScError(ierr)); // copy it into our caches @@ -94,7 +60,7 @@ namespace PETScWrappers value_cache.reset (new std::vector (values, values+ncols)); // and finally restore the matrix - ierr = MatRestoreRow(*matrix, local_row, &ncols, &colnums, &values); + ierr = MatRestoreRow(*matrix, this->a_row, &ncols, &colnums, &values); AssertThrow (ierr == 0, MatrixBase::ExcPETScError(ierr)); } }