From cd93c2a5d3e570d8a42e11c2afc57ec133e6b56a Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 13 Nov 2014 10:17:55 +0100 Subject: [PATCH] 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. --- include/deal.II/lac/slepc_spectral_transformation.h | 2 ++ source/lac/slepc_spectral_transformation.cc | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) 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 --------------------- */ -- 2.39.5