diff --git a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh index b2fd78636c8170efe5544b0f897cd6d562ca3555..82fceb984e6b13649ec1f527832e59fb9ab0499a 100644 --- a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh +++ b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh @@ -443,7 +443,6 @@ private: localAssembler.assembleMatrices(handle.advectionHandle(), iv, LambdaFactory::getAdvectionLambda()); // assemble pressure vectors - const auto& evv = &elemVolVars(); for (unsigned int pIdx = 0; pIdx < ModelTraits::numPhases(); ++pIdx) { // set context in handle @@ -456,7 +455,7 @@ private: localAssembler.assembleGravity(handle.advectionHandle(), iv, getRho); // reassemble pressure vector - auto getPressure = [&evv, pIdx] (auto volVarIdx) { return (evv->operator[](volVarIdx)).pressure(pIdx); }; + auto getPressure = [pIdx] (const auto& volVars) { return volVars.pressure(pIdx); }; localAssembler.assembleU(handle.advectionHandle(), iv, getPressure); } } @@ -485,9 +484,7 @@ private: LambdaFactory::getDiffusionLambda(phaseIdx, compIdx)); // assemble vector of mole fractions - const auto& evv = &elemVolVars(); - auto getMoleFraction = [&evv, phaseIdx, compIdx] (auto volVarIdx) - { return (evv->operator[](volVarIdx)).moleFraction(phaseIdx, compIdx); }; + auto getMoleFraction = [phaseIdx, compIdx] (const auto& volVars) { return volVars.moleFraction(phaseIdx, compIdx); }; localAssembler.assembleU(handle.diffusionHandle(), iv, getMoleFraction); } @@ -513,8 +510,7 @@ private: LambdaFactory::template getHeatConductionLambda<ThermCondModel>()); // assemble vector of temperatures - const auto& evv = &elemVolVars(); - auto getMoleFraction = [&evv] (auto volVarIdx) { return (evv->operator[](volVarIdx)).temperature(); }; + auto getMoleFraction = [] (const auto& volVars) { return volVars.temperature(); }; localAssembler.assembleU(handle.heatConductionHandle(), iv, getMoleFraction); } diff --git a/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh b/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh index eaa5ac3a4da9cfdde4b6054d94443c0387796514..fd25271136fb8195b970f31d0ab32e60930d4fe5 100644 --- a/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh +++ b/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh @@ -147,7 +147,7 @@ public: * * \param handle The data handle in which the vector is stored * \param iv The mpfa-o interaction volume - * \param getU Lambda to obtain the desired cell/Dirichlet value from grid index + * \param getU Lambda to obtain the desired cell/Dirichlet value from vol vars */ template< class DataHandle, class IV, class GetU > void assembleU(DataHandle& handle, const IV& iv, const GetU& getU) @@ -158,9 +158,9 @@ public: // put the cell unknowns first, then Dirichlet values typename IV::Traits::IndexSet::LocalIndexType i = 0; for (; i < iv.numScvs(); i++) - u[i] = getU( iv.localScv(i).gridScvIndex() ); + u[i] = getU( this->elemVolVars()[iv.localScv(i).gridScvIndex()] ); for (const auto& data : iv.dirichletData()) - u[i++] = getU( data.volVarIndex() ); + u[i++] = getU( this->elemVolVars()[data.volVarIndex()] ); } /*!