From b6d5ebefad60bc0b01cd5c8faefb2e137f51fbf9 Mon Sep 17 00:00:00 2001 From: "Dennis.Glaeser" <dennis.glaeser@iws.uni-stuttgart.de> Date: Wed, 4 Mar 2020 18:01:07 +0100 Subject: [PATCH] [mpfa][lambdafactory] remove no-longer needed interface arguments Since we store the effective coefficients in the volume variables we don't need the cumbersome extraction of permeabilities, diffusion coefficients etc. anymore. --- .../mpfa/omethod/localassembler.hh | 9 +++----- .../cellcentered/mpfa/tensorlambdafactory.hh | 21 ++++--------------- .../cellcentered/mpfa/couplingmanager.hh | 8 +------ .../facet/cellcentered/mpfa/localassembler.hh | 6 +++--- 4 files changed, 11 insertions(+), 33 deletions(-) diff --git a/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh b/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh index 89032385b7..21da128381 100644 --- a/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh +++ b/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh @@ -195,8 +195,7 @@ private: const auto& posLocalScv = iv.localScv(neighborScvIndices[0]); const auto& posGlobalScv = this->fvGeometry().scv(posLocalScv.gridScvIndex()); const auto& posVolVars = this->elemVolVars()[posGlobalScv]; - const auto& posElement = iv.element(neighborScvIndices[0]); - const auto tensor = getT(this->problem(), posElement, posVolVars, this->fvGeometry(), posGlobalScv); + const auto tensor = getT(posVolVars); // the omega factors of the "positive" sub volume Helper::resizeVector(wijk[faceIdx], /*no outside scvs present*/1); @@ -232,8 +231,7 @@ private: const auto& posLocalScv = iv.localScv(neighborScvIndices[0]); const auto& posGlobalScv = this->fvGeometry().scv(posLocalScv.gridScvIndex()); const auto& posVolVars = this->elemVolVars()[posGlobalScv]; - const auto& posElement = iv.element(neighborScvIndices[0]); - const auto tensor = getT(this->problem(), posElement, posVolVars, this->fvGeometry(), posGlobalScv); + const auto tensor = getT(posVolVars); // the omega factors of the "positive" sub volume Helper::resizeVector(wijk[faceIdx], neighborScvIndices.size()); @@ -292,8 +290,7 @@ private: const auto& negLocalScv = iv.localScv( neighborScvIndices[idxOnScvf] ); const auto& negGlobalScv = this->fvGeometry().scv(negLocalScv.gridScvIndex()); const auto& negVolVars = this->elemVolVars()[negGlobalScv]; - const auto& negElement = iv.element( neighborScvIndices[idxOnScvf] ); - const auto negTensor = getT(this->problem(), negElement, negVolVars, this->fvGeometry(), negGlobalScv); + const auto negTensor = getT(negVolVars); // On surface grids, use outside face for "negative" transmissibility calculation const auto& scvf = dim < dimWorld ? this->fvGeometry().flipScvf(curGlobalScvf.index(), idxInOutside) diff --git a/dumux/discretization/cellcentered/mpfa/tensorlambdafactory.hh b/dumux/discretization/cellcentered/mpfa/tensorlambdafactory.hh index f7fb465e29..c40a46ddc9 100644 --- a/dumux/discretization/cellcentered/mpfa/tensorlambdafactory.hh +++ b/dumux/discretization/cellcentered/mpfa/tensorlambdafactory.hh @@ -61,11 +61,7 @@ public: //! return void lambda here static auto getAdvectionLambda() { - return [] (const auto& problem, - const auto& element, - const auto& volVars, - const auto& fvGeometry, - const auto& scv) + return [] (const auto& volVars) { return volVars.permeability(); }; } @@ -73,11 +69,7 @@ public: template<class EffDiffModel> static auto getDiffusionLambda(unsigned int phaseIdx, unsigned int compIdx) { - return [phaseIdx, compIdx] (const auto& problem, - const auto& element, - const auto& volVars, - const auto& fvGeometry, - const auto& scv) + return [phaseIdx, compIdx] (const auto& volVars) { return Deprecated::template effectiveDiffusionCoefficient<EffDiffModel>( volVars, phaseIdx, phaseIdx, compIdx); }; } @@ -86,13 +78,8 @@ public: template<class ThermalConductivityModel> static auto getHeatConductionLambda() { - return [] (const auto& problem, - const auto& element, - const auto& volVars, - const auto& fvGeometry, - const auto& scv) - { return Deprecated::template effectiveThermalConductivity<ThermalConductivityModel>( - volVars, problem.spatialParams(), element, fvGeometry, scv); }; + return [] (const auto& volVars) + { return volVars.effectiveThermalConductivity(); }; } }; diff --git a/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh b/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh index 73c1707a4d..d5dbbdd8b8 100644 --- a/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh +++ b/dumux/multidomain/facet/cellcentered/mpfa/couplingmanager.hh @@ -149,13 +149,7 @@ public: const auto& idxInContext = std::distance( s.begin(), std::find(s.begin(), s.end(), lowDimElemIdx) ); assert(std::find(s.begin(), s.end(), lowDimElemIdx) != s.end()); - const auto& lowDimProblem = this->problem(lowDimId); - const auto& lowDimElement = lowDimProblem.gridGeometry().element(lowDimElemIdx); - const auto& lowDimVolVars = this->bulkCouplingContext().lowDimVolVars[idxInContext]; - const auto& lowDimFvGeometry = this->bulkCouplingContext().lowDimFvGeometries[idxInContext]; - - // we assume constant parameters on the element and use the first scv within the low dim element. - return getT(lowDimProblem, lowDimElement, lowDimVolVars, lowDimFvGeometry, *scvs(lowDimFvGeometry).begin()); + return getT(this->bulkCouplingContext().lowDimVolVars[idxInContext]); } using ParentType::evalCouplingResidual; diff --git a/dumux/multidomain/facet/cellcentered/mpfa/localassembler.hh b/dumux/multidomain/facet/cellcentered/mpfa/localassembler.hh index a6e65c49b0..65a56ea265 100644 --- a/dumux/multidomain/facet/cellcentered/mpfa/localassembler.hh +++ b/dumux/multidomain/facet/cellcentered/mpfa/localassembler.hh @@ -324,7 +324,7 @@ private: const auto& posGlobalScv = this->fvGeometry().scv(posLocalScv.gridScvIndex()); const auto& posVolVars = this->elemVolVars()[posGlobalScv]; const auto& posElement = iv.element(neighborScvIndices[0]); - const auto tensor = getT(this->problem(), posElement, posVolVars, this->fvGeometry(), posGlobalScv); + const auto tensor = getT(posVolVars); // the omega factors of the "positive" sub volume Helper::resizeVector(wijk[faceIdx], /*no outside scvs present*/1); @@ -363,7 +363,7 @@ private: const auto& posGlobalScv = this->fvGeometry().scv(posLocalScv.gridScvIndex()); const auto& posVolVars = this->elemVolVars()[posGlobalScv]; const auto& posElement = iv.element(neighborScvIndices[0]); - const auto tensor = getT(this->problem(), posElement, posVolVars, this->fvGeometry(), posGlobalScv); + const auto tensor = getT(posVolVars); // the omega factors of the "positive" sub volume Helper::resizeVector(wijk[faceIdx], neighborScvIndices.size()); @@ -429,7 +429,7 @@ private: const auto& negGlobalScv = this->fvGeometry().scv(negLocalScv.gridScvIndex()); const auto& negVolVars = this->elemVolVars()[negGlobalScv]; const auto& negElement = iv.element( neighborScvIndices[idxOnScvf] ); - const auto negTensor = getT(this->problem(), negElement, negVolVars, this->fvGeometry(), negGlobalScv); + const auto negTensor = getT(negVolVars); // On surface grids, use outside face for "negative" transmissibility calculation const auto& scvf = dim < dimWorld ? this->fvGeometry().flipScvf(curGlobalScvf.index(), idxInOutside) -- GitLab