From 4e43e154ce6e0a375ca00d212c1aebdc7f896877 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Mon, 13 Nov 2017 10:58:15 +0100 Subject: [PATCH] [newtoncontroller] Make relativeShiftAtDof_ comaptible with staggered grid * use PrimaryVariables::dimension instead of numEq to allow usage by staggered grid * numEq is not defined in staggered grid, instead there is numEqFace and numEqCellCenter --- dumux/nonlinear/newtoncontroller.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dumux/nonlinear/newtoncontroller.hh b/dumux/nonlinear/newtoncontroller.hh index 087b512826..0a6435b447 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); -- GitLab