diff --git a/dumux/freeflow/stokes/stokesproblem.hh b/dumux/freeflow/stokes/stokesproblem.hh index 3ed3ab221e09a0efc796719baf4eab525e68928f..a8d12caf7a880642e2730c61ecd6de9fed3b4eb8 100644 --- a/dumux/freeflow/stokes/stokesproblem.hh +++ b/dumux/freeflow/stokes/stokesproblem.hh @@ -82,7 +82,7 @@ public: * \param globalPos The position in global coordinates where the temperature should be specified. */ Scalar temperatureAtPos(const GlobalPosition &globalPos) const - { return asImp_()->temperature(); } + { return asImp_().temperature(); } /*! * \brief Returns the temperature within the domain. @@ -90,7 +90,7 @@ public: * This method MUST be overwritten by the actual problem. */ Scalar temperature() const - { return asImp_()->temperature(); }; + { DUNE_THROW(Dune::NotImplemented, "temperature() method not implemented by the actual problem"); }; /*! * \brief Returns the acceleration due to gravity. @@ -118,12 +118,12 @@ public: private: //! Returns the implementation of the problem (i.e. static polymorphism) - Implementation *asImp_() - { return static_cast<Implementation *>(this); } + Implementation &asImp_() + { return *static_cast<Implementation *>(this); } //! \copydoc asImp_() - const Implementation *asImp_() const - { return static_cast<const Implementation *>(this); } + const Implementation &asImp_() const + { return *static_cast<const Implementation *>(this); } GlobalPosition gravity_; };