]> https://gitweb.dealii.org/ - dealii.git/commitdiff
make sure vectors passed to EPSSetInitialSpace() are nonzero 2064/head
authorDenis Davydov <davydden@gmail.com>
Fri, 15 Jan 2016 08:23:34 +0000 (09:23 +0100)
committerDenis Davydov <davydden@gmail.com>
Fri, 15 Jan 2016 08:23:34 +0000 (09:23 +0100)
include/deal.II/lac/slepc_solver.h
source/lac/slepc_solver.cc

index ecb5cbf3291e3f69f57b4961a8759ef46a4269b8..47c46eaa8ef145e11a4b9109776c6c48663628e2 100644 (file)
@@ -791,6 +791,8 @@ namespace SLEPcWrappers
 
     for (unsigned int i = 0; i < this_initial_space.size(); i++)
       {
+        Assert(this_initial_space[i].l2_norm()>0.0,
+               ExcMessage("Initial vectors should be nonzero."));
         vecs[i] = this_initial_space[i];
       }
 
index 1a1d9ab707d638cee8e8ca42148afe08fdc7d7e5..d6495ac4691feaa23c0d0b89198c0c1b037e6cb8 100644 (file)
@@ -100,6 +100,9 @@ namespace SLEPcWrappers
   void
   SolverBase::set_initial_vector (const PETScWrappers::VectorBase &this_initial_vector)
   {
+    Assert(this_initial_vector.l2_norm()>0.0,
+           ExcMessage("Initial vector should be nonzero."));
+
     int ierr;
     Vec vec = this_initial_vector;
 #if DEAL_II_PETSC_VERSION_LT(3,1,0)

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.