Skip to content
Snippets Groups Projects
Commit 3bb59251 authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'cleanup/depr-warn-hybrid_2' into 'master'

[common][pdesolver] Fix Dune::Hybrid::size deprecation warning

Closes #872

See merge request !2066
parents bcee3f48 c913edc4
No related branches found
No related tags found
1 merge request!2066[common][pdesolver] Fix Dune::Hybrid::size deprecation warning
...@@ -25,12 +25,18 @@ ...@@ -25,12 +25,18 @@
#define DUMUX_COMMON_PDESOLVER_HH #define DUMUX_COMMON_PDESOLVER_HH
#include <memory> #include <memory>
#include <utility>
#include <dune/common/hybridutilities.hh> #include <dune/common/hybridutilities.hh>
#include <dumux/common/typetraits/matrix.hh>
#include <dumux/common/timeloop.hh> #include <dumux/common/timeloop.hh>
// forward declare
namespace Dune {
template <class FirstRow, class ... Args>
class MultiTypeBlockMatrix;
}
namespace Dumux { namespace Dumux {
/*! /*!
...@@ -107,16 +113,17 @@ protected: ...@@ -107,16 +113,17 @@ protected:
/*! /*!
* \brief Helper function to assure the MultiTypeBlockMatrix's sub-blocks have the correct sizes. * \brief Helper function to assure the MultiTypeBlockMatrix's sub-blocks have the correct sizes.
*/ */
template<class M> template <class FirstRow, class ... Args>
bool checkSizesOfSubMatrices(const M& A) const bool checkSizesOfSubMatrices(const Dune::MultiTypeBlockMatrix<FirstRow, Args...>& matrix) const
{ {
static_assert(isMultiTypeBlockMatrix<M>::value, "This function can only be used with MultiTypeBlockMatrix");
bool matrixHasCorrectSize = true; bool matrixHasCorrectSize = true;
using namespace Dune::Hybrid; using namespace Dune::Hybrid;
forEach(A, [&](const auto& row){ forEach(std::make_index_sequence<Dune::MultiTypeBlockMatrix<FirstRow, Args...>::N()>(), [&](const auto i)
{
const auto& row = matrix[i];
const auto numRowsLeftMostBlock = row[Dune::index_constant<0>{}].N(); const auto numRowsLeftMostBlock = row[Dune::index_constant<0>{}].N();
forEach(row, [&](const auto& subBlock){ forEach(row, [&](const auto& subBlock)
{
if (subBlock.N() != numRowsLeftMostBlock) if (subBlock.N() != numRowsLeftMostBlock)
matrixHasCorrectSize = false; matrixHasCorrectSize = false;
}); });
......
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