From 43ace0447fb3e421551127717cae837a810ce260 Mon Sep 17 00:00:00 2001 From: young Date: Tue, 6 Sep 2011 08:25:06 +0000 Subject: [PATCH] Upgrade petsc solvers to petsc-dev git-svn-id: https://svn.dealii.org/trunk@24259 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/lac/petsc_precondition.cc | 4 ++++ deal.II/source/lac/petsc_solver.cc | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/deal.II/source/lac/petsc_precondition.cc b/deal.II/source/lac/petsc_precondition.cc index 172bf7a406..a01bae6732 100644 --- a/deal.II/source/lac/petsc_precondition.cc +++ b/deal.II/source/lac/petsc_precondition.cc @@ -37,7 +37,11 @@ namespace PETScWrappers { if (pc!=NULL) { +#if DEAL_II_PETSC_VERSION_DEV() + int ierr = PCDestroy(&pc); +#else int ierr = PCDestroy(pc); +#endif AssertThrow (ierr == 0, ExcPETScError(ierr)); } } diff --git a/deal.II/source/lac/petsc_solver.cc b/deal.II/source/lac/petsc_solver.cc index 825e441a65..362967807f 100644 --- a/deal.II/source/lac/petsc_solver.cc +++ b/deal.II/source/lac/petsc_solver.cc @@ -34,7 +34,12 @@ namespace PETScWrappers SolverBase::SolverData::~SolverData () { // destroy the solver object +#if DEAL_II_PETSC_VERSION_DEV() + int ierr = KSPDestroy (&ksp); +#else int ierr = KSPDestroy (ksp); +#endif + AssertThrow (ierr == 0, ExcPETScError(ierr)); // and destroy the solver object if we @@ -397,7 +402,12 @@ namespace PETScWrappers // right if (additional_data.right_preconditioning) { +#if DEAL_II_PETSC_VERSION_DEV() + ierr = KSPSetPCSide(ksp, PC_RIGHT); +#else ierr = KSPSetPreconditionerSide(ksp, PC_RIGHT); +#endif + AssertThrow (ierr == 0, ExcPETScError(ierr)); } -- 2.39.5