From b011bbed8e70a3a76113092915fcf86d4f630734 Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Fri, 26 Feb 2016 08:41:56 +0100 Subject: [PATCH] [cleanup] Syntax corrections --- dumux/implicit/assembler.hh | 12 ++++++------ dumux/implicit/localjacobian.hh | 17 +++++++++-------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/dumux/implicit/assembler.hh b/dumux/implicit/assembler.hh index e0a0835044..20fb84eba1 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 6f34df94e8..98077bc0ce 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 { -- GitLab