From 99839e439b7cf7028a985225e106f9a60a4138be Mon Sep 17 00:00:00 2001
From: Markus Wolff <markus.wolff@twt-gmbh.de>
Date: Tue, 10 Dec 2013 15:29:55 +0000
Subject: [PATCH] Internal functions are now called via the implementation
 (asImp_()). This allows to overload the functions in derived classes.

   - reviewed by Beatrix



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@12156 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/decoupled/2p/transport/fv/fvsaturation2p.hh | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh b/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh
index 5d92a7f74e..769cb4c007 100644
--- a/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh
+++ b/dumux/decoupled/2p/transport/fv/fvsaturation2p.hh
@@ -65,6 +65,8 @@ template<class TypeTag>
 class FVSaturation2P: public FVTransport<TypeTag>
 {
     typedef FVTransport<TypeTag> ParentType;
+    typedef typename GET_PROP_TYPE(TypeTag, TransportModel) Implementation;
+
     typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
 
     enum
@@ -276,7 +278,7 @@ public:
         int size = problem_.gridView().size(0);
         for (int i = 0; i < size; i++)
         {
-            updateSaturationSolution(i, updateVec[i][0], dt);
+            asImp_().updateSaturationSolution(i, updateVec[i][0], dt);
         }
     }
 
@@ -290,7 +292,7 @@ public:
         int size = problem_.gridView().size(0);
         for (int i = 0; i < size; i++)
         {
-            updateSaturationSolution(i, updateVec[i][0], dt);
+            asImp_().updateSaturationSolution(i, updateVec[i][0], dt);
         }
     }
 
@@ -478,6 +480,14 @@ public:
     }
 
 private:
+    //! Returns the implementation of the problem (i.e. static polymorphism)
+    Implementation &asImp_()
+    { return *static_cast<Implementation *>(this); }
+
+    //! \copydoc Dumux::IMPETProblem::asImp_()
+    const Implementation &asImp_() const
+    { return *static_cast<const Implementation *>(this); }
+
     Problem& problem_;
     Dune::shared_ptr<Velocity> velocity_;
     Dune::shared_ptr<CapillaryFlux> capillaryFlux_;
-- 
GitLab