From 9d8b5402e1af02c4f07f583c26c6f1af44ae41e7 Mon Sep 17 00:00:00 2001
From: young <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Date: Thu, 14 Mar 2013 09:11:37 +0000
Subject: [PATCH] Remove most instances of PETSC_USE_64BIT_INDICES. PetscInt is
 always right.

git-svn-id: https://svn.dealii.org/trunk@28900 0785d39b-7218-0410-832d-ea1e28bc413d
---
 .../include/deal.II/lac/petsc_matrix_base.h   | 20 ++------------
 deal.II/include/deal.II/lac/petsc_solver.h    |  8 ------
 .../include/deal.II/lac/petsc_vector_base.h   | 27 -------------------
 3 files changed, 2 insertions(+), 53 deletions(-)

diff --git a/deal.II/include/deal.II/lac/petsc_matrix_base.h b/deal.II/include/deal.II/lac/petsc_matrix_base.h
index 7715d722dd..0734e34926 100644
--- a/deal.II/include/deal.II/lac/petsc_matrix_base.h
+++ b/deal.II/include/deal.II/lac/petsc_matrix_base.h
@@ -1285,11 +1285,7 @@ namespace PETScWrappers
      * adding/inserting local data into
      * the (large) sparse matrix.
      */
-#ifdef PETSC_USE_64BIT_INDICES
     std::vector<PetscInt> column_indices;
-#else
-    std::vector<int> column_indices;
-#endif
 
     /**
      * An internal array of double values
@@ -1547,13 +1543,9 @@ namespace PETScWrappers
   {
     prepare_action(LastAction::insert);
 
-#ifdef PETSC_USE_64BIT_INDICES
     const PetscInt petsc_i = row;
     PetscInt *col_index_ptr;
-#else
-    const int petsc_i = row;
-    int *col_index_ptr;
-#endif
+
     PetscScalar const *col_value_ptr;
     int n_columns;
 
@@ -1697,13 +1689,8 @@ namespace PETScWrappers
   {
     prepare_action(LastAction::add);
 
-#ifdef PETSC_USE_64BIT_INDICES
     const PetscInt petsc_i = row;
     PetscInt *col_index_ptr;
-#else
-    const int petsc_i = row;
-    int *col_index_ptr;
-#endif
     PetscScalar const *col_value_ptr;
     int n_columns;
 
@@ -1818,11 +1805,8 @@ namespace PETScWrappers
   bool
   MatrixBase::in_local_range (const unsigned int index) const
   {
-#ifdef PETSC_USE_64BIT_INDICES
     PetscInt begin, end;
-#else
-    int begin, end;
-#endif
+
     const int ierr = MatGetOwnershipRange (static_cast<const Mat &>(matrix),
                                            &begin, &end);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
diff --git a/deal.II/include/deal.II/lac/petsc_solver.h b/deal.II/include/deal.II/lac/petsc_solver.h
index 5c4a10a0f4..4d805ca669 100644
--- a/deal.II/include/deal.II/lac/petsc_solver.h
+++ b/deal.II/include/deal.II/lac/petsc_solver.h
@@ -225,11 +225,7 @@ namespace PETScWrappers
     int
 #endif
     convergence_test (KSP                 ksp,
-#ifdef PETSC_USE_64BIT_INDICES
                       const PetscInt      iteration,
-#else
-                      const int           iteration,
-#endif
                       const PetscReal     residual_norm,
                       KSPConvergedReason *reason,
                       void               *solver_control);
@@ -1226,11 +1222,7 @@ namespace PETScWrappers
     int
 #endif
     convergence_test (KSP                ksp,
-#ifdef PETSC_USE_64BIT_INDICES
                       const PetscInt     iteration,
-#else
-                      const int          iteration,
-#endif
                       const PetscReal    residual_norm,
                       KSPConvergedReason *reason,
                       void               *solver_control);
diff --git a/deal.II/include/deal.II/lac/petsc_vector_base.h b/deal.II/include/deal.II/lac/petsc_vector_base.h
index 3d22318d1a..5a5dbd0f58 100644
--- a/deal.II/include/deal.II/lac/petsc_vector_base.h
+++ b/deal.II/include/deal.II/lac/petsc_vector_base.h
@@ -960,11 +960,7 @@ namespace PETScWrappers
 
       Assert (!vector.has_ghost_elements(), ExcGhostsPresent());
 
-#ifdef PETSC_USE_64BIT_INDICES
       const PetscInt petsc_i = index;
-#else
-      const signed int petsc_i = index;
-#endif
 
       const int ierr
         = VecSetValues (vector, 1, &petsc_i, &value, INSERT_VALUES);
@@ -1002,11 +998,7 @@ namespace PETScWrappers
         return *this;
 
       // use the PETSc function to add something
-#ifdef PETSC_USE_64BIT_INDICES
       const PetscInt petsc_i = index;
-#else
-      const signed int petsc_i = index;
-#endif
       const int ierr
         = VecSetValues (vector, 1, &petsc_i, &value, ADD_VALUES);
       AssertThrow (ierr == 0, ExcPETScError(ierr));
@@ -1043,11 +1035,7 @@ namespace PETScWrappers
 
       // use the PETSc function to
       // add something
-#ifdef PETSC_USE_64BIT_INDICES
       const PetscInt petsc_i = index;
-#else
-      const signed int petsc_i = index;
-#endif
       const PetscScalar subtractand = -value;
       const int ierr
         = VecSetValues (vector, 1, &petsc_i, &subtractand, ADD_VALUES);
@@ -1082,12 +1070,7 @@ namespace PETScWrappers
       if (value == 1.)
         return *this;
 
-#ifdef PETSC_USE_64BIT_INDICES
       const PetscInt petsc_i = index;
-#else
-      const signed int petsc_i = index;
-#endif
-
       const PetscScalar new_value
         = static_cast<PetscScalar>(*this) * value;
 
@@ -1124,12 +1107,7 @@ namespace PETScWrappers
       if (value == 1.)
         return *this;
 
-#ifdef PETSC_USE_64BIT_INDICES
       const PetscInt petsc_i = index;
-#else
-      const signed int petsc_i = index;
-#endif
-
       const PetscScalar new_value
         = static_cast<PetscScalar>(*this) / value;
 
@@ -1147,12 +1125,7 @@ namespace PETScWrappers
   bool
   VectorBase::in_local_range (const unsigned int index) const
   {
-#ifdef PETSC_USE_64BIT_INDICES
     PetscInt begin, end;
-#else
-    int begin, end;
-#endif
-
     const int ierr = VecGetOwnershipRange (static_cast<const Vec &>(vector),
                                            &begin, &end);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
-- 
2.39.5