[kernel] fix issue with hasNsProblems
@@ -508,7 +508,8 @@ void TimeStepping::newtonSolve(double criterion, unsigned int maxStep)
prepareNewtonIteration();
computeFreeState();
//bool hasNSProblems = (!_allNSProblems->empty() && indexSet0.size() > 0) ? true : false;
- // if (hasNSProblems)
+ bool hasNSProblems = (!_allNSProblems->empty()) ? true : false;
+ if (hasNSProblems)
info = computeOneStepNSProblem(SICONOS_OSNSP_TS_VELOCITY);
// Check output from solver (convergence or not ...)
if (!checkSolverOutput)
@@ -519,8 +520,8 @@ void TimeStepping::newtonSolve(double criterion, unsigned int maxStep)
update();
- // hasNSProblems = (!_allNSProblems->empty() && indexSet0.size() > 0) ? true : false;
- // if (hasNSProblems)
+ hasNSProblems = (!_allNSProblems->empty()) ? true : false;
+ if (hasNSProblems)
saveYandLambdaInOldVariables();
}
@@ -548,10 +549,11 @@ void TimeStepping::newtonSolve(double criterion, unsigned int maxStep)
// is also relevant here.
//InteractionsGraph& indexSet0 = *_nsds->topology()->indexSet0();
//bool hasNSProblems = (!_allNSProblems->empty() && indexSet0.size() > 0) ? true : false;
- // if (hasNSProblems)
- // {
+ bool hasNSProblems = (!_allNSProblems->empty()) ? true : false;
+ if (hasNSProblems)
+ {
info = computeOneStepNSProblem(SICONOS_OSNSP_TS_VELOCITY);
- // }
+ }
// Check output from solver (convergence or not ...)
if (!checkSolverOutput)
DefaultCheckSolverOutput(info);
@@ -566,15 +568,16 @@ void TimeStepping::newtonSolve(double criterion, unsigned int maxStep)
updateInteractionsNewtonIteration();
updateWorldFromDS();
//hasNSProblems = (!_allNSProblems->empty() && indexSet0.size() > 0) ? true : false;
+ hasNSProblems = (!_allNSProblems->empty()) ? true : false;
updateOutput();
}
_isNewtonConverge = newtonCheckConvergence(criterion);
if (!_isNewtonConverge && !info)
{
- //hasNSProblems = (!_allNSProblems->empty() && indexSet0.size() > 0) ? true : false;
+ hasNSProblems = (!_allNSProblems->empty()) ? true : false;
- //if (hasNSProblems)
+ if (hasNSProblems)
saveYandLambdaInOldVariables();
}
