From: Denis Davydov Date: Fri, 15 Jan 2016 08:23:34 +0000 (+0100) Subject: make sure vectors passed to EPSSetInitialSpace() are nonzero X-Git-Tag: v8.4.0-rc2~91^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fc9cbc24f719bf58a7b9163f56e5680a712f9db;p=dealii.git make sure vectors passed to EPSSetInitialSpace() are nonzero --- diff --git a/include/deal.II/lac/slepc_solver.h b/include/deal.II/lac/slepc_solver.h index ecb5cbf329..47c46eaa8e 100644 --- a/include/deal.II/lac/slepc_solver.h +++ b/include/deal.II/lac/slepc_solver.h @@ -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]; } diff --git a/source/lac/slepc_solver.cc b/source/lac/slepc_solver.cc index 1a1d9ab707..d6495ac469 100644 --- a/source/lac/slepc_solver.cc +++ b/source/lac/slepc_solver.cc @@ -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)