From cf94c701cd18d7373bba9fa44d4b11c931264a78 Mon Sep 17 00:00:00 2001
From: DennisGlaeser <dennis.glaeser@iws.uni-stuttgart.de>
Date: Mon, 13 Feb 2017 15:18:51 +0100
Subject: [PATCH] [mpfa][iavol] make other mpfa methods using o-method on the
 boundaries work again

We now call the Implementation from the o-method interaction volume because we need
to incorporate some terms in the problems with facet coupling.
Todo: Problems using interior interaction volumes that inherit from the o-method
specialization AND use the o-method on the boundaries do not work at the moment. We
would have to tell the o-method the actual implementation somehow introducing a new
template parameter for the implementation.
---
 .../cellcentered/mpfa/omethod/interactionvolume.hh  |  7 +++++--
 .../mpfa/omethodfps/interactionvolume.hh            | 13 ++++---------
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh b/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh
index 75344066b6..532846a65f 100644
--- a/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh
+++ b/dumux/discretization/cellcentered/mpfa/omethod/interactionvolume.hh
@@ -97,10 +97,13 @@ public:
 template<class TypeTag, class Traits>
 class CCMpfaOInteractionVolume : public CCMpfaInteractionVolumeBase<TypeTag, Traits>
 {
-    // The interaction volume implementation has to be friend,
+    // The interaction volume implementations have to be friend,
     // because some methods use the mpfa-o interaction volume as base
     friend typename GET_PROP_TYPE(TypeTag, InteractionVolume);
-    using Implementation = typename GET_PROP_TYPE(TypeTag, InteractionVolume);
+    friend typename Traits::BoundaryInteractionVolume;
+
+    // We assume the actual implementation always to be the boundary-specific implementation
+    using Implementation = typename Traits::BoundaryInteractionVolume;
     using ParentType = CCMpfaInteractionVolumeBase<TypeTag, Traits>;
 
     using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
diff --git a/dumux/discretization/cellcentered/mpfa/omethodfps/interactionvolume.hh b/dumux/discretization/cellcentered/mpfa/omethodfps/interactionvolume.hh
index 6a905987d6..add7c081b8 100644
--- a/dumux/discretization/cellcentered/mpfa/omethodfps/interactionvolume.hh
+++ b/dumux/discretization/cellcentered/mpfa/omethodfps/interactionvolume.hh
@@ -43,12 +43,8 @@ class CCMpfaOFpsInteractionVolumeTraits : public CCMpfaOInteractionVolumeTraits<
 public:
     // Interior boundaries can not yet be handled by the currend o-method fps implementation
     // In that case we use the o-interactionvolume, otherwise we use its own interaction volumes at the boundary
-    // TODO Fix the std::conditional
-    using BoundaryInteractionVolume = typename CCMpfaOInteractionVolumeTraits<TypeTag>::BoundaryInteractionVolume;
-    // using BoundaryInteractionVolume = typename std::conditional<GET_PROP_VALUE(TypeTag, EnableInteriorBoundaries),
-    //                                                             typename CCMpfaOInteractionVolumeTraits<TypeTag>::BoundaryInteractionVolume,
-    //                                                             typename CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethodFps>
-    //                                                             >::type;
+    // TODO Implement this using std::conditional
+    using BoundaryInteractionVolume = CCMpfaInteractionVolumeImplementation<TypeTag, MpfaMethods::oMethodFps>;
 
     // The local sub-control volume type differs from the standard mpfa-o method
     using LocalScvType = CCMpfaOFpsLocalScv<TypeTag>;
@@ -202,8 +198,7 @@ private:
         auto&& localScv = this->localScv_(localScvIdx);
         auto&& globalScv = this->fvGeometry_().scv(localScv.globalIndex());
         auto&& element = this->localElement_(localScvIdx);
-        auto D = makeTensor_(getTensor(element, this->elemVolVars_()[globalScv], globalScv));
-
+        auto D = makeTensor_(getTensor(this->problem_(), element, this->elemVolVars_()[globalScv], this->fvGeometry_(), globalScv));
         // the local finite element basis
         const auto& localBasis = feCache_.get(localScv.geometry().type()).localBasis();
 
@@ -248,7 +243,7 @@ private:
             auto&& localScv = this->localScv_(localScvIdx);
             auto&& globalScv = this->fvGeometry_().scv(localScv.globalIndex());
             auto&& element = this->localElement_(localScvIdx);;
-            auto D = makeTensor_(getTensor(element, this->elemVolVars_()[globalScv], globalScv));
+            auto D = makeTensor_(getTensor(this->problem_(), element, this->elemVolVars_()[globalScv], this->fvGeometry_(), globalScv));
 
             // the local finite element bases of the scvs
             const auto& localBasis = feCache_.get(localScv.geometry().type()).localBasis();
-- 
GitLab