diff --git a/dumux/nonlinear/newtoncontroller.hh b/dumux/nonlinear/newtoncontroller.hh index 087b51282660d7cdd3a9f81bd1694959d2da8c32..0a6435b447a3a09dee36987bd06624e5fe45564b 100644 --- a/dumux/nonlinear/newtoncontroller.hh +++ b/dumux/nonlinear/newtoncontroller.hh @@ -582,7 +582,10 @@ protected: Scalar result = 0.0; using std::abs; using std::max; - for (int j = 0; j < numEq; ++j) { + // iterate over all primary variables + // note: we use PrimaryVariables::dimension (== numEq) + // for compatibility with the staggered grid implementation + for (int j = 0; j < PrimaryVariables::dimension; ++j) { Scalar eqErr = abs(priVars1[j] - priVars2[j]); eqErr /= max(1.0,abs(priVars1[j] + priVars2[j])/2);