From adc69a4bac01448053e28210ee819a759a5043cb Mon Sep 17 00:00:00 2001 From: DennisGlaeser <dennis.glaeser@iws.uni-stuttgart.de> Date: Wed, 6 Dec 2017 15:32:32 +0100 Subject: [PATCH] [box][darcyslaw] use vtmv function where possible --- dumux/discretization/box/darcyslaw.hh | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/dumux/discretization/box/darcyslaw.hh b/dumux/discretization/box/darcyslaw.hh index 4d8eadc42f..e39e95ad0e 100644 --- a/dumux/discretization/box/darcyslaw.hh +++ b/dumux/discretization/box/darcyslaw.hh @@ -111,8 +111,7 @@ public: gradP.axpy(-rho, problem.gravityAtPos(scvf.center())); // apply the permeability and return the flux - const auto KGradP = applyPermeability_(K, gradP); - return -1.0*(KGradP*scvf.unitOuterNormal())*scvf.area(); + return -1.0*vtmv(scvf.unitOuterNormal(), K, gradP)*scvf.area(); } // compute transmissibilities ti for analytical jacobians @@ -140,26 +139,10 @@ public: std::vector<Scalar> ti(fvGeometry.numScv()); for (const auto& scv : scvs(fvGeometry)) ti[scv.indexInElement()] = - -1.0*(applyPermeability_(K, fluxVarCache.gradN(scv.indexInElement())) - *scvf.unitOuterNormal())*scvf.area(); + -1.0*scvf.area()*vtmv(scvf.unitOuterNormal(), K, fluxVarCache.gradN(scv.indexInElement())); return ti; } - -private: - inline static GlobalPosition applyPermeability_(const DimWorldMatrix& K, const GlobalPosition& gradI) - { - GlobalPosition result(0.0); - K.mv(gradI, result); - return result; - } - - inline static GlobalPosition applyPermeability_(const Scalar k, const GlobalPosition& gradI) - { - GlobalPosition result(gradI); - result *= k; - return result; - } }; } // end namespace Dumux -- GitLab