From: Denis Davydov Date: Thu, 13 Nov 2014 09:17:55 +0000 (+0100) Subject: fixed a bug in set_matrix_mode. X-Git-Tag: v8.2.0-rc1~58^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F246%2Fhead;p=dealii.git fixed a bug in set_matrix_mode. STSetMatMode shall be called only after transformation_data->st is initialised. Thus, we need to store the desired STMatMode untill set_context is called from the solver object. --- diff --git a/include/deal.II/lac/slepc_spectral_transformation.h b/include/deal.II/lac/slepc_spectral_transformation.h index 848b648123..6bf9a4c13b 100644 --- a/include/deal.II/lac/slepc_spectral_transformation.h +++ b/include/deal.II/lac/slepc_spectral_transformation.h @@ -128,6 +128,8 @@ namespace SLEPcWrappers }; std_cxx11::shared_ptr transformation_data; + + std_cxx11::shared_ptr mat_mode; }; /** diff --git a/source/lac/slepc_spectral_transformation.cc b/source/lac/slepc_spectral_transformation.cc index e01696234b..0cd4d82d4d 100644 --- a/source/lac/slepc_spectral_transformation.cc +++ b/source/lac/slepc_spectral_transformation.cc @@ -50,12 +50,19 @@ namespace SLEPcWrappers AssertThrow (ierr == 0, SolverBase::ExcSLEPcError(ierr)); set_transformation_type(transformation_data->st); + + // if mat_mode has been set, + // pass it to ST object + if (mat_mode.get() != 0) + { + int ierr = STSetMatMode(transformation_data->st,*(mat_mode.get()) ); + AssertThrow (ierr == 0, SolverBase::ExcSLEPcError(ierr)); + } } void TransformationBase::set_matrix_mode(const STMatMode mode) { - int ierr = STSetMatMode(transformation_data->st,mode); - AssertThrow (ierr == 0, SolverBase::ExcSLEPcError(ierr)); + mat_mode.reset (new STMatMode(mode)); } /* ------------------- TransformationShift --------------------- */