Commit 561a752a authored by Nicolas Docquier's avatar Nicolas Docquier
Browse files

Merge branch 'mbs_dirdyn_user' into 'master'

Mbs dirdyn user

The field Mbsdirdyn is provided to the user through the file user_dirdyn.c

Pay attention that the user_dirdyn.c file generated with MBsysPad for a new project should be updated.

See merge request !18
parents 9276dbe1 a183cec8
//---------------------------
// UCL-CEREM-MBS
//
// @version MBsysLab_s 1.7.a
//
// Creation : 2015
// Last update : 08/05/2015
//---------------------------
#include "math.h"
#include "MBSdef.h"
#include "mbs_data.h"
#include "mbs_dirdyn.h"
/*! \brief user own initialization functions
*
* \param[in,out] mbs_data data structure of the model
* \param[in,out] mbs_dd general structure of the direct dynamic module (for advance users)
*
* For beginners, it is advised to only use the MbsData structure.
* The field MbsDirdyn is provided for more advance users.
*/
void user_init(MbsData *mbs_data, MbsDirdyn *mbs_dd)
{
}
/*! \brief user own loop functions
*
* \param[in,out] mbs_data data structure of the model
* \param[in,out] mbs_dd general structure of the direct dynamic module (for advance users)
*
* For beginners, it is advised to only use the MbsData structure.
* The field MbsDirdyn is provided for more advance users.
*/
void user_loop(MbsData *mbs_data, MbsDirdyn *mbs_dd)
{
}
/*! \brief user own finishing functions
*
* \param[in,out] mbs_data data structure of the model
* \param[in,out] mbs_dd general structure of the direct dynamic module (for advance users)
*
* For beginners, it is advised to only use the MbsData structure.
* The field MbsDirdyn is provided for more advance users.
*/
void user_finish(MbsData *mbs_data, MbsDirdyn *mbs_dd)
{
}
//---------------------------
// UCL-CEREM-MBS
//
// @version MBsysLab_s 1.7.a
//
// Creation : 2015
// Last update : 08/05/2015
//---------------------------
#include "math.h"
#include "MBSdef.h"
#include "mbs_data.h"
#include "mbs_aux.h"
void user_finish(MbsData *mbs_data, MbsAux *mbs_aux)
{
}
//---------------------------
// UCL-CEREM-MBS
//
// @version MBsysLab_s 1.7.a
//
// Creation : 2015
// Last update : 08/05/2015
//---------------------------
#include "math.h"
#include "MBSdef.h"
#include "mbs_data.h"
#include "mbs_aux.h"
void user_init(MbsData *mbs_data, MbsAux *mbs_aux)
{
}
//---------------------------
// UCL-CEREM-MBS
//
// @version MBsysLab_s 1.7.a
//
// Creation : 2015
// Last update : 08/05/2015
//---------------------------
#include "math.h"
#include "MBSdef.h"
#include "mbs_data.h"
#include "mbs_aux.h"
void user_loop(MbsData *mbs_data, MbsAux *mbs_aux)
{
}
......@@ -144,7 +144,7 @@ void mbs_dirdyn_init(MbsDirdyn* dd, MbsData* mbs_data){
dd->dt = dd->options->dt0;
// user intialization
user_init(mbs_data, dd->mbs_aux);
user_init(mbs_data, dd);
// Simulation state initialization
for(i=1; i<=mbs_data->nqu; i++)
......@@ -257,7 +257,7 @@ void mbs_dirdyn_loop(MbsDirdyn* dd, MbsData* mbs_data){
while(dd->tsim < dd->options->tf){
// user loop
user_loop(mbs_data, dd->mbs_aux);
user_loop(mbs_data, dd);
mbs_fct_dirdyn(dd->tsim, dd->y, dd->yd, mbs_data, dd->mbs_aux, dd->options);
rk4(dd->y, dd->yd, dd->nState, dd->tsim, dd->dt, dd->yout, mbs_fct_dirdyn, mbs_data, dd->mbs_aux, dd->options);
......@@ -322,7 +322,7 @@ void mbs_dirdyn_finish(MbsDirdyn* dd, MbsData* mbs_data){
#endif
// user finalization
user_finish(mbs_data, dd->mbs_aux);
user_finish(mbs_data, dd);
free(dd->y);
free(dd->yd);
......
......@@ -7,6 +7,7 @@
#include "mbs_data.h"
#include "mbs_aux.h"
#include "mbs_dirdyn.h"
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -14,9 +15,9 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void user_init(MbsData *MBSdata, MbsAux *mbs_aux);
void user_loop(MbsData *MBSdata, MbsAux *mbs_aux);
void user_finish(MbsData *MBSdata, MbsAux *mbs_aux);
void user_init(MbsData *MBSdata, MbsDirdyn *mbs_dd);
void user_loop(MbsData *MBSdata, MbsDirdyn *mbs_dd);
void user_finish(MbsData *MBSdata, MbsDirdyn *mbs_dd);
void user_cons_hJ(double *h, double **Jac, MbsData *s, double tsim);
......
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