Skip to content
Snippets Groups Projects
Commit e8d16384 authored by Oliver Sander's avatar Oliver Sander
Browse files

Make sure the vectors x and b handed to the 'apply' method have the correct size

This avoids strange bugs when using the setSubMatrix method: that method
automatically removes rows and columns from the matrix, and expects _the user_
to do the same for the x and b vectors.
parent 1007ae18
No related branches found
No related tags found
No related merge requests found
......@@ -314,6 +314,11 @@ namespace Dune {
*/
virtual void apply(domain_type& x, range_type& b, InverseOperatorResult& res)
{
if (umfpackMatrix_.N() != b.size())
DUNE_THROW(Dune::ISTLError, "Size of right-hand-side vector b does not match the number of matrix rows!");
if (umfpackMatrix_.M() != x.size())
DUNE_THROW(Dune::ISTLError, "Size of solution vector x does not match the number of matrix columns!");
double UMF_Apply_Info[UMFPACK_INFO];
Caller::solve(UMFPACK_A,
umfpackMatrix_.getColStart(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment