[kernel] correct very old bug in NewAlpha method
@@ -338,7 +338,11 @@ void NewMarkAlphaOSI::computeFreeOutput(InteractionsGraph::VDescriptor& vertex_i
{
RuntimeException::selfThrow("NewMarkAlphaOSI::computeFreeOutput not yet implemented with LagrangianRheonomousR");
}
-
+ DEBUG_EXPR(
+ std::cout << "((*allOSNS)[SICONOS_OSNSP_ED_SMOOTH_POS]).get()" << ((*allOSNS)[SICONOS_OSNSP_ED_SMOOTH_POS]).get() << std::endl;
+ std::cout << "((*allOSNS)[SICONOS_OSNSP_ED_SMOOTH_ACC]).get()" << ((*allOSNS)[SICONOS_OSNSP_ED_SMOOTH_ACC]).get() << std::endl;
+ std::cout << "osnsp" << osnsp << std::endl;
+ );
if(relationSubType == ScleronomousR)
{
Index coord(8);
@@ -378,13 +382,14 @@ void NewMarkAlphaOSI::computeFreeOutput(InteractionsGraph::VDescriptor& vertex_i
inter->computeOutput(t, 0); // Update output of level 0
osnsp_rhs = *(inter->y(0)); //g_{n,k}
}
- else // output at the velocity level y_{n,k} = (h/gamma_prime)*dotg_{n,k}
+ subprod(*C, *q_free, osnsp_rhs, coord, false);
+ }
+ else if (((*allOSNS)[SICONOS_OSNSP_ED_IMPACT]).get() == osnsp) // output at the velocity level y_{n,k} = (h/gamma_prime)*dotg_{n,k}
{
double h = _simulation->nextTime() - _simulation->startingTime();
double gamma_prime = _gamma / _beta;
inter->computeOutput(t, 1); // Update output of level 1
osnsp_rhs = (h / gamma_prime) * (*(inter->y(1))); //(h/gamma_prime)*dotg_{n,k}
- }
subprod(*C, *q_free, osnsp_rhs, coord, false);
}
else
@@ -392,7 +397,7 @@ void NewMarkAlphaOSI::computeFreeOutput(InteractionsGraph::VDescriptor& vertex_i
osnsp->display();
RuntimeException::selfThrow("NewMarkAlphaOSI::computeFreeOutput, this OSNSP does not exist");
}
- }
+ } //endif(relationSubType == ScleronomousR)
DEBUG_EXPR(osnsp_rhs.display(););
}
