From 715ebc9e1ac7a3c02f5fe65795f0223239b32d8c Mon Sep 17 00:00:00 2001 From: young Date: Fri, 22 Mar 2013 14:45:26 +0000 Subject: [PATCH] Remove 64BIT directive in PETScWrappers. PetscErrorCode is always right. git-svn-id: https://svn.dealii.org/trunk@28987 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/deal.II/lac/petsc_matrix_base.h | 1 + deal.II/include/deal.II/lac/petsc_solver.h | 31 +++++++------------ deal.II/source/lac/petsc_solver.cc | 10 +++--- deal.II/source/lac/petsc_sparse_matrix.cc | 22 +++---------- deal.II/source/lac/slepc_solver.cc | 3 +- 5 files changed, 24 insertions(+), 43 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 0734e34926..c5eafdb4d7 100644 --- a/deal.II/include/deal.II/lac/petsc_matrix_base.h +++ b/deal.II/include/deal.II/lac/petsc_matrix_base.h @@ -1691,6 +1691,7 @@ namespace PETScWrappers const PetscInt petsc_i = row; PetscInt *col_index_ptr; + PetscScalar const *col_value_ptr; int n_columns; diff --git a/deal.II/include/deal.II/lac/petsc_solver.h b/deal.II/include/deal.II/lac/petsc_solver.h index 4d805ca669..0e3cc61d1f 100644 --- a/deal.II/include/deal.II/lac/petsc_solver.h +++ b/deal.II/include/deal.II/lac/petsc_solver.h @@ -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 diff --git a/deal.II/source/lac/petsc_solver.cc b/deal.II/source/lac/petsc_solver.cc index 3b58933f75..dfed0c3b35 100644 --- a/deal.II/source/lac/petsc_solver.cc +++ b/deal.II/source/lac/petsc_solver.cc @@ -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(solver_control_x); diff --git a/deal.II/source/lac/petsc_sparse_matrix.cc b/deal.II/source/lac/petsc_sparse_matrix.cc index af1333c040..e77038d6cd 100644 --- a/deal.II/source/lac/petsc_sparse_matrix.cc +++ b/deal.II/source/lac/petsc_sparse_matrix.cc @@ -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 -#else - const std::vector -#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 -#else - std::vector -#endif - row_entries; + std::vector row_entries; std::vector row_values; + for (unsigned int i=0; i