From: Denis Davydov Date: Thu, 17 Sep 2015 20:16:31 +0000 (+0200) Subject: fix a bug in Arpack class related to wrong eigenvectors X-Git-Tag: v8.4.0-rc2~396^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0e08046dd06b428541447d9a9dece1be11873df;p=dealii.git fix a bug in Arpack class related to wrong eigenvectors Extend the unit test to check that we indeed have eigenvectors. --- diff --git a/include/deal.II/lac/arpack_solver.h b/include/deal.II/lac/arpack_solver.h index dfb6bfc9fc..42739b43d3 100644 --- a/include/deal.II/lac/arpack_solver.h +++ b/include/deal.II/lac/arpack_solver.h @@ -528,7 +528,7 @@ void ArpackSolver::solve ( const unsigned int n_eigenvecs = eigenvectors.size(); for (size_type i=0; i Ax(eigenfunctions[0]), Bx(eigenfunctions[0]); + for (unsigned int i=0; i < eigenfunctions.size(); ++i) + { + mass_matrix.vmult(Bx,eigenfunctions[i]); + + for (unsigned int j=0; j < eigenfunctions.size(); j++) + Assert( std::abs( eigenfunctions[j] * Bx - (i==j))< 1e-8, + ExcMessage(std::to_string(eigenfunctions[j] * Bx))); + + stiffness_matrix.vmult(Ax,eigenfunctions[i]); + Ax.add(-1.0*std::real(eigenvalues[i]),Bx); + Assert (Ax.l2_norm() < 1e-8, + ExcMessage(std::to_string(Ax.l2_norm()))); + } + } for (unsigned int i=0; i