Skip to content
Snippets Groups Projects
Commit f9aede6e authored by Christian Engwer's avatar Christian Engwer
Browse files

Merge branch 'feature/FS1724-fix-range-checks' into 'master'

[bugfix] fix broken assertion.

This patch fixes the errornous commits
e8d16384
1a2f4d0f

The introduced range checks were plain wring, as they neglected the nested structure of the
BlockVector. We now use `b.dim()` to get the flat size.

This fixes flyspray/FS#1724.

See merge request !12
parents 1c099fda 3aed940e
Branches
Tags
No related merge requests found
......@@ -561,11 +561,11 @@ namespace Dune
void SuperLU<BCRSMatrix<FieldMatrix<T,n,m>,A> >
::apply(domain_type& x, range_type& b, InverseOperatorResult& res)
{
if (mat.N() != b.size())
if (mat.N() != b.dim())
DUNE_THROW(ISTLError, "Size of right-hand-side vector b does not match the number of matrix rows!");
if (mat.M() != x.size())
if (mat.M() != x.dim())
DUNE_THROW(ISTLError, "Size of solution vector x does not match the number of matrix columns!");
if(mat.M()+mat.N()==0)
if (mat.M()+mat.N()==0)
DUNE_THROW(ISTLError, "Matrix of SuperLU is null!");
SuperMatrix* mB = &B;
......@@ -577,7 +577,7 @@ namespace Dune
SuperLUDenseMatChooser<T>::create(&X, (int)mat.N(), 1, reinterpret_cast<T*>(&x[0]), (int)mat.N(), SLU_DN, GetSuperLUType<T>::type, SLU_GE);
first=false;
}else{
((DNformat*) B.Store)->nzval=&b[0];
((DNformat*)B.Store)->nzval=&b[0];
((DNformat*)X.Store)->nzval=&x[0];
}
} else {
......
......@@ -314,9 +314,9 @@ namespace Dune {
*/
virtual void apply(domain_type& x, range_type& b, InverseOperatorResult& res)
{
if (umfpackMatrix_.N() != b.size())
if (umfpackMatrix_.N() != b.dim())
DUNE_THROW(Dune::ISTLError, "Size of right-hand-side vector b does not match the number of matrix rows!");
if (umfpackMatrix_.M() != x.size())
if (umfpackMatrix_.M() != x.dim())
DUNE_THROW(Dune::ISTLError, "Size of solution vector x does not match the number of matrix columns!");
double UMF_Apply_Info[UMFPACK_INFO];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment