diff --git a/dune/xt/functions/base/visualization.hh b/dune/xt/functions/base/visualization.hh index db5602a04181c7f1d98b0e17411c2ddbf2b9cbaa..c078d0744f0062b1eb681141885a73a366ecf544 100644 --- a/dune/xt/functions/base/visualization.hh +++ b/dune/xt/functions/base/visualization.hh @@ -148,11 +148,12 @@ public: double evaluate(const int& comp, const RangeType& val) const override final { - return val[comp]; + DUNE_THROW_IF(comp != 0, Dune::InvalidStateException, "This visualizer plots only a single component!"); + return val[comp_]; } private: - int comp_; + const int comp_; }; // class ComponentVisualizer