FreeCAD as pre-post procesor for MBDyn

About the development of the FEM module/workbench.

Moderator: bernd

vocx
Posts: 1848
Joined: Thu Oct 18, 2018 9:18 pm

Re: FreeCAD as pre-post procesor for MBDyn

Postby vocx » Fri Sep 13, 2019 7:20 am

saso wrote:
Fri Sep 13, 2019 7:09 am
IMO it should be implemented as an add-on, the GPL license does not allow to distribute it directly with FreeCAD,
Yes, of course. I mean, the same way all solvers are used in FEM, they don't actually come with FreeCAD, the user has to get them separately.
... even if the implementation can be done similar to existing FEM solvers, this is not FEM.
Of course I know that, but still, it doesn't hurt if the FEM workbench is extended a bit to consider simulations that aren't strictly FEM.

I mentioned this earlier, a separate "Dynamics Workbench" could be created as well, maybe based on the code of FEM.
User avatar
bernd
Posts: 8468
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FreeCAD as pre-post procesor for MBDyn

Postby bernd » Fri Sep 13, 2019 7:51 am

saso wrote:
Fri Sep 13, 2019 7:09 am
vocx wrote:
Fri Sep 13, 2019 5:34 am
The way mfasano and josegegas describe the MBDyn solver (input file and command line execution), I feel it could be integrated very well into the FEM Workbench.
IMO it should be implemented as an add-on, the GPL license does not allow to distribute it directly with FreeCAD, as of now it is available only for linux and even if the implementation can be done similar to existing FEM solvers, this is not FEM.
FEM works as follows ...

- create an input file in solvers input code
- use Python module subprocess to start the solver binary
- read the result files created by the solver

- this would even allow to use a closed source solver (if the lincence would allow do distribute the solver), since we just run the binary, we do not use any solver code at all.
User avatar
bernd
Posts: 8468
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FreeCAD as pre-post procesor for MBDyn

Postby bernd » Fri Sep 13, 2019 7:53 am

FEM has a big advantage above all other open source FEM. The constraints are defined on the geometry not on the mesh. This makes it much more easier for daily usage.
User avatar
saso
Posts: 1336
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: FreeCAD as pre-post procesor for MBDyn

Postby saso » Fri Sep 13, 2019 7:54 am

bernd wrote:
Fri Sep 13, 2019 7:51 am
FEM works as follows ...

- create an input file in solvers input code
- use Python module subprocess to start the solver binary
- read the result files created by the solver

- this would even allow to use a closed source solver (if the lincence would allow do distribute the solver), since we just run the binary, we do not use any solver code at all.
I understand, but I mean by "technical" definition this is not FEM

How about if we would add a new forum under "Development", maybe something like "Systems engineering and Simulation"? While all of this can be used together in co-simulations, I feel that FEM and CFD deserve its own place and would move topic similar to this, about MBDyn, Modelica, SysML,... under it?
mfasano
Posts: 51
Joined: Wed Apr 11, 2018 12:31 pm

Re: FreeCAD as pre-post procesor for MBDyn

Postby mfasano » Fri Sep 13, 2019 12:36 pm

vocx wrote:
Fri Sep 13, 2019 5:34 am
bernd wrote:
Fri Sep 13, 2019 4:18 am
Creat work. He could have saved himself work if he would not have done it from scratch but would have used some existant code from FEM instead.
mfasano already knew about that GSoC project.

I only knew that it had been proposed by the MBDyn authors. I did not know about an actual project. He didn't come for help at the FreeCAD english forum. The report is in english; I don't know if it was translated. I think he could have been helped here.
josegegas
Posts: 39
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post procesor for MBDyn

Postby josegegas » Fri Sep 20, 2019 6:04 am

My code has been a big mess since I was just testing ideas. I have started adding comments and making all the classes more readable... By now all the workbench starts to take shape... Here's a triple pendulum simulation:

https://www.youtube.com/watch?v=aoeJjoc ... e=youtu.be

I'm not sure what's next. I'd like to share the code so we can probably start working on the workbench together? I'm not sure how to do this. I have a few classes and a very simple workbench with the icons and all. Is it possible to share the code here? Or do we need a github or gitlab? I'd also like if someone could try the workbench, so we can start catching errors and improving it? Ideas?
User avatar
bernd
Posts: 8468
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FreeCAD as pre-post procesor for MBDyn

Postby bernd » Fri Sep 20, 2019 6:10 am

josegegas wrote:
Fri Sep 20, 2019 6:04 am
Or do we need a github or gitlab?
This is for sure the best method to share code.
vocx
Posts: 1848
Joined: Thu Oct 18, 2018 9:18 pm

Re: FreeCAD as pre-post procesor for MBDyn

Postby vocx » Fri Sep 20, 2019 5:20 pm

josegegas wrote:
Fri Sep 20, 2019 6:04 am
My code has been a big mess since I was just testing ideas. I have started adding comments and making all the classes more readable... By now all the workbench starts to take shape... Here's a triple pendulum simulation:

https://www.youtube.com/watch?v=aoeJjoc ... e=youtu.be
This doesn't have collision detection, right? This means that at the moment the objects can go through the others, right?
...Or do we need a github or gitlab? I'd also like if someone could try the workbench, so we can start catching errors and improving it? Ideas?
Yes, publishing in GitHub would be nice. Then we could download it, install it, and make pull requests to propose changes and improvements. You need to choose a license. If it's a library license, like LGPL 2, MIT, or BSD-3 clause, it could be included in FreeCAD without problem. If you choose a more restrictive license like GPL 2 or GPL 3, then it can only be installed as an Addon.
josegegas
Posts: 39
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post procesor for MBDyn

Postby josegegas » Sat Sep 21, 2019 10:38 pm

No, no collision detection yet... It can be done tough. Yes, will share the code as soon as I have it nicely commented :)
josegegas
Posts: 39
Joined: Sat Feb 11, 2017 12:54 am
Location: New Zealand

Re: FreeCAD as pre-post procesor for MBDyn

Postby josegegas » Sat Oct 05, 2019 9:13 am

Hi.

Continuing with this project, found a problem. Can't import Pandas (import pandas as pd) from the FreeCAD python console... What could the solution be?

Cheers!