Commit 620700c2 authored by Olivier Lantsoght's avatar Olivier Lantsoght 🏁
Browse files

Merge branch 'flag_stop_in_dirdyn' into 'dev'

Flag stop in dirdyn

See merge request robotran/mbsysc!392
parents 088a8c4a 48c149af
......@@ -13,6 +13,7 @@
* [Py] Using C symbolic library and Python user is possible even with external forces.
* [Py] Adding missing fields in MbsData.
* [dirdyn][Fix] the function user_dirdyn_loop is now called only at the real time steps, even for multisteps integration methods.
* [dirdyn][Fix] the mbs_data->flag_stop is taken into account in all the integrators now, the simulation stops.
* [integrators][dirdyn] Add a new integrator called 'AlphaM' for alpha method. It is explicit, fixed step-size but with two stages and a bit smarter than Euler explicit :-)
## Robotran v1.14.3
......
......@@ -372,12 +372,12 @@ int mbs_invdyn_init(MbsInvdyn* invd, MbsData* mbs_data)
if (invd->q->nq == mbs_data->njoint) {
// The trajectory contains all coordinates value
mbs_msg(">>INVDYN>>> Provided trajectories contains all joints.");
mbs_msg(">>INVDYN>>> Provided trajectories contains all joints.\n");
invd->trajectorytype = 2;
}
else if (invd->q->nq == mbs_data->nqu) {
// The trajectory contains only independent coordinates value
mbs_msg(">>INVDYN>>> Provided trajectories contains only independent coordinates.");
mbs_msg(">>INVDYN>>> Provided trajectories contains only independent coordinates.\n");
invd->trajectorytype = 3;
}
else { // Error management
......
......@@ -87,6 +87,11 @@ int loop_bader(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd) {
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
if (mbs_data->flag_stop) {
// stop the simulation if 'flag_stop' set to 1
break;
}
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
error_code = mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd);
......
......@@ -57,6 +57,11 @@ int loop_custom(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd) {
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
if (mbs_data->flag_stop) {
// stop the simulation if 'flag_stop' set to 1
break;
}
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
err = mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd);
......
......@@ -72,6 +72,11 @@ int loop_eulerEx(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd) {
while (mbs_dd->tsim <= tf)
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
if (mbs_data->flag_stop) {
// stop the simulation if 'flag_stop' set to 1
break;
}
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
......
......@@ -74,6 +74,12 @@ int loop_euler_implicit(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_
while (mbs_dd->tsim < tf) {
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
if (mbs_data->flag_stop) {
// stop the simulation if 'flag_stop' set to 1
break;
}
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
err = mbs_fct_dirdyn(mbs_dd->tsim, mbs_dd->y, mbs_dd->yd, mbs_data, mbs_dd);
......
......@@ -51,6 +51,11 @@ int loop_rk4(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd) {
while (mbs_dd->tsim <= tf)
{
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
if (mbs_data->flag_stop) {
// stop the simulation if 'flag_stop' set to 1
break;
}
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
......
......@@ -82,6 +82,11 @@ int 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_data->flag_stop) {
// stop the simulation if 'flag_stop' set to 1
break;
}
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
......
......@@ -95,6 +95,11 @@ int loop_w_methods(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd) {
while (mbs_dd->tsim < tf) {
user_dirdyn_loop(mbs_data, mbs_dd); ///user loop
if (mbs_data->flag_stop) {
// stop the simulation if 'flag_stop' set to 1
break;
}
if (mbs_dd->options->flag_precise_dynamics) // Compute f' if asked
{
......
Supports Markdown
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