Commit edbcd38b authored by Sebastien Timmermans's avatar Sebastien Timmermans 🎹
Browse files

[dd] moving oneshot filename check

parent 200e6a84
......@@ -194,13 +194,6 @@ int mbs_run_dirdyn(MbsDirdyn* dd, MbsData* mbs_data)
{
int err = 0;
if (dd->options->flag_oneshot)
{
mbs_msg("\n>>DIRDYN>> One shot evaluation of the direct dynamics is activated.\n");
dd->options->resfilename = "oneshot";
mbs_msg("\n>>DIRDYN>> Output filename is called oneshot by default.\n");
}
// 1. Initialize the simulation
// - - - - - - - - - - - - - -
err = mbs_dirdyn_init(dd, mbs_data);
......@@ -313,6 +306,10 @@ int mbs_dirdyn_init(MbsDirdyn* dd, MbsData* mbs_data)
if (dd->options->verbose)
{
mbs_msg("\n>>DIRDYN>> Starting direct dynamics module.\n");
if (dd->options->flag_oneshot)
{
mbs_msg("\n>>DIRDYN>> One shot evaluation of the direct dynamics is activated.\n");
}
}
// Checking mbs_data coherence
......@@ -476,9 +473,14 @@ int mbs_dirdyn_init(MbsDirdyn* dd, MbsData* mbs_data)
bufElemNb = (int*)malloc(bufSize * sizeof(int));
// set the filename if not specified
if (dd->options->resfilename == NULL) {
if (dd->options->resfilename == NULL && !dd->options->flag_oneshot) {
resfilename = "dirdyn";
}
else if (dd->options->resfilename == NULL && dd->options->flag_oneshot)
{
resfilename = "oneshot";
mbs_msg("\n>>DIRDYN>> Output filename is called 'oneshot' by default.\n");
}
else {
resfilename = dd->options->resfilename;
}
......
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