From 0a8470232de3742acc9f1783ce904b9bdaa961b3 Mon Sep 17 00:00:00 2001 From: Max Kahnt <max.kahnt@fu-berlin.de> Date: Fri, 22 Sep 2017 18:47:09 +0200 Subject: [PATCH] Allow to set MatrixType via template parameter. --- dune/solvers/norms/h1seminorm.hh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dune/solvers/norms/h1seminorm.hh b/dune/solvers/norms/h1seminorm.hh index f0f6146c..99b53e49 100644 --- a/dune/solvers/norms/h1seminorm.hh +++ b/dune/solvers/norms/h1seminorm.hh @@ -11,13 +11,14 @@ #include "norm.hh" //! Specialisation of the EnergyNorm class to identity blocks -template<class VectorType> -class H1SemiNorm : public Norm<VectorType> +template<class V, class M = Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> >> +class H1SemiNorm : public Norm<V> { public: + typedef V VectorType; H1SemiNorm() : matrix_(NULL) {} - H1SemiNorm(const Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> >& matrix) + H1SemiNorm(const MatrixType& matrix) : matrix_(&matrix) { assert(matrix.N() == matrix.M()); @@ -69,7 +70,7 @@ public: return std::sqrt(sum); } - const Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> >* matrix_; + const MatrixType* matrix_; }; -- GitLab