Skip to content
Snippets Groups Projects
Commit e25671cf authored by Christoph Grüninger's avatar Christoph Grüninger Committed by Steffen Müthing
Browse files

[superlu] Ensure vectors x and b handed to 'apply' have same size


Similar to commit e8d16384 which
added the same for UMFPack.
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.

(cherry picked from commit 1a2f4d0f)
Signed-off-by: default avatarSteffen Müthing <muething@dune-project.org>
parent 6de3455c
No related branches found
No related tags found
No related merge requests found
......@@ -561,6 +561,10 @@ namespace Dune
void SuperLU<BCRSMatrix<FieldMatrix<T,n,m>,A> >
::apply(domain_type& x, range_type& b, InverseOperatorResult& res)
{
if (mat.N() != b.size())
DUNE_THROW(ISTLError, "Size of right-hand-side vector b does not match the number of matrix rows!");
if (mat.M() != x.size())
DUNE_THROW(ISTLError, "Size of solution vector x does not match the number of matrix columns!");
if(mat.M()+mat.N()==0)
DUNE_THROW(ISTLError, "Matrix of SuperLU is null!");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment