[kernel] fix wrong computation in FOLTIDS
thanks for the bug report
@@ -439,6 +439,7 @@ void EulerMoreauOSI::computeW(double time, DynamicalSystem& ds,
}
// Remark: W is not LU-factorized here.
// Function PLUForwardBackward will do that if required.
+ DEBUG_EXPR(W.display());
DEBUG_END("EulerMoreauOSI::computeW(...)\n");
}
@@ -543,6 +544,7 @@ double EulerMoreauOSI::computeResidu()
folds.computeA(told);
prod(*folds.A(), xold, residu);
}
+
if(folds.b())
{
folds.computeb(told);
@@ -615,7 +617,7 @@ double EulerMoreauOSI::computeResidu()
//Don't use W because it is LU factorized
//Residu : R_{free} = M(x^{\alpha}_{k+1} - x_{k}) -h( A (\theta x^{\alpha}_{k+1} + (1-\theta) x_k) +b_{k+1})
if(foltids.b())
- residuFree = *(foltids.b());
+ scal(-h, *(foltids.b()), residuFree, true);
else
residuFree.zero();
