From: hartmann Date: Fri, 27 Oct 2006 14:03:22 +0000 (+0000) Subject: Allow PETSc command line args to be passed to the preconditioner. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47b571de64267dd59c06b4af559893263ea12b2a;p=dealii-svn.git Allow PETSc command line args to be passed to the preconditioner. git-svn-id: https://svn.dealii.org/trunk@14101 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/source/petsc_precondition.cc b/deal.II/lac/source/petsc_precondition.cc index 8ff083434c..cb7d45c549 100644 --- a/deal.II/lac/source/petsc_precondition.cc +++ b/deal.II/lac/source/petsc_precondition.cc @@ -61,6 +61,9 @@ namespace PETScWrappers int ierr; ierr = PCSetType (pc, const_cast(PCJACOBI)); AssertThrow (ierr == 0, ExcPETScError(ierr)); + + ierr = PCSetFromOptions (pc); + AssertThrow (ierr == 0, ExcPETScError(ierr)); } @@ -84,6 +87,9 @@ namespace PETScWrappers int ierr; ierr = PCSetType (pc, const_cast(PCBJACOBI)); AssertThrow (ierr == 0, ExcPETScError(ierr)); + + ierr = PCSetFromOptions (pc); + AssertThrow (ierr == 0, ExcPETScError(ierr)); } @@ -117,6 +123,9 @@ namespace PETScWrappers // then set flags as given ierr = PCSORSetOmega (pc, additional_data.omega); AssertThrow (ierr == 0, ExcPETScError(ierr)); + + ierr = PCSetFromOptions (pc); + AssertThrow (ierr == 0, ExcPETScError(ierr)); } @@ -154,6 +163,9 @@ namespace PETScWrappers // convert SOR to SSOR ierr = PCSORSetSymmetric (pc, SOR_SYMMETRIC_SWEEP); AssertThrow (ierr == 0, ExcPETScError(ierr)); + + ierr = PCSetFromOptions (pc); + AssertThrow (ierr == 0, ExcPETScError(ierr)); } @@ -187,6 +199,9 @@ namespace PETScWrappers // then set flags as given ierr = PCEisenstatSetOmega (pc, additional_data.omega); AssertThrow (ierr == 0, ExcPETScError(ierr)); + + ierr = PCSetFromOptions (pc); + AssertThrow (ierr == 0, ExcPETScError(ierr)); } @@ -225,6 +240,9 @@ namespace PETScWrappers PCICCSetLevels (pc, additional_data.levels); #endif AssertThrow (ierr == 0, ExcPETScError(ierr)); + + ierr = PCSetFromOptions (pc); + AssertThrow (ierr == 0, ExcPETScError(ierr)); } @@ -262,6 +280,9 @@ namespace PETScWrappers PCILUSetLevels (pc, additional_data.levels); #endif AssertThrow (ierr == 0, ExcPETScError(ierr)); + + ierr = PCSetFromOptions (pc); + AssertThrow (ierr == 0, ExcPETScError(ierr)); } @@ -318,6 +339,9 @@ namespace PETScWrappers ierr = PCFactorSetShiftNonzero (pc, additional_data.damping); #endif AssertThrow (ierr == 0, ExcPETScError(ierr)); + + ierr = PCSetFromOptions (pc); + AssertThrow (ierr == 0, ExcPETScError(ierr)); }