Authentication method changed. UCLouvain users, please use the "UCLouvain SSO" button to connect on the website and use ssh + ssh key (https://git.immc.ucl.ac.be/-/profile/keys) or https + personnal access token (https://git.immc.ucl.ac.be/-/profile/personal_access_tokens) in your git clients.

Commit 37bc005b authored by Nicolas Docquier's avatar Nicolas Docquier
Browse files

Move function pointer to a sub-structure of mbs_data

parent 65256214
...@@ -61,7 +61,7 @@ g = s->g; ...@@ -61,7 +61,7 @@ g = s->g;
// Driven Variables // Driven Variables
s->user_DrivenJoints(s,tsim); s->fct.user.user_DrivenJoints(s,tsim);
NRh2 = 1.0; NRh2 = 1.0;
while((NRh2 > NR_ERR) && (iter++ < MAX_NR_ITER)) while((NRh2 > NR_ERR) && (iter++ < MAX_NR_ITER))
...@@ -178,7 +178,7 @@ if(iter > MAX_NR_ITER) return(-1); ...@@ -178,7 +178,7 @@ if(iter > MAX_NR_ITER) return(-1);
// Joint Forces // Joint Forces
Qq = s->user_JointForces(s,tsim); Qq = s->fct.user.user_JointForces(s,tsim);
// Link Kinematics: Distance Z , Relative Velocity ZD // Link Kinematics: Distance Z , Relative Velocity ZD
...@@ -195,7 +195,7 @@ if(iter > MAX_NR_ITER) return(-1); ...@@ -195,7 +195,7 @@ if(iter > MAX_NR_ITER) return(-1);
// Link Forces // Link Forces
Flnk1 = s->user_LinkForces(Z1,Zd1,s,tsim,1); Flnk1 = s->fct.user.user_LinkForces(Z1,Zd1,s,tsim,1);
// Link Dynamics : Forces projection on body-fixed frames // Link Dynamics : Forces projection on body-fixed frames
......
...@@ -83,7 +83,7 @@ MbsData *s, double tsim) ...@@ -83,7 +83,7 @@ MbsData *s, double tsim)
// Link Force Computation // Link Force Computation
Flink1 = s->user_LinkForces(Z1,Zd1,s,tsim,1); Flink1 = s->fct.user.user_LinkForces(Z1,Zd1,s,tsim,1);
// = = Block_0_1_0_2_2_1 = = // = = Block_0_1_0_2_2_1 = =
......
...@@ -28,9 +28,9 @@ extern "C" { ...@@ -28,9 +28,9 @@ extern "C" {
int main(int argc, char const *argv[]) int main(int argc, char const *argv[])
{ {
MbsData *mbs_data; MbsData *mbs_data;
MbsPart *mbs_part; MbsPart *mbs_part;
MbsDirdyn *mbs_dirdyn; MbsDirdyn *mbs_dirdyn;
...@@ -40,11 +40,11 @@ int main(int argc, char const *argv[]) ...@@ -40,11 +40,11 @@ int main(int argc, char const *argv[])
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/* LOADING * /* LOADING *
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
printf("Loading the PendulumSpring data file !\n"); printf("Loading the PendulumSpring data file !\n");
mbs_data = mbs_load(PROJECT_SOURCE_DIR"/../dataR/PendulumSpringC.mbs"); mbs_data = mbs_load(PROJECT_SOURCE_DIR"/../dataR/PendulumSpringC.mbs");
printf("*.mbs file loaded!\n"); printf("*.mbs file loaded!\n");
mbs_get_project_functions(mbs_data); mbs_get_project_functions(mbs_data);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
...@@ -55,7 +55,7 @@ int main(int argc, char const *argv[]) ...@@ -55,7 +55,7 @@ int main(int argc, char const *argv[])
mbs_part->options->rowperm=1; mbs_part->options->rowperm=1;
mbs_part->options->verbose = 1; mbs_part->options->verbose = 1;
mbs_run_part(mbs_part, mbs_data); mbs_run_part(mbs_part, mbs_data);
mbs_delete_part(mbs_part); mbs_delete_part(mbs_part);
...@@ -71,17 +71,17 @@ int main(int argc, char const *argv[]) ...@@ -71,17 +71,17 @@ int main(int argc, char const *argv[])
mbs_dirdyn->options->save2file = 1; mbs_dirdyn->options->save2file = 1;
mbs_dirdyn->options->respath = PROJECT_SOURCE_DIR"/../resultsR"; mbs_dirdyn->options->respath = PROJECT_SOURCE_DIR"/../resultsR";
mbs_dirdyn->options->realtime = 1; mbs_dirdyn->options->realtime = 1;
mbs_run_dirdyn(mbs_dirdyn, mbs_data); mbs_run_dirdyn(mbs_dirdyn, mbs_data);
mbs_delete_dirdyn(mbs_dirdyn, mbs_data); mbs_delete_dirdyn(mbs_dirdyn, mbs_data);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/* CLOSING OPERATIONS * /* CLOSING OPERATIONS *
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
mbs_delete_data(mbs_data); mbs_delete_data(mbs_data);
return 0; return 0;
} }
...@@ -150,13 +150,13 @@ void mbs_get_project_functions(MbsData *mbs_data) ...@@ -150,13 +150,13 @@ void mbs_get_project_functions(MbsData *mbs_data)
//mbs_data->mbs_cons_jdqd = mbs_cons_jdqd; //mbs_data->mbs_cons_jdqd = mbs_cons_jdqd;
#ifdef UNIX #ifdef UNIX
mbs_data->mbs_link = dlsym(lib_handle, "mbs_link"); mbs_data->fct.symb.mbs_link = dlsym(lib_handle, "mbs_link");
mbs_data->mbs_link3D = dlsym(lib_handle, "mbs_link3D"); mbs_data->fct.symb.mbs_link3D = dlsym(lib_handle, "mbs_link3D");
mbs_data->mbs_extforces = dlsym(lib_handle, "mbs_extforces"); mbs_data->fct.symb.mbs_extforces = dlsym(lib_handle, "mbs_extforces");
mbs_data->mbs_accelred = dlsym(lib_handle, "mbs_accelred"); mbs_data->fct.symb.mbs_accelred = dlsym(lib_handle, "mbs_accelred");
mbs_data->mbs_dirdyna = dlsym(lib_handle, "mbs_dirdyna"); mbs_data->fct.symb.mbs_dirdyna = dlsym(lib_handle, "mbs_dirdyna");
mbs_data->mbs_cons_hJ = dlsym(lib_handle, "mbs_cons_hJ"); mbs_data->fct.symb.mbs_cons_hJ = dlsym(lib_handle, "mbs_cons_hJ");
mbs_data->mbs_cons_jdqd = dlsym(lib_handle, "mbs_cons_jdqd"); mbs_data->fct.symb.mbs_cons_jdqd = dlsym(lib_handle, "mbs_cons_jdqd");
if ((error = dlerror()) != NULL) if ((error = dlerror()) != NULL)
{ {
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
MbsData* mbs_load(const char* mbs_filename){ MbsData* mbs_load(const char* mbs_filename){
MDS_gen_strct *mds; MDS_gen_strct *mds;
MbsData *mbs_data; MbsData *mbs_data;
mds = MDS_mbs_reader(mbs_filename); mds = MDS_mbs_reader(mbs_filename);
mbs_data = MDS_create_MBSdataStruct(mds); mbs_data = MDS_create_MBSdataStruct(mds);
free_MDS_gen_strct(mds); free_MDS_gen_strct(mds);
...@@ -15,7 +15,7 @@ MbsData* mbs_load(const char* mbs_filename){ ...@@ -15,7 +15,7 @@ MbsData* mbs_load(const char* mbs_filename){
strcpy(mbs_data->mbs_filename, mbs_filename); strcpy(mbs_data->mbs_filename, mbs_filename);
return mbs_data; return mbs_data;
} }
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
...@@ -25,8 +25,8 @@ MbsData* mbs_load(const char* mbs_filename){ ...@@ -25,8 +25,8 @@ MbsData* mbs_load(const char* mbs_filename){
int* q_MBSdataStruct; int* q_MBSdataStruct;
if(nq) if(nq)
{ {
int i; int i;
q_MBSdataStruct = (int*) calloc(nq+1,sizeof(int)); q_MBSdataStruct = (int*) calloc(nq+1,sizeof(int));
q_MBSdataStruct[0] = nq; q_MBSdataStruct[0] = nq;
for(i=0; i<nq; i++) for(i=0; i<nq; i++)
...@@ -68,8 +68,8 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -68,8 +68,8 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
}else{ }else{
s->Nloopc = mds_gen_strct->cuts->n_rod + 3 * mds_gen_strct->cuts->n_ball + 6 * mds_gen_strct->cuts->n_solid; s->Nloopc = mds_gen_strct->cuts->n_rod + 3 * mds_gen_strct->cuts->n_ball + 6 * mds_gen_strct->cuts->n_solid;
} }
s->Nuserc = 0; s->Nuserc = 0;
s->Ncons = s->Nloopc + s->Nuserc; s->Ncons = s->Nloopc + s->Nuserc;
//s->nhu = 8; // caution WEMOOV dependent !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //s->nhu = 8; // caution WEMOOV dependent !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
...@@ -83,7 +83,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -83,7 +83,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
s->Nlink = 0; s->Nlink = 0;
s->Nlink3D = 0; s->Nlink3D = 0;
} }
s->Nsensor = mds_gen_strct->n_sensor; s->Nsensor = mds_gen_strct->n_sensor;
s->Nxfrc = mds_gen_strct->n_extforce; s->Nxfrc = mds_gen_strct->n_extforce;
...@@ -111,12 +111,12 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -111,12 +111,12 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
{ {
for(j=0; j<3; j++) for(j=0; j<3; j++)
{ {
s->dpt[j+1][i+1] = mds_gen_strct->point_list[i]->pt[j]; s->dpt[j+1][i+1] = mds_gen_strct->point_list[i]->pt[j];
mds_gen_strct->point_list[i]->d_pt[j]->MBSdata_d_ptr = &(s->dpt[j+1][i+1]); mds_gen_strct->point_list[i]->d_pt[j]->MBSdata_d_ptr = &(s->dpt[j+1][i+1]);
} }
} }
} }
else else
for(i=1;i<=3;i++) for(i=1;i<=3;i++)
s->dpt[i] = NULL; s->dpt[i] = NULL;
...@@ -130,7 +130,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -130,7 +130,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
s->l[i] = (double*) calloc(s->nbody+1,sizeof(double)); s->l[i] = (double*) calloc(s->nbody+1,sizeof(double));
s->l[i][0] = (double) s->nbody; s->l[i][0] = (double) s->nbody;
} }
s->m = (double*) calloc(s->nbody+1,sizeof(double)); s->m = (double*) calloc(s->nbody+1,sizeof(double));
s->m[0] = (double) s->nbody; s->m[0] = (double) s->nbody;
...@@ -146,23 +146,23 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -146,23 +146,23 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
ind_joint = ind_joint + mds_gen_strct->bodytree->body_list[i]->n_joint; ind_joint = ind_joint + mds_gen_strct->bodytree->body_list[i]->n_joint;
for(j=0; j<3; j++) for(j=0; j<3; j++)
{ {
s->l[j+1][ind_joint] = mds_gen_strct->bodytree->body_list[i]->com[j]; s->l[j+1][ind_joint] = mds_gen_strct->bodytree->body_list[i]->com[j];
} }
s->m[ind_joint] = mds_gen_strct->bodytree->body_list[i]->mass; s->m[ind_joint] = mds_gen_strct->bodytree->body_list[i]->mass;
s->In[1][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[0]; s->In[1][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[0];
s->In[2][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[1]; s->In[2][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[1];
s->In[3][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[2]; s->In[3][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[2];
s->In[4][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[1]; s->In[4][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[1];
s->In[5][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[3]; s->In[5][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[3];
s->In[6][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[4]; s->In[6][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[4];
s->In[7][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[2]; s->In[7][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[2];
s->In[8][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[4]; s->In[8][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[4];
s->In[9][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[5]; s->In[9][ind_joint] = mds_gen_strct->bodytree->body_list[i]->inertia[5];
} }
// g // g
s->g[0] = 0.0; s->g[0] = 0.0;
copy_double_vec(mds_gen_strct->base->gravity, &(s->g[1]), 3); copy_double_vec(mds_gen_strct->base->gravity, &(s->g[1]), 3);
...@@ -175,9 +175,9 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -175,9 +175,9 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
s->qdriven = MDS_translate_q(mds_gen_strct->bodytree->qdriven, mds_gen_strct->bodytree->n_qdriven); s->qdriven = MDS_translate_q(mds_gen_strct->bodytree->qdriven, mds_gen_strct->bodytree->n_qdriven);
s->qa = MDS_translate_q(mds_gen_strct->bodytree->qa, mds_gen_strct->bodytree->n_qa); s->qa = MDS_translate_q(mds_gen_strct->bodytree->qa, mds_gen_strct->bodytree->n_qa);
if (s->nhu) // to change
if (s->nhu) // to change
{ {
s->hu = (int*) calloc(s->nhu+1,sizeof(int)); s->hu = (int*) calloc(s->nhu+1,sizeof(int));
s->hu[0] = s->nhu; s->hu[0] = s->nhu;
...@@ -220,7 +220,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -220,7 +220,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
s->qmax = NULL; s->qmax = NULL;
// Frc, Trq, Qq, tsim // Frc, Trq, Qq, tsim
// frc // frc
s->frc[0] = NULL; s->frc[0] = NULL;
for(i=1;i<=3;i++) for(i=1;i<=3;i++)
...@@ -258,7 +258,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -258,7 +258,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
// 1 to stop the simulation, 0 otherwise // 1 to stop the simulation, 0 otherwise
s->flag_stop = 0; s->flag_stop = 0;
// Constraint data // Constraint data
// lrod // lrod
if (mds_gen_strct->cuts!=NULL && mds_gen_strct->cuts->n_rod) if (mds_gen_strct->cuts!=NULL && mds_gen_strct->cuts->n_rod)
...@@ -279,7 +279,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -279,7 +279,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
// Link Data // Link Data
// Z, Zd, Fl // Z, Zd, Fl
if (s->Nlink) if (s->Nlink)
{ {
s->Z = (double*) calloc(s->Nlink+1,sizeof(double)); s->Z = (double*) calloc(s->Nlink+1,sizeof(double));
...@@ -302,7 +302,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -302,7 +302,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
s->Fl = NULL; s->Fl = NULL;
} }
// l3DWr // l3DWr
if (s->Nlink3D) if (s->Nlink3D)
{ {
s->l3DWr = (double**) calloc(s->Nlink3D+1,sizeof(double*)); s->l3DWr = (double**) calloc(s->Nlink3D+1,sizeof(double*));
...@@ -317,9 +317,9 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -317,9 +317,9 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
else else
s->l3DWr = NULL; s->l3DWr = NULL;
// Ext. Forces Data // Ext. Forces Data
// xfidpt // xfidpt
if (s->Nxfrc) if (s->Nxfrc)
{ {
s->xfidpt = (int*) calloc(s->Nxfrc+1,sizeof(int)); s->xfidpt = (int*) calloc(s->Nxfrc+1,sizeof(int));
...@@ -347,7 +347,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -347,7 +347,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
else else
s->SWr = NULL; s->SWr = NULL;
// Wheel Data // Wheel Data
// rnom // rnom
if (s->Nwheel) if (s->Nwheel)
...@@ -365,8 +365,8 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -365,8 +365,8 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
// user_model // user_model
if (s->Nuser_model) if (s->Nuser_model)
{ {
s->user_model = s->mbs_new_user_model(); s->user_model = s->fct.user.mbs_new_user_model();
s->mbs_load_user_model_xml(mds_gen_strct, s->user_model); s->fct.user.mbs_load_user_model_xml(mds_gen_strct, s->user_model);
} }
else else
{ {
...@@ -382,7 +382,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -382,7 +382,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
s->ux[0] = (double) s->Nux; s->ux[0] = (double) s->Nux;
s->uxd[0] = (double) s->Nux; s->uxd[0] = (double) s->Nux;
s->ux0[0] = (double) s->Nux; s->ux0[0] = (double) s->Nux;
for(i=0; i<mds_gen_strct->n_state; i++) for(i=0; i<mds_gen_strct->n_state; i++)
{ {
for(j=0; j<mds_gen_strct->state_list[i]->n_value; j++) for(j=0; j<mds_gen_strct->state_list[i]->n_value; j++)
...@@ -400,7 +400,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -400,7 +400,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
s->ux0 = NULL; s->ux0 = NULL;
} }
s->user_IO = s->mbs_new_user_IO(s); s->user_IO = s->fct.user.mbs_new_user_IO(s);
#endif #endif
...@@ -427,7 +427,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct) ...@@ -427,7 +427,7 @@ MbsData* MDS_create_MBSdataStruct(MDS_gen_strct* mds_gen_strct)
} }
//////////////////////////////////////////////////////////////////////////// CAUTION CAUTION //////////////////////////////////////////////////////////////////////////// CAUTION CAUTION
void mbs_delete_data(MbsData *s) void mbs_delete_data(MbsData *s)
...@@ -518,16 +518,16 @@ void mbs_delete_data(MbsData *s) ...@@ -518,16 +518,16 @@ void mbs_delete_data(MbsData *s)
{ {
free(s->ux); free(s->ux);
free(s->uxd); free(s->uxd);
free(s->ux0); free(s->ux0);
} }
#ifndef SENSORKIN #ifndef SENSORKIN
// User models // User models
if (s->Nuser_model) if (s->Nuser_model)
{ {
s->mbs_delete_user_model(s->user_model); s->fct.user.mbs_delete_user_model(s->user_model);
} }
s->mbs_delete_user_IO(s->user_IO); s->fct.user.mbs_delete_user_IO(s->user_IO);
#endif #endif
// Other // Other
...@@ -536,7 +536,7 @@ void mbs_delete_data(MbsData *s) ...@@ -536,7 +536,7 @@ void mbs_delete_data(MbsData *s)
free(s->udd); free(s->udd);
} }
if (s->nhu) // to change if (s->nhu) // to change
{ {
free(s->hu); free(s->hu);
} }
......
...@@ -22,12 +22,12 @@ void mbs_calc_force(MbsData* s){ ...@@ -22,12 +22,12 @@ void mbs_calc_force(MbsData* s){
} }
} }
if(s->Nlink > 0) s->mbs_link(s->frc,s->trq,s->Fl,s->Z,s->Zd,s,s->tsim); if(s->Nlink > 0) s->fct.symb.mbs_link(s->frc,s->trq,s->Fl,s->Z,s->Zd,s,s->tsim);
if(s->Nlink3D > 0) s->mbs_link3D(s->frc,s->trq,s,s->tsim); if(s->Nlink3D > 0) s->fct.symb.mbs_link3D(s->frc,s->trq,s,s->tsim);
if(s->Nxfrc > 0) s->mbs_extforces(s->frc,s->trq,s,s->tsim); if(s->Nxfrc > 0) s->fct.symb.mbs_extforces(s->frc,s->trq,s,s->tsim);
s->Qq = s->user_JointForces(s,s->tsim); s->Qq = s->fct.user.user_JointForces(s,s->tsim);
} }
...@@ -53,7 +53,7 @@ int mbs_close_geo(MbsData *s, MbsAux *mbs_aux) ...@@ -53,7 +53,7 @@ int mbs_close_geo(MbsData *s, MbsAux *mbs_aux)
if(mbs_aux->norm_h > mbs_aux->NRerr) if(mbs_aux->norm_h > mbs_aux->NRerr)
{ {
// err // err
for(i=1;i<=s->nhu;i++) for(i=1;i<=s->nhu;i++)
{ {
mbs_aux->mJv_h[i] = mbs_aux->h[s->hu[i]]; mbs_aux->mJv_h[i] = mbs_aux->h[s->hu[i]];
...@@ -74,7 +74,7 @@ int mbs_close_geo(MbsData *s, MbsAux *mbs_aux) ...@@ -74,7 +74,7 @@ int mbs_close_geo(MbsData *s, MbsAux *mbs_aux)
} }
void mbs_close_kin(MbsData *s, MbsAux *mbs_aux) void mbs_close_kin(MbsData *s, MbsAux *mbs_aux)
{ {
int i,j,k; int i,j,k;
int nL,nC,nk; int nL,nC,nk;
...@@ -127,11 +127,11 @@ void mbs_calc_hJ(MbsData *s, MbsAux *mbs_aux) ...@@ -127,11 +127,11 @@ void mbs_calc_hJ(MbsData *s, MbsAux *mbs_aux)
// contraintes de fermeture de boucles // contraintes de fermeture de boucles
s->mbs_cons_hJ(mbs_aux->h,mbs_aux->Jac,s,s->tsim); s->fct.symb.mbs_cons_hJ(mbs_aux->h,mbs_aux->Jac,s,s->tsim);
// contraintes user // contraintes user
if (s->Nuserc>0) { if (s->Nuserc>0) {
s->user_cons_hJ(mbs_aux->huserc, mbs_aux->Juserc, s, s->tsim); s->fct.user.user_cons_hJ(mbs_aux->huserc, mbs_aux->Juserc, s, s->tsim);
// ajout des contraintes user aux contraintes de fermeture // ajout des contraintes user aux contraintes de fermeture
for (i=1;i<=s->Nuserc;i++) { for (i=1;i<=s->Nuserc;i++) {
...@@ -145,25 +145,25 @@ void mbs_calc_hJ(MbsData *s, MbsAux *mbs_aux) ...@@ -145,25 +145,25 @@ void mbs_calc_hJ(MbsData *s, MbsAux *mbs_aux)
void mbs_calc_jdqd(MbsData *s, MbsAux *mbs_aux) void mbs_calc_jdqd(MbsData *s, MbsAux *mbs_aux)
{ {
int i; int i;
// compute contribution of symbolic constraints to jdqd // compute contribution of symbolic constraints to jdqd
s->mbs_cons_jdqd(mbs_aux->jdqd,s,s->tsim); s->fct.symb.mbs_cons_jdqd(mbs_aux->jdqd,s,s->tsim);