From: bangerth Date: Tue, 28 Apr 2009 03:37:49 +0000 (+0000) Subject: Apply patch 18761 here as well (Make compile again with PETSc 2.3.x.). How embarrassi... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1c8992207365dcb3b9da9349e525a1763d2ed88;p=dealii-svn.git Apply patch 18761 here as well (Make compile again with PETSc 2.3.x.). How embarrassing... git-svn-id: https://svn.dealii.org/branches/releases/Branch-6-2@18762 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/petsc_vector.h b/deal.II/lac/include/lac/petsc_vector.h index 2698d68cc4..16721ee341 100644 --- a/deal.II/lac/include/lac/petsc_vector.h +++ b/deal.II/lac/include/lac/petsc_vector.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2004, 2005, 2006, 2007 by the deal.II authors +// Copyright (C) 2004, 2005, 2006, 2007, 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -286,9 +286,9 @@ namespace PETScWrappers AssertThrow (ierr == 0, ExcPETScError(ierr)); #if ((PETSC_VERSION_MAJOR == 2) && \ - (PETSC_VERSION_MINOR < 3) && \ - (PETSC_VERSION_SUBMINOR < 3)) - + ((PETSC_VERSION_MINOR < 3) || \ + ((PETSC_VERSION_MINOR == 3) && \ + (PETSC_VERSION_SUBMINOR < 3)))) ierr = VecScatterBegin (static_cast(v), vector, INSERT_VALUES, SCATTER_FORWARD, ctx); AssertThrow (ierr == 0, ExcPETScError(ierr)); diff --git a/deal.II/lac/source/petsc_matrix_base.cc b/deal.II/lac/source/petsc_matrix_base.cc index 9de9116a0f..b6d27f8648 100644 --- a/deal.II/lac/source/petsc_matrix_base.cc +++ b/deal.II/lac/source/petsc_matrix_base.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2004, 2005, 2006, 2008 by the deal.II authors +// Copyright (C) 2004, 2005, 2006, 2008, 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -553,10 +553,13 @@ namespace PETScWrappers MatrixBase::is_hermitian (const double tolerance) { PetscTruth truth; - // First flush PETSc caches + // First flush PETSc caches compress (); -#if (PETSC_VERSION_MAJOR <= 2) +#if (PETSC_VERSION_MAJOR <= 2) + // avoid warning about unused variables + (void) tolerance; + MatIsHermitian (matrix, &truth); #else MatIsHermitian (matrix, tolerance, &truth); diff --git a/deal.II/lac/source/petsc_precondition.cc b/deal.II/lac/source/petsc_precondition.cc index 88213a8a8c..d8ea360c72 100644 --- a/deal.II/lac/source/petsc_precondition.cc +++ b/deal.II/lac/source/petsc_precondition.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2004, 2006, 2008 by the deal.II authors +// Copyright (C) 2004, 2006, 2008, 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -234,7 +234,10 @@ namespace PETScWrappers AssertThrow (ierr == 0, ExcPETScError(ierr)); // then set flags -#if (PETSC_VERSION_MAJOR == 2) && (PETSC_VERSION_MINOR < 3) && (PETSC_VERSION_SUBMINOR < 1) +#if ((PETSC_VERSION_MAJOR == 2) && \ + ((PETSC_VERSION_MINOR < 3) || \ + ((PETSC_VERSION_MINOR == 3) && \ + (PETSC_VERSION_SUBMINOR < 1)))) PCICCSetLevels (pc, additional_data.levels); #else PCFactorSetLevels (pc, additional_data.levels); @@ -274,7 +277,10 @@ namespace PETScWrappers AssertThrow (ierr == 0, ExcPETScError(ierr)); // then set flags -#if (PETSC_VERSION_MAJOR == 2) && (PETSC_VERSION_MINOR < 3) && (PETSC_VERSION_SUBMINOR < 1) +#if ((PETSC_VERSION_MAJOR == 2) && \ + ((PETSC_VERSION_MINOR < 3) || \ + ((PETSC_VERSION_MINOR == 3) && \ + (PETSC_VERSION_SUBMINOR < 1)))) PCILUSetLevels (pc, additional_data.levels); #else PCFactorSetLevels (pc, additional_data.levels); @@ -318,7 +324,10 @@ namespace PETScWrappers AssertThrow (ierr == 0, ExcPETScError(ierr)); // set flags as given -#if (PETSC_VERSION_MAJOR == 2) && (PETSC_VERSION_MINOR >= 3) && (PETSC_VERSION_SUBMINOR >= 1) +#if ((PETSC_VERSION_MAJOR == 2) && \ + ((PETSC_VERSION_MINOR < 3) || \ + ((PETSC_VERSION_MINOR == 3) && \ + (PETSC_VERSION_SUBMINOR < 1)))) ierr = PCLUSetPivoting (pc, additional_data.pivoting); #else ierr = PCFactorSetPivoting (pc, additional_data.pivoting);