Skip to content
Snippets Groups Projects
Commit 5b3ec5be authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[staggerednewtoncontroller] Make check for matrix subblock sizes generic

parent e43cfe41
No related branches found
No related tags found
1 merge request!744Feature/linearsolver multitype matrix
......@@ -268,6 +268,26 @@ private:
return converged;
}
//! helper method to assure the MultiType matrix's sub blocks have the correct sizes
template<class JacobianMatrix>
bool checkMatrix_(const JacobianMatrix& A)
{
bool matrixHasCorrectSize = true;
using namespace Dune::Hybrid;
using namespace Dune::Indices;
forEach(A, [&matrixHasCorrectSize](const auto& rowOfMultiTypeMatrix)
{
const auto numRowsLeftMostBlock = rowOfMultiTypeMatrix[_0].N();
forEach(rowOfMultiTypeMatrix, [&matrixHasCorrectSize, &numRowsLeftMostBlock](const auto& subBlock)
{
if (subBlock.N() != numRowsLeftMostBlock)
matrixHasCorrectSize = false;
});
});
return matrixHasCorrectSize;
}
};
} // end namespace Dumux
......
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