Commit 1dbe1fc3 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

[linear] add norm to base class

parent ba2f0ecd
......@@ -25,6 +25,7 @@
#define DUMUX_LINEAR_SOLVER_HH
#include <dune/common/exceptions.hh>
#include <dune/istl/scalarproducts.hh>
#include <dumux/common/parameters.hh>
namespace Dumux {
......@@ -71,6 +72,17 @@ public:
DUNE_THROW(Dune::NotImplemented, "Linear solver doesn't implement a solve method!");
}
template<class Vector>
auto norm(const Vector& x) const
{
if (Dune::MPIHelper::getCollectiveCommunication().size() > 1)
DUNE_THROW(Dune::NotImplemented, "norm in parallel");
static const Dune::SeqScalarProduct<Vector> sp;
return sp.norm(x);
}
//! the name of the linear solver
std::string name() const
{ return "unknown solver"; }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment