]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fixed a bug in set_matrix_mode. 246/head
authorDenis Davydov <davydden@gmail.com>
Thu, 13 Nov 2014 09:17:55 +0000 (10:17 +0100)
committerDenis Davydov <davydden@gmail.com>
Tue, 18 Nov 2014 22:31:51 +0000 (23:31 +0100)
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
source/lac/slepc_spectral_transformation.cc

index 848b6481235ab6f2564105d13186c98e45c83de8..6bf9a4c13bed0eb317b00c78c8e7498b23444f27 100644 (file)
@@ -128,6 +128,8 @@ namespace SLEPcWrappers
     };
 
     std_cxx11::shared_ptr<TransformationData> transformation_data;
+
+    std_cxx11::shared_ptr<STMatMode> mat_mode;
   };
 
   /**
index e01696234b28d6c2853fa86a08eba93e77bc397b..0cd4d82d4dd3e5e505c7e693fc14117ae337b35b 100644 (file)
@@ -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 --------------------- */

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.