Commit 17c50eae authored by Olivier Lantsoght's avatar Olivier Lantsoght
Browse files

[MbsModal] Fix leak in new errors scheme.

parent b3c6ff36
......@@ -221,8 +221,6 @@ int mbs_run_equil(MbsEquil* eq, MbsData* s)
// - - - - - - - - - - -
err = mbs_equil_loop(eq, s); // another name might be more appropriate
if (err < 0){
// Freeing the buffers, without error catching
mbs_equil_finish(eq, s);
s->DoneEquil = 0;
return err;
}
......@@ -877,7 +875,10 @@ int mbs_equil_fsolvepk(int(*fun_ptr)(double*, int, double*, MbsEquil*, MbsAux*,
free_dvec_0(f);
free_dvec_0(fd);
mbs_equil_finish(eq, s);
err += _MBS_ERR_MOD_EQUIL;
mbs_msg(">>EQUIL>>\n");
mbs_msg(">>EQUIL>> Error at initial gradient computation \n");
mbs_error_msg(">>EQUIL>> [%d] in mbs_equil_fsolvepk !! \n", err);
......@@ -936,6 +937,8 @@ int mbs_equil_fsolvepk(int(*fun_ptr)(double*, int, double*, MbsEquil*, MbsAux*,
free_dvec_0(f);
free_dvec_0(fd);
mbs_equil_finish(eq, s);
err = _MBS_ERR_MOD_EQUIL + _MBS_ERR_MOD_SPEC_12;
mbs_msg(">>EQUIL>> mbs_equil_fsolvepk: none of the proposed parameter are sensitive !\n");
......@@ -970,6 +973,8 @@ int mbs_equil_fsolvepk(int(*fun_ptr)(double*, int, double*, MbsEquil*, MbsAux*,
free_dvec_0(xdsR);
free_dvec_0(xsR);
mbs_equil_finish(eq, s);
err += _MBS_ERR_MOD_EQUIL;
mbs_msg(">>EQUIL>>\n");
......@@ -1001,6 +1006,8 @@ int mbs_equil_fsolvepk(int(*fun_ptr)(double*, int, double*, MbsEquil*, MbsAux*,
free_dvec_0(xdsR);
free_dvec_0(xsR);
mbs_equil_finish(eq, s);
err += _MBS_ERR_MOD_EQUIL;
mbs_msg(">>EQUIL>>\n");
......@@ -1054,6 +1061,8 @@ int mbs_equil_fsolvepk(int(*fun_ptr)(double*, int, double*, MbsEquil*, MbsAux*,
free_dvec_0(xdsR);
free_dvec_0(xsR);
mbs_equil_finish(eq, s);
err += _MBS_ERR_MOD_EQUIL;
mbs_msg(">>EQUIL>>\n");
......@@ -1092,6 +1101,8 @@ int mbs_equil_fsolvepk(int(*fun_ptr)(double*, int, double*, MbsEquil*, MbsAux*,
free_ivec_0(indx);
mbs_equil_finish(eq, s);
err += _MBS_ERR_MOD_EQUIL;
mbs_msg(">>EQUIL>>\n");
......@@ -1199,6 +1210,8 @@ int mbs_equil_fsolvepk(int(*fun_ptr)(double*, int, double*, MbsEquil*, MbsAux*,
free_dvec_0(xdsR);
free_dvec_0(xsR);
mbs_equil_finish(eq, s);
err += _MBS_ERR_MOD_EQUIL;
mbs_msg(">>EQUIL>>\n");
......@@ -1253,6 +1266,8 @@ int mbs_equil_fsolvepk(int(*fun_ptr)(double*, int, double*, MbsEquil*, MbsAux*,
free_dvec_0(xdsR);
free_dvec_0(xsR);
mbs_equil_finish(eq, s);
err += _MBS_ERR_MOD_EQUIL;
mbs_msg(">>EQUIL>>\n");
......@@ -1277,6 +1292,8 @@ int mbs_equil_fsolvepk(int(*fun_ptr)(double*, int, double*, MbsEquil*, MbsAux*,
free_dvec_0(xdsR);
free_dvec_0(xsR);
mbs_equil_finish(eq, s);
err += _MBS_ERR_MOD_EQUIL;
mbs_msg(">>EQUIL>>\n");
......@@ -1301,6 +1318,8 @@ int mbs_equil_fsolvepk(int(*fun_ptr)(double*, int, double*, MbsEquil*, MbsAux*,
free_dvec_0(xdsR);
free_dvec_0(xsR);
mbs_equil_finish(eq, s);
err = _MBS_ERR_MOD_EQUIL + _MBS_ERR_MOD_SPEC_11;
mbs_msg(">>EQUIL>>\n");
......
......@@ -49,7 +49,7 @@ mbs_equil = Robotran.MbsEquil(mbs_data)
# Error: impossible cut
mbs_data.dpt[3][4] = 10.
# mbs_data.dpt[3][4] = 10.
# Error: Mass matrix full of 0.
# Set all mass to 0
......@@ -62,10 +62,6 @@ mbs_data.dpt[3][4] = 10.
# mbs_data.In[5][4] = 0.0
# mbs_data.In[5][5] = 0.0
# Error: impossible cut
# mbs_data->dpt[3][4] = 10;
# Error: no sensitive variables
# Replace all independent joints
# By anchor point coordinates with no symbol
......
......@@ -23,6 +23,8 @@
#include "mbs_set.h"
#include "mbs_modal.h"
#include "user_all_id.h"
int main(int argc, char const *argv[])
{
......@@ -87,7 +89,7 @@ int main(int argc, char const *argv[])
mbs_equil->options->verbose = 1;
// Error: impossible cut
mbs_data->dpt[3][4] = 10;
// mbs_data->dpt[3][4] = 10;
// Error: Mass matrix full of 0.
// Set all mass to 0
......@@ -100,10 +102,6 @@ int main(int argc, char const *argv[])
// mbs_data->In[5][4] = 0.0;
// mbs_data->In[5][5] = 0.0;
// Error: impossible cut
// mbs_data->dpt[3][4] = 10;
// Error: no sensitive variables
// Replace all independent joints
// mbs_equil->options->nquch = 3;
......
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