From 0e56fefe117332de79ac9cde4ce393cf1823726f Mon Sep 17 00:00:00 2001
From: Thomas Fetzer <thomas.fetzer@iws.uni-stuttgart.de>
Date: Thu, 10 Dec 2015 14:15:41 +0100
Subject: [PATCH] Remove code which was partially unused.

Removed code for the treatment of corners at the coupling/outer boundary edge. The code was very different between isothermal and non-isothermal case. The per-se more used and more trustworthy non-isothermal case had some contradicting if clauses.

However in most cases used at the LH2 this part of code remains unused.
---
 .../2p2ccouplinglocalresidual.hh              | 34 +----------------
 .../2p2cnicouplinglocalresidual.hh            | 37 +------------------
 2 files changed, 3 insertions(+), 68 deletions(-)

diff --git a/dumux/multidomain/couplinglocalresiduals/2p2ccouplinglocalresidual.hh b/dumux/multidomain/couplinglocalresiduals/2p2ccouplinglocalresidual.hh
index cd0578caff..da0f26d8dc 100644
--- a/dumux/multidomain/couplinglocalresiduals/2p2ccouplinglocalresidual.hh
+++ b/dumux/multidomain/couplinglocalresiduals/2p2ccouplinglocalresidual.hh
@@ -114,39 +114,6 @@ public:
                     if (vIdx != idx)
                         continue;
 
-                    //for the corner points, the boundary flux across the vertical non-coupling boundary faces
-                    //has to be calculated to fulfill the mass balance
-                    //convert suddomain intersection into multidomain intersection and check whether it is an outer boundary
-                    if(!GridView::Grid::multiDomainIntersection(intersection).neighbor()
-                            && this->boundaryHasMortarCoupling_(this->bcTypes_(idx)))//this->boundaryHasNeumann_(this->bcTypes_(idx)))
-                    {
-                        const DimVector& globalPos = this->fvGeometry_().subContVol[idx].global;
-                        //problem specific function, in problem orientation of interface is known
-                        if(this->problem_().isInterfaceCornerPoint(globalPos))
-                        {
-                            //check whether the second boundary node on the vertical edge is Neumann-Null
-                            const int numVertices = refElement.size(dim);
-                            bool evalBoundaryFlux = false;
-                            for (int equationIdx = 0; equationIdx < numEq; ++equationIdx)
-                            {
-                                for(int i= 0; i < numVertices; i++)
-                                {
-                                    //if vertex is on boundary and not the coupling vertex: check whether an outflow condition is set
-                                    if(this->model_().onBoundary(this->element_(), i) && i!=vIdx)
-                                        if (!this->bcTypes_(i).isOutflow(equationIdx))
-                                            evalBoundaryFlux = true;
-                                }
-
-                                PrimaryVariables values(0.0);
-                                //calculate the actual boundary fluxes and add to residual
-                                this->asImp_()->computeFlux(values, boundaryFaceIdx, true /*on boundary*/);
-                                if(evalBoundaryFlux)
-                                    this->residual_[idx][equationIdx] += values[equationIdx];
-                            }
-
-                        }
-                    }
-
                     if (boundaryHasCoupling_(this->bcTypes_(idx)))
                         evalCouplingVertex_(idx);
                 }
@@ -316,6 +283,7 @@ public:
     /*!
      * \brief Check if one of the boundary conditions is Neumann.
      */
+    DUNE_DEPRECATED_MSG("boundaryHasNeumann_() is unused in dumux and therefore deprecated")
     bool boundaryHasNeumann_(const BoundaryTypes& bcTypes) const
     {
         for (int eqIdx = 0; eqIdx < numEq; ++eqIdx)
diff --git a/dumux/multidomain/couplinglocalresiduals/2p2cnicouplinglocalresidual.hh b/dumux/multidomain/couplinglocalresiduals/2p2cnicouplinglocalresidual.hh
index 80971dc467..c6441ab018 100644
--- a/dumux/multidomain/couplinglocalresiduals/2p2cnicouplinglocalresidual.hh
+++ b/dumux/multidomain/couplinglocalresiduals/2p2cnicouplinglocalresidual.hh
@@ -109,47 +109,13 @@ public:
                 // loop over the single vertices on the current face
                 for (int faceVertexIdx = 0; faceVertexIdx < numFaceVertices; ++faceVertexIdx)
                 {
-                    const int vIdx = refElement.subEntity(fIdx, 1, faceVertexIdx, dim);
                     const int boundaryFaceIdx = this->fvGeometry_().boundaryFaceIndex(fIdx, faceVertexIdx);
+                    const int vIdx = refElement.subEntity(fIdx, 1, faceVertexIdx, dim);
                     // only evaluate, if we consider the same face vertex as in the outer
                     // loop over the element vertices
                     if (vIdx != idx)
                         continue;
 
-                    //for the corner points, the boundary flux across the vertical non-coupling boundary faces
-                    //has to be calculated to fulfill the mass balance
-                    //convert suddomain intersection into multidomain intersection and check whether it is an outer boundary
-                    if(!GridView::Grid::multiDomainIntersection(intersection).neighbor()
-                             && this->boundaryHasNeumann_(this->bcTypes_(idx)))
-                     {
-                         const DimVector& globalPos = this->fvGeometry_().subContVol[idx].global;
-                         //problem specific function, in problem orientation of interface is known
-                         if(this->problem_().isInterfaceCornerPoint(globalPos))
-                         {
-                             //check whether the second boundary node on the vertical edge is Neumann-Null
-                             const int numVertices = refElement.size(dim);
-                             bool evalBoundaryFlux = false;
-                             for (int equationIdx = 0; equationIdx < numEq; ++equationIdx)
-                             {
-                                 for(int i= 0; i < numVertices; i++)
-                                 {
-                                     //if vertex is on boundary and not the coupling vertex: check whether a Neumann condition is set
-                                     //in case of Neumann Null the boundary flux must not be calculated
-                                     if(this->model_().onBoundary(this->element_(), i) && i!=vIdx)
-                                         if (!this->bcTypes_(i).isNeumann(equationIdx) && !this->bcTypes_(i).isOutflow(equationIdx))
-                                             evalBoundaryFlux = true;
-                                 }
-
-                                 PrimaryVariables values(0.0);
-                                 //calculate the actual boundary fluxes and add to residual
-                                 this->asImp_()->computeFlux(values, boundaryFaceIdx, true /*on boundary*/);
-                                 if(evalBoundaryFlux)
-                                     this->residual_[idx][equationIdx] += values[equationIdx];
-                             }
-
-                         }
-                     }
-
                     if (boundaryHasCoupling_(this->bcTypes_(idx)))
                         evalCouplingVertex_(idx);
                 }
@@ -315,6 +281,7 @@ public:
     /*!
      * \brief Check if one of the boundary conditions is Neumann.
      */
+    DUNE_DEPRECATED_MSG("boundaryHasNeumann_ is unused in dumux and therefore deprecated")
     bool boundaryHasNeumann_(const BoundaryTypes& bcTypes) const
     {
         bool hasNeumann = false;
-- 
GitLab