diff --git a/dumux/implicit/assembler.hh b/dumux/implicit/assembler.hh index e0a0835044067fa80969285f5cc9bf05aae7a417..20fb84eba1a630610e2d3f55c8152ac3f02f5d35 100644 --- a/dumux/implicit/assembler.hh +++ b/dumux/implicit/assembler.hh @@ -234,7 +234,7 @@ private: // Construct the BCRS matrix for the global jacobian void createMatrix_() { - int numDofs = problem_().model().numDofs() + auto numDofs = problem_().model().numDofs(); // allocate raw matrix matrix_ = std::make_shared<JacobianMatrix>(numDofs, numDofs, JacobianMatrix::random); @@ -250,10 +250,10 @@ private: { if (!isBox) { - for (const auto& element : elements(gridview_())) + for (const auto& element : elements(gridView_())) { // the global index of the element at hand - const unsigned int elemIdx = elementMapper_().index(element); + const auto elemIdx = elementMapper_().index(element); const auto& stencil = model_().stencils().elementStencil(element); matrix_->setrowsize(elemIdx, stencil.size()); } @@ -269,13 +269,13 @@ private: { if (!isBox) { - for (const auto& element : elements(gridview_())) + for (const auto& element : elements(gridView_())) { // the global index of the element at hand - const unsigned int globalI = elementMapper_().index(element); + const auto globalI = elementMapper_().index(element); const auto& stencil = model_().stencils().elementStencil(element); - for (globalJ : stencil) + for (auto&& globalJ : stencil) matrix_->addindex(globalI, globalJ); } matrix_->endrowsizes(); diff --git a/dumux/implicit/localjacobian.hh b/dumux/implicit/localjacobian.hh index 6f34df94e806b5c0cbf60e1d3fd90cc3337022d2..98077bc0ce046b2b71b09a982ca653ca76446129 100644 --- a/dumux/implicit/localjacobian.hh +++ b/dumux/implicit/localjacobian.hh @@ -84,6 +84,7 @@ private: }; typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry; + typedef typename GET_PROP_TYPE(TypeTag, SubControlVolume) SubControlVolume; typedef typename GET_PROP_TYPE(TypeTag, VertexMapper) VertexMapper; typedef typename GET_PROP_TYPE(TypeTag, ElementSolutionVector) ElementSolutionVector; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; @@ -145,10 +146,10 @@ public: model_().updatePVWeights(fvElemGeom_()); // get stencil informations - //const auto& sourceStencil = model_().stencils().sourceStencil(element); + const auto& elementStencil = model_().stencils().elementStencil(element); // set size of local jacobian matrix - const std::size_t numCols = stencil.size(); + const std::size_t numCols = elementStencil.size(); std::size_t numRows; if (isBox) @@ -187,7 +188,7 @@ public: // for cellcentered methods, calculate the derivatives w.r.t cells in stencil if (!isBox) { - const auto& neighborDofs = model_().stencils().neighborStencil(element); + const auto& neighborStencil = model_().stencils().neighborStencil(element); // map each neighbor dof to a set of fluxVars that need to be recalculated // i.o.t calculate derivative w.r.t this neighbor @@ -197,8 +198,8 @@ public: for (auto&& scvFace : fvElemGeom_().scvf()) { int fluxVarIdx = scvFace.index(); - auto&& fluxVars = model_().fluxVars(fluxVarIdx); - for (auto&& globalJ : neighborDofs) + const auto& fluxVars = model_().fluxVars(fluxVarIdx); + for (auto&& globalJ : neighborStencil) if (fluxVars.stencil().count(globalJ)) neighborToFluxVars[globalJ].insert(fluxVarIdx); } @@ -206,7 +207,7 @@ public: // loop over the neighbors and calculation of the change in flux // with a change in the primary variables at the neighboring dof int j = 1; - for (auto&& globalJ : neighborDofs) + for (auto&& globalJ : neighborStencil) { for (int pvIdx = 0; pvIdx < numEq; pvIdx++) { @@ -503,7 +504,7 @@ protected: deflectFlux += localResidual().evalFlux_(fluxVarIdx); // store the calculated flux - partialDeriv = deflectFlux + partialDeriv = deflectFlux; } else { @@ -532,7 +533,7 @@ protected: PrimaryVariables += localResidual().evalFlux_(fluxVarIdx); // subtract the residual from the derivative storage - partialDeriv -= deflectFlux + partialDeriv -= deflectFlux; } else {