From: Toby D. Young Date: Wed, 21 Aug 2013 10:51:54 +0000 (+0000) Subject: Target eigenvalues iff spectral transformation is in use. X-Git-Tag: v8.1.0~1025 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a668b8d4ab1f663399c040d5c86b7f850105148b;p=dealii.git Target eigenvalues iff spectral transformation is in use. git-svn-id: https://svn.dealii.org/trunk@30370 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/lac/slepc_solver.cc b/deal.II/source/lac/slepc_solver.cc index fe91deb0b0..4e372994d1 100644 --- a/deal.II/source/lac/slepc_solver.cc +++ b/deal.II/source/lac/slepc_solver.cc @@ -50,7 +50,7 @@ namespace SLEPcWrappers : solver_control (cn), mpi_communicator (mpi_communicator), - target_eigenvalue (PETSC_NULL), + target_eigenvalue (0.), set_which (EPS_LARGEST_MAGNITUDE), set_problem (EPS_NHEP), opA (NULL), @@ -151,13 +151,17 @@ namespace SLEPcWrappers AssertThrow (ierr == 0, ExcSLEPcError(ierr)); } - // set transformation type if any + // if a spectral transformation is to be used, set the + // transformation and target the wanted eigenvalues if (transformation) - transformation->set_context (solver_data->eps); - - // set target eigenvalues to solve for - ierr = EPSSetTarget (solver_data->eps, target_eigenvalue); - AssertThrow (ierr == 0, ExcSLEPcError(ierr)); + { + // set transformation type if any + transformation->set_context (solver_data->eps); + + // set target eigenvalues to solve for + ierr = EPSSetTarget (solver_data->eps, target_eigenvalue); + AssertThrow (ierr == 0, ExcSLEPcError(ierr)); + } // set which portion of the eigenspectrum to solve for ierr = EPSSetWhichEigenpairs (solver_data->eps, set_which);