]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Remove 64BIT directive in PETScWrappers. PetscErrorCode is always right.
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 22 Mar 2013 14:45:26 +0000 (14:45 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 22 Mar 2013 14:45:26 +0000 (14:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@28987 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/petsc_matrix_base.h
deal.II/include/deal.II/lac/petsc_solver.h
deal.II/source/lac/petsc_solver.cc
deal.II/source/lac/petsc_sparse_matrix.cc
deal.II/source/lac/slepc_solver.cc

index 0734e3492695e1f36dad78320fc4737c221684fe..c5eafdb4d7dc2fb2c559e9be51a48986433f23e2 100644 (file)
@@ -1691,6 +1691,7 @@ namespace PETScWrappers
 
     const PetscInt petsc_i = row;
     PetscInt *col_index_ptr;
+
     PetscScalar const *col_value_ptr;
     int n_columns;
 
index 4d805ca669baf84f588d8f6bc9c9ad90a1abaf44..0e3cc61d1f04b89cbf1f7479e0f1570607284dd4 100644 (file)
@@ -219,16 +219,11 @@ namespace PETScWrappers
      * convergence has been reached.
      */
     static
-#ifdef PETSC_USE_64BIT_INDICES
-    PetscErrorCode
-#else
-    int
-#endif
-    convergence_test (KSP                 ksp,
-                      const PetscInt      iteration,
-                      const PetscReal     residual_norm,
-                      KSPConvergedReason *reason,
-                      void               *solver_control);
+      PetscErrorCode convergence_test (KSP                 ksp,
+                                      const PetscInt      iteration,
+                                      const PetscReal     residual_norm,
+                                      KSPConvergedReason *reason,
+                                      void               *solver_control);
 
     /**
      * A structure that contains the PETSc
@@ -1216,16 +1211,12 @@ namespace PETScWrappers
      * to see if convergence has been reached.
      */
     static
-#ifdef PETSC_USE_64BIT_INDICES
-    PetscErrorCode
-#else
-    int
-#endif
-    convergence_test (KSP                ksp,
-                      const PetscInt     iteration,
-                      const PetscReal    residual_norm,
-                      KSPConvergedReason *reason,
-                      void               *solver_control);
+      PetscErrorCode convergence_test (KSP                ksp,
+                                      const PetscInt     iteration,
+                                      const PetscReal    residual_norm,
+                                      KSPConvergedReason *reason,
+                                      void               *solver_control);
+
     /**
      * A structure that contains the
      * PETSc solver and preconditioner
index 3b58933f75e1f6024c58a3032799185bc5275936..dfed0c3b3514d357d6291122b53c95c72c3bd061 100644 (file)
@@ -848,11 +848,11 @@ namespace PETScWrappers
 
   }
 
-  int SparseDirectMUMPS::convergence_test (KSP            /*ksp*/,
-                                           const PetscInt       iteration,
-                                           const PetscReal      residual_norm,
-                                           KSPConvergedReason   *reason,
-                                           void                 *solver_control_x)
+  PetscErrorCode SparseDirectMUMPS::convergence_test (KSP               /*ksp*/,
+                                                     const PetscInt      iteration,
+                                                     const PetscReal     residual_norm,
+                                                     KSPConvergedReason *reason,
+                                                     void               *solver_control_x)
   {
     SolverControl &solver_control = *reinterpret_cast<SolverControl *>(solver_control_x);
 
index af1333c0402f82ece7e54a85df196aff937aa6c8..e77038d6cd50ba45ac1eb37061d4f44ef86f72e5 100644 (file)
@@ -194,12 +194,9 @@ namespace PETScWrappers
     // signed integers. so we have to
     // convert, unless we want to play dirty
     // tricks with conversions of pointers
-#ifdef PETSC_USE_64BIT_INDICES
     const std::vector<PetscInt>
-#else
-    const std::vector<int>
-#endif
-    int_row_lengths (row_lengths.begin(), row_lengths.end());
+      int_row_lengths (row_lengths.begin(), row_lengths.end());
+
     const int ierr
       = MatCreateSeqAIJ(PETSC_COMM_SELF, m, n, 0,
                         &int_row_lengths[0], &matrix);
@@ -250,13 +247,9 @@ namespace PETScWrappers
     // class.
     if (preset_nonzero_locations == true)
       {
-#ifdef PETSC_USE_64BIT_INDICES
-        std::vector<PetscInt>
-#else
-        std::vector<int>
-#endif
-        row_entries;
+        std::vector<PetscInt>    row_entries;
         std::vector<PetscScalar> row_values;
+
         for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
           {
             row_entries.resize (row_lengths[i]);
@@ -264,12 +257,7 @@ namespace PETScWrappers
             for (unsigned int j=0; j<row_lengths[i]; ++j)
               row_entries[j] = sparsity_pattern.column_number (i,j);
 
-#ifdef PETSC_USE_64BIT_INDICES
-            const PetscInt
-#else
-            const int
-#endif
-            int_row = i;
+            const PetscInt int_row = i;
             MatSetValues (matrix, 1, &int_row,
                           row_lengths[i], &row_entries[0],
                           &row_values[0], INSERT_VALUES);
index af34b63a14ee33054815385d04b7d36bd98bcc8a..ac453b8d0dac85fcdf267f345228d37d815b5866 100644 (file)
@@ -95,7 +95,8 @@ namespace SLEPcWrappers
   }
 
   void
-  SolverBase::solve (const unsigned int n_eigenvectors, unsigned int *n_converged)
+  SolverBase::solve (const unsigned int  n_eigenvectors, 
+                    unsigned int       *n_converged)
   {
     int ierr;
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.