diff --git a/dumux/assembly/fvassembler.hh b/dumux/assembly/fvassembler.hh index ec217894f2f104fe862b891d08b01e6566350f08..79a947932b3627cbb54f02bcf4f28617a9ccd12a 100644 --- a/dumux/assembly/fvassembler.hh +++ b/dumux/assembly/fvassembler.hh @@ -204,6 +204,9 @@ public: if (!stationary_ && localResidual_.isStationary()) DUNE_THROW(Dune::InvalidStateException, "Assembling instationary problem but previous solution was not set!"); + // update the grid variables for the case of active caching + gridVariables_->update(curSol); + // let the local assembler add the element contributions for (const auto element : elements(gridView())) LocalAssembler::assemble(*this, r, element, curSol); diff --git a/dumux/nonlinear/newtoncontroller.hh b/dumux/nonlinear/newtoncontroller.hh index 8bcf3903b04f363966cb302e377b9753efa2fc8b..087b51282660d7cdd3a9f81bd1694959d2da8c32 100644 --- a/dumux/nonlinear/newtoncontroller.hh +++ b/dumux/nonlinear/newtoncontroller.hh @@ -392,10 +392,14 @@ public: reduction_ = residualNorm_; reduction_ /= initialResidual_; } + else + { + // If we get here, the convergence criterion does not require + // additional residual evalutions. Thus, the grid variables have + // not yet been updated to the new uCurrentIter. + assembler.gridVariables().update(uCurrentIter); + } } - - // update the variables class to the new solution - assembler.gridVariables().update(uCurrentIter); } /*!