]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Restrict the possible options for eigenvalues in (P)Arpack 3257/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Mon, 17 Oct 2016 15:46:11 +0000 (17:46 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Mon, 17 Oct 2016 23:05:43 +0000 (01:05 +0200)
include/deal.II/lac/arpack_solver.h
include/deal.II/lac/parpack_solver.h

index c2b1ce06fbf790692d3bfee7128f8a6c9af514aa..b3507eb7c3af276233f53ab1e4e96826efd4052e 100644 (file)
@@ -311,7 +311,20 @@ AdditionalData (const unsigned int number_of_arnoldi_vectors,
   number_of_arnoldi_vectors(number_of_arnoldi_vectors),
   eigenvalue_of_interest(eigenvalue_of_interest),
   symmetric(symmetric)
-{}
+{
+  //Check for possible options for symmetric problems
+  if (symmetric)
+    {
+      Assert(eigenvalue_of_interest!=largest_real_part,
+             ExcMessage("'largest real part' can only be used for non-symmetric problems!"));
+      Assert(eigenvalue_of_interest!=smallest_real_part,
+             ExcMessage("'smallest real part' can only be used for non-symmetric problems!"));
+      Assert(eigenvalue_of_interest!=largest_imaginary_part,
+             ExcMessage("'largest imaginary part' can only be used for non-symmetric problems!"));
+      Assert(eigenvalue_of_interest!=smallest_imaginary_part,
+             ExcMessage("'smallest imaginary part' can only be used for non-symmetric problems!"));
+    }
+}
 
 
 inline
index 9a276aa9ee00a42c5899712ab9544bcbf911fdbd..d89d16c4f5a67d06e8549d2b594385ca68300703 100644 (file)
@@ -496,7 +496,20 @@ AdditionalData (const unsigned int     number_of_arnoldi_vectors,
   number_of_arnoldi_vectors(number_of_arnoldi_vectors),
   eigenvalue_of_interest(eigenvalue_of_interest),
   symmetric(symmetric)
-{}
+{
+  //Check for possible options for symmetric problems
+  if (symmetric)
+    {
+      Assert(eigenvalue_of_interest!=largest_real_part,
+             ExcMessage("'largest real part' can only be used for non-symmetric problems!"));
+      Assert(eigenvalue_of_interest!=smallest_real_part,
+             ExcMessage("'smallest real part' can only be used for non-symmetric problems!"));
+      Assert(eigenvalue_of_interest!=largest_imaginary_part,
+             ExcMessage("'largest imaginary part' can only be used for non-symmetric problems!"));
+      Assert(eigenvalue_of_interest!=smallest_imaginary_part,
+             ExcMessage("'smallest imaginary part' can only be used for non-symmetric problems!"));
+    }
+}
 
 template <typename VectorType>
 PArpackSolver<VectorType>::PArpackSolver (SolverControl        &control,
@@ -657,7 +670,6 @@ void PArpackSolver<VectorType>::solve
   // "LI" largest imaginary part
   // "SI" smallest imaginary part
   // "BE" both ends of spectrum simultaneous
-
   char which[3];
   switch (additional_data.eigenvalue_of_interest)
     {

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.