From: turcksin Date: Fri, 15 Mar 2013 15:45:11 +0000 (+0000) Subject: Merge from mainline. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dfaa741c5e42dfe2c34d399fc6154133f5c3a75;p=dealii-svn.git Merge from mainline. git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@28914 0785d39b-7218-0410-832d-ea1e28bc413d --- 4dfaa741c5e42dfe2c34d399fc6154133f5c3a75 diff --cc deal.II/include/deal.II/lac/petsc_matrix_base.h index f273b38939,0734e34926..e4a78f18f5 --- a/deal.II/include/deal.II/lac/petsc_matrix_base.h +++ b/deal.II/include/deal.II/lac/petsc_matrix_base.h @@@ -1830,13 -1803,10 +1817,10 @@@ namespace PETScWrapper inline bool - MatrixBase::in_local_range (const unsigned int index) const + MatrixBase::in_local_range (const size_type index) const { - #ifdef PETSC_USE_64BIT_INDICES PetscInt begin, end; - #else - int begin, end; - #endif + const int ierr = MatGetOwnershipRange (static_cast(matrix), &begin, &end); AssertThrow (ierr == 0, ExcPETScError(ierr)); diff --cc deal.II/include/deal.II/lac/petsc_vector_base.h index c64fdd6717,5a5dbd0f58..473b5167dd --- a/deal.II/include/deal.II/lac/petsc_vector_base.h +++ b/deal.II/include/deal.II/lac/petsc_vector_base.h @@@ -1153,14 -1123,9 +1131,9 @@@ namespace PETScWrapper inline bool - VectorBase::in_local_range (const unsigned int index) const + VectorBase::in_local_range (const size_type index) const { - #ifdef PETSC_USE_64BIT_INDICES PetscInt begin, end; - #else - int begin, end; - #endif - const int ierr = VecGetOwnershipRange (static_cast(vector), &begin, &end); AssertThrow (ierr == 0, ExcPETScError(ierr)); diff --cc deal.II/source/lac/petsc_matrix_base.cc index 51bcfc706f,036addb339..b596ad07a5 --- a/deal.II/source/lac/petsc_matrix_base.cc +++ b/deal.II/source/lac/petsc_matrix_base.cc @@@ -213,15 -214,11 +213,11 @@@ namespace PETScWrapper PetscScalar - MatrixBase::el (const unsigned int i, - const unsigned int j) const + MatrixBase::el (const size_type i, + const size_type j) const { - #ifdef PETSC_USE_64BIT_INDICES - PetscInt - #else - int - #endif - petsc_i = i, petsc_j = j; + PetscInt petsc_i = i, petsc_j = j; + PetscScalar value; const int ierr @@@ -270,15 -267,11 +266,11 @@@ - unsigned int + MatrixBase::size_type MatrixBase::m () const { - #ifdef PETSC_USE_64BIT_INDICES - PetscInt - #else - int - #endif - n_rows, n_cols; + PetscInt n_rows, n_cols; + int ierr = MatGetSize (matrix, &n_rows, &n_cols); AssertThrow (ierr == 0, ExcPETScError(ierr)); @@@ -287,15 -280,11 +279,11 @@@ - unsigned int + MatrixBase::size_type MatrixBase::n () const { - #ifdef PETSC_USE_64BIT_INDICES - PetscInt - #else - int - #endif - n_rows, n_cols; + PetscInt n_rows, n_cols; + int ierr = MatGetSize (matrix, &n_rows, &n_cols); AssertThrow (ierr == 0, ExcPETScError(ierr)); @@@ -304,15 -293,11 +292,11 @@@ - unsigned int + MatrixBase::size_type MatrixBase::local_size () const { - #ifdef PETSC_USE_64BIT_INDICES - PetscInt - #else - int - #endif - n_rows, n_cols; + PetscInt n_rows, n_cols; + int ierr = MatGetLocalSize (matrix, &n_rows, &n_cols); AssertThrow (ierr == 0, ExcPETScError(ierr)); @@@ -321,15 -306,11 +305,11 @@@ - std::pair + std::pair MatrixBase::local_range () const { - #ifdef PETSC_USE_64BIT_INDICES - PetscInt - #else - int - #endif - begin, end; + PetscInt begin, end; + const int ierr = MatGetOwnershipRange (static_cast(matrix), &begin, &end); AssertThrow (ierr == 0, ExcPETScError(ierr)); diff --cc deal.II/source/lac/petsc_parallel_sparse_matrix.cc index 8ec3b032a7,a734506e54..1b902374e5 --- a/deal.II/source/lac/petsc_parallel_sparse_matrix.cc +++ b/deal.II/source/lac/petsc_parallel_sparse_matrix.cc @@@ -356,17 -351,14 +351,14 @@@ namespace PETScWrapper // then count the elements in- and // out-of-window for the rows we own - #ifdef PETSC_USE_64BIT_INDICES std::vector - #else - std::vector - #endif + row_lengths_in_window (local_row_end - local_row_start), row_lengths_out_of_window (local_row_end - local_row_start); - for (unsigned int row = local_row_start; row= local_col_start) && (column < local_col_end)) @@@ -439,15 -431,11 +431,11 @@@ // have to somehow clumsily work around // the whole thing: #if DEAL_II_PETSC_VERSION_LT(2,2,1) - - #ifdef PETSC_USE_64BIT_INDICES std::vector - #else - std::vector - #endif + row_entries; std::vector row_values; - for (unsigned int i=0; i + std::pair VectorBase::local_range () const { - #ifdef PETSC_USE_64BIT_INDICES - PetscInt - #else - int - #endif - begin, end; + PetscInt begin, end; const int ierr = VecGetOwnershipRange (static_cast(vector), &begin, &end); AssertThrow (ierr == 0, ExcPETScError(ierr));