Commit b348c97a authored by Sebastien Timmermans's avatar Sebastien Timmermans 🎹

[Fix] move back user_dd_loop calls in integrators

parent a9a78383
Pipeline #4446 passed with stage
in 9 minutes and 41 seconds
......@@ -74,9 +74,10 @@ void loop_bader(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd, FILE
while (t < tf)
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd);
}
......@@ -85,8 +86,7 @@ void loop_bader(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd, FILE
}
bader(mbs_dd->y, mbs_dd->yd, mbs_dd->nState, &t, h_cur, mbs_dd->options->toler, yscal, &hdid, &hnext, h_max, mbs_fct_dirdyn, mbs_data, mbs_dd);
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
mbs_fct_dirdyn(t, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd); // next f'
h_cur = (hnext < tf - t) ? hnext : tf - t;
......
......@@ -50,9 +50,10 @@ void loop_custom(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd, FIL
while (t < tf)
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd);
}
......@@ -68,7 +69,6 @@ void loop_custom(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd, FIL
mbs_dd->y[i] = mbs_dd->yout[i];
}
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
mbs_fct_dirdyn(t, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd); // next f'
// save results if always asked or if waypoint reached
......
......@@ -52,10 +52,10 @@ void loop_eulerEx(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd, FI
while (mbs_dd->tsim <= tf)
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd);
}
......@@ -64,7 +64,6 @@ void loop_eulerEx(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd, FI
mbs_dd->tsim += h;
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd); // next f'
// save results if always asked or if waypoint reached
......
......@@ -59,10 +59,10 @@ void loop_euler_implicit(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs
mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd);
while (mbs_dd->tsim < tf) {
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd);
}
// Call the Euler Implicit method
......@@ -70,11 +70,8 @@ void loop_euler_implicit(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs
mbs_dd->tsim += h;
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd);
if (((!mbs_dd->options->flag_solout_wp) || (mbs_dd->options->flag_solout_wp && mbs_dd->tsim == tf))) {
save_realtime_update(mbs_dd, mbs_data);
}
......
......@@ -43,9 +43,10 @@ void loop_rk4(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd, FILE *
while (mbs_dd->tsim <= tf)
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
{
mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd);
}
......@@ -58,7 +59,6 @@ void loop_rk4(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd, FILE *
mbs_dd->y[i] = mbs_dd->yout[i];
}
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd); // next f'
// save results if always asked or if waypoint reached
......
......@@ -72,9 +72,10 @@ void loop_rosenbrock(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd,
while (t < tf)
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
mbs_fct_dirdyn(t, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd);
}
......@@ -92,7 +93,6 @@ void loop_rosenbrock(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd,
h_cur = (hnext < tf - t) ? hnext : tf - t;
h_max = (mbs_dd->options->dt_max < tf - t) ? mbs_dd->options->dt_max : tf - t;
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
mbs_fct_dirdyn(t, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd); // next f'
if (((!mbs_dd->options->flag_solout_wp) || (mbs_dd->options->flag_solout_wp && t == tf))) {
......
......@@ -58,10 +58,10 @@ void loop_w_methods(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd,
mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd);
while (mbs_dd->tsim < tf) {
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd);
}
......@@ -70,7 +70,6 @@ void loop_w_methods(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd,
mbs_dd->tsim += h;
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd); // next f'
if (((!mbs_dd->options->flag_solout_wp) || (mbs_dd->options->flag_solout_wp && mbs_dd->tsim == tf))) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment