Commit 7d5afc1b authored by Sebastien Timmermans's avatar Sebastien Timmermans 🎹
Browse files

[Fix] finish integrator called twice #263

parent f46db470
...@@ -186,5 +186,5 @@ void error_bader(MbsData *mbs_data, MbsDirdyn *dd, int err) { ...@@ -186,5 +186,5 @@ void error_bader(MbsData *mbs_data, MbsDirdyn *dd, int err) {
mbs_msg(">>DIRDYN>>\n"); mbs_msg(">>DIRDYN>>\n");
mbs_msg(">>DIRDYN>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim); mbs_msg(">>DIRDYN>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim);
mbs_msg(">>DIRDYN>> During Bader integrator [%d] \n", err); mbs_msg(">>DIRDYN>> During Bader integrator [%d] \n", err);
finish_bader(mbs_data, dd); // finish_bader(mbs_data, dd); // already called in mbs_dirdyn_finish
} }
...@@ -123,5 +123,5 @@ void error_custom(MbsData *mbs_data, MbsDirdyn *dd, int err) { ...@@ -123,5 +123,5 @@ void error_custom(MbsData *mbs_data, MbsDirdyn *dd, int err) {
mbs_msg("\t >>Custom>>\n"); mbs_msg("\t >>Custom>>\n");
mbs_msg("\t >>Custom>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim); mbs_msg("\t >>Custom>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim);
mbs_msg("\t >>Custom>> During Custom integrator [%d] \n", err); mbs_msg("\t >>Custom>> During Custom integrator [%d] \n", err);
finish_custom(mbs_data, dd); // finish_custom(mbs_data, dd); // already called in mbs_dirdyn_finish
} }
\ No newline at end of file
...@@ -153,5 +153,5 @@ void error_dopri5(MbsData *mbs_data, MbsDirdyn *dd, int err) { ...@@ -153,5 +153,5 @@ void error_dopri5(MbsData *mbs_data, MbsDirdyn *dd, int err) {
mbs_msg("\t >>DIRDYN>>\n"); mbs_msg("\t >>DIRDYN>>\n");
mbs_msg("\t >>DIRDYN>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim); mbs_msg("\t >>DIRDYN>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim);
mbs_msg("\t >>DIRDYN>> During Dopri 5 integrator [%d] \n", err); mbs_msg("\t >>DIRDYN>> During Dopri 5 integrator [%d] \n", err);
finish_dopri5(mbs_data, dd); // finish_dopri5(mbs_data, dd); // already called in mbs_dirdyn_finish
} }
\ No newline at end of file
...@@ -128,7 +128,7 @@ void error_eulerEx(MbsData *mbs_data, MbsDirdyn *dd, int err) ...@@ -128,7 +128,7 @@ void error_eulerEx(MbsData *mbs_data, MbsDirdyn *dd, int err)
mbs_msg("\t >>Euler explicit>>\n"); mbs_msg("\t >>Euler explicit>>\n");
mbs_msg("\t >>Euler explicit>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim); mbs_msg("\t >>Euler explicit>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim);
mbs_msg("\t >>Euler explicit>> During time integration [%d] \n", err); mbs_msg("\t >>Euler explicit>> During time integration [%d] \n", err);
finish_eulerEx(mbs_data, dd); // finish_eulerEx(mbs_data, dd); // already called in mbs_dirdyn_finish
} }
......
...@@ -151,5 +151,5 @@ void error_euler_implicit(MbsData *mbs_data, MbsDirdyn *dd, int err) { ...@@ -151,5 +151,5 @@ void error_euler_implicit(MbsData *mbs_data, MbsDirdyn *dd, int err) {
mbs_msg(">>DIRDYN>>\n"); mbs_msg(">>DIRDYN>>\n");
mbs_msg(">>DIRDYN>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim); mbs_msg(">>DIRDYN>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim);
mbs_msg(">>DIRDYN>> During Euler Implicit integrator [%d] \n", err); mbs_msg(">>DIRDYN>> During Euler Implicit integrator [%d] \n", err);
finish_euler_implicit(mbs_data, dd); // finish_euler_implicit(mbs_data, dd); // already called in mbs_dirdyn_finish
} }
\ No newline at end of file
...@@ -122,5 +122,5 @@ void error_rk4(MbsData *mbs_data, MbsDirdyn *dd, int err) { ...@@ -122,5 +122,5 @@ void error_rk4(MbsData *mbs_data, MbsDirdyn *dd, int err) {
mbs_msg("\t >>RK4>>\n"); mbs_msg("\t >>RK4>>\n");
mbs_msg("\t >>RK4>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim); mbs_msg("\t >>RK4>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim);
mbs_msg("\t >>RK4>> During RK4 integrator [%d] \n", err); mbs_msg("\t >>RK4>> During RK4 integrator [%d] \n", err);
finish_rk4(mbs_data, dd); // finish_rk4(mbs_data, dd); // already called in mbs_dirdyn_finish
} }
\ No newline at end of file
...@@ -169,5 +169,5 @@ void error_rosenbrock(MbsData *mbs_data, MbsDirdyn *dd, int err) ...@@ -169,5 +169,5 @@ void error_rosenbrock(MbsData *mbs_data, MbsDirdyn *dd, int err)
mbs_msg("\t >>Rosenbrock>>\n"); mbs_msg("\t >>Rosenbrock>>\n");
mbs_msg("\t >>Rosenbrock>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim); mbs_msg("\t >>Rosenbrock>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim);
mbs_msg("\t >>Rosenbrock>> During Rosenbrock integrator [%d] \n", err); mbs_msg("\t >>Rosenbrock>> During Rosenbrock integrator [%d] \n", err);
finish_rosenbrock(mbs_data, dd); // finish_rosenbrock(mbs_data, dd); // already called in mbs_dirdyn_finish
} }
\ No newline at end of file
...@@ -146,6 +146,10 @@ int loop_w_methods(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd) { ...@@ -146,6 +146,10 @@ int loop_w_methods(double t0, double tf, MbsData *mbs_data, MbsDirdyn *mbs_dd) {
void finish_w_methods(MbsData *mbs_data, MbsDirdyn *dd) { void finish_w_methods(MbsData *mbs_data, MbsDirdyn *dd) {
if (!dd) {
return;
}
if (dd->nState != 0) if (dd->nState != 0)
{ {
free_dvec_0(((MbsDirdynWMethods *)dd->integrator_struct)->dfdx); free_dvec_0(((MbsDirdynWMethods *)dd->integrator_struct)->dfdx);
...@@ -180,5 +184,5 @@ void error_w_methods(MbsData *mbs_data, MbsDirdyn *dd, int err) { ...@@ -180,5 +184,5 @@ void error_w_methods(MbsData *mbs_data, MbsDirdyn *dd, int err) {
mbs_msg("\t >>DIRDYN>>\n"); mbs_msg("\t >>DIRDYN>>\n");
mbs_msg("\t >>DIRDYN>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim); mbs_msg("\t >>DIRDYN>> Error during integration in direct dynamics at time %g s !\n", mbs_data->tsim);
mbs_msg("\t >>DIRDYN>> During W Methods integrator [%d] \n", err); mbs_msg("\t >>DIRDYN>> During W Methods integrator [%d] \n", err);
finish_w_methods(mbs_data, dd); // finish_w_methods(mbs_data, dd); // already called in mbs_dirdyn_finish
} }
\ No newline at end of file
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