From af46651a4427199bd0ada37416bd3184424f30e2 Mon Sep 17 00:00:00 2001
From: Klaus Mosthaf <klmos@env.dtu.dk>
Date: Fri, 8 Nov 2013 13:14:04 +0000
Subject: [PATCH] temperature method in stokesproblem thows an error, if called
 an not implemented. Changed asImp function according to e.g.
 implicitproblem.hh

Approved by Bernd and reviewed by Markus.

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@11940 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/freeflow/stokes/stokesproblem.hh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dumux/freeflow/stokes/stokesproblem.hh b/dumux/freeflow/stokes/stokesproblem.hh
index 3ed3ab221e..a8d12caf7a 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_;
 };
-- 
GitLab