[Improvement] Write results to file when error occurs
When a simulation encounter a error message we write the buffers to files so the user can see what append before the error.
This is implemented for:
Do we have something to write in the case of modal or equilibrium analysis?
Old issue text
In the dirdyn module, it could be implemented by calling
mbs_dirdyn_write_buffers before generating the following error message:
- Loop closing Error
- qd[%d] is Nan (by the way we should add the tsim information to the message)
- qdd[%d] is Nan (by the way we should add the tsim information to the message)
- User derivative uxd[%d] is Nan (by the way we should add the tsim information to the message and the ux ID)
For the other errors:
- The reduced mass matrix has a line of zeros
- choldc failed
- Singular matrix in routine ludcmp We will have to modify the return value of the function with an error code (integer). This is needed because we need the module structure (MbsEquil, MbsModal...) to access the buffers (even if some functions are module dedicated for now).
This will avoid user to restard simulation with