Felt in FEM Workbench

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
Sudhanshu
Posts: 357
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Post by Sudhanshu »

Sudhanshu wrote: Tue Jan 15, 2019 4:46 am
Kunda1 wrote: Mon Jan 14, 2019 11:48 am Try following this thread on ooFem whereby @bernd mentors how to integrate a solver in to FEM. Also you probably want to start your own thread and perhaps reference it from this thread so people can follow it (to avoid hijacking this thread)
Thanks!
I will go through that thread and see what all I could learn from it.
Sorry for the late reply.
I have read the thread that @Kunda1 mentioned. It was really helpful.
To get started, I have forked the FreeCAD repo here.

The next steps according to me are:

- Create a new branch, I will call it femfelt.
- in module src/Mod/Fem/femsolver/oofem/writer.py define a string testinputfile = ''' an simple complete oofem input file ''' (as guided by bernd)
User avatar
Sudhanshu
Posts: 357
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Post by Sudhanshu »

bernd wrote: Tue Jan 15, 2019 6:23 am check this branch https://github.com/berndhahnebach/FreeC ... s/femoofem I rewrote history for a better understanding what is needed for a new solver ...

bernd

ahh welcome to the world of FreeCAD FEM ... :D
Thanks for having me here ( and again sorry for the late reply)

I visited the commits' log mentioned here too and there were newer commits which I don't think were related to OOFEM integration.
I will try to look at older commits after I clone my repo (currently having some network issues).
User avatar
Sudhanshu
Posts: 357
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Post by Sudhanshu »

Sudhanshu wrote: Sun Mar 17, 2019 7:30 pm
To get started, I have forked the FreeCAD repo here.

The next steps according to me are:

- Create a new branch, I will call it femfelt.
- in module src/Mod/Fem/femsolver/oofem/writer.py define a string testinputfile = ''' an simple complete oofem input file ''' (as guided by bernd)
I have created the __init__.py file in src/Mod/Fem/felt. (https://github.com/Sudhanshu-Dubey14/Fr ... olver/felt)

I have noticed that every solver has atleast the following files:

writer.py
solver.py
tasks.py

So can anyone give a brief description about these files and their purpose or maybe a link to their documentation ?
User avatar
Sudhanshu
Posts: 357
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Post by Sudhanshu »

Sudhanshu wrote: Mon Mar 18, 2019 5:35 am
I have noticed that every solver has atleast the following files:

writer.py
solver.py
tasks.py

So can anyone give a brief description about these files and their purpose or maybe a link to their documentation ?
I found some documentation related to FEM Module here:

https://github.com/qingfengxia/FreeCAD_ ... 170101.pdf

But it looks like it was designed for FreeCAD 0.16, is there any more recent developer documentation?
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Felt in FEM Workbench

Post by bernd »

Sudhanshu wrote: Fri Mar 29, 2019 5:47 am
I found some documentation related to FEM Module here:

https://github.com/qingfengxia/FreeCAD_ ... 170101.pdf

But it looks like it was designed for FreeCAD 0.16, ...
wow what an amount of work. The author does write code for FreeCAD FEM and from time to time posts his code and makes a PR, but he is not an active forum member. He has never posted about this book (at least I have not seen some post about it). Means I do not know at all if this could still be used for FEM.

Sudhanshu wrote: Fri Mar 29, 2019 5:47 am is there any more recent developer documentation?
Yes, the forum. If you have any specific question just ask here in the forum.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Felt in FEM Workbench

Post by bernd »

Sudhanshu wrote: Mon Mar 18, 2019 5:35 am I have noticed that every solver has atleast the following files:

writer.py
solver.py
tasks.py

So can anyone give a brief description about these files and their purpose or maybe a link to their documentation ?
Mhh not easy do describe in a few words ... best is to have a look at this branch: https://github.com/berndhahnebach/FreeC ... s/femoofem

it is the most up to date documentation on how to add a new solver. Just start with the first commit which starts with "FEM: oofem, ... " Check every commit step by step. You should do the same steps. The first two commits are the most important ones.

- "FEM: oofem, add solver object"
- "FEM: oofem, add task and input file writer modules (the solver runs :-) with a given input file, a string in writer)"

I do not post the links because of steady changes the links changes too (even if the commit itself does not change). With them you should be able to get your solver up and running. For them you would not even need to compile FreeCAD. Give it a try and if you run into trouble just ask.

You could check these documentations ...Extend_FEM_Module, the module names have changed to lower case character, but basically it is the same. The equation system is used by Elmer only. It is easier to start without this system.

I may give more informations later on over the weekend

cheers bernd
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Felt in FEM Workbench

Post by Jee-Bee »

bernd wrote: Fri Mar 29, 2019 5:55 am He has never posted about this book (at least I have not seen some post about it).
see https://forum.freecadweb.org/viewtopic.php?t=17581
User avatar
Sudhanshu
Posts: 357
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Post by Sudhanshu »

bernd wrote: Fri Mar 29, 2019 5:55 am
Sudhanshu wrote: Fri Mar 29, 2019 5:47 am
I found some documentation related to FEM Module here:

https://github.com/qingfengxia/FreeCAD_ ... 170101.pdf

But it looks like it was designed for FreeCAD 0.16, ...
wow what an amount of work. The author does write code for FreeCAD FEM and from time to time posts his code and makes a PR, but he is not an active forum member. He has never posted about this book (at least I have not seen some post about it). Means I do not know at all if this could still be used for FEM.
I found this file here: https://www.freecadweb.org/wiki/Develop ... .27s_guide
bernd wrote: Fri Mar 29, 2019 5:55 am
Sudhanshu wrote: Fri Mar 29, 2019 5:47 am is there any more recent developer documentation?
Yes, the forum. If you have any specific question just ask here in the forum.
Definitely.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Felt in FEM Workbench

Post by bernd »

@Jee-Bee: how did you find this?
User avatar
Sudhanshu
Posts: 357
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Post by Sudhanshu »

bernd wrote: Fri Mar 29, 2019 6:04 am
Sudhanshu wrote: Mon Mar 18, 2019 5:35 am I have noticed that every solver has atleast the following files:

writer.py
solver.py
tasks.py

So can anyone give a brief description about these files and their purpose or maybe a link to their documentation ?
Mhh not easy do describe in a few words ... best is to have a look at this branch: https://github.com/berndhahnebach/FreeC ... s/femoofem

it is the most up to date documentation on how to add a new solver. Just start with the first commit which starts with "FEM: oofem, ... " Check every commit step by step. You should do the same steps. The first two commits are the most important ones.

- "FEM: oofem, add solver object"
- "FEM: oofem, add task and input file writer modules (the solver runs :-) with a given input file, a string in writer)"
Till now, I have read till the 4th commit: - FEM: examples, oofem plane stress 2d and canti oofem solver

And it was really helpful. :D

Regarding the questions about the 3 files that I asked earlier, I think I have got the answer to some extent:

1. writer.py: It takes the FreeCAD.ActiveDocument as input, extracts data from it and creates an input file in the solver specific format.
One question here is that in the end you have defined an example_input_file and given data to it. Is that data in the specific format in which oofem takes its input?

2. tasks.py: It performs all the tasks related to solving such as checking for correct input, invoking writer.py, running the solver and then writing
results to FreeCAD Gui.
The question here is that is the result being written in a seperate file and then being exported to GUI via VTK or is it being directly written ActiveDocument?

3. solver.py: Actually I am not much clear regarding its function. It creates a solver object which is the first step in invoking a solver, but what is a
solver object in the first place?

bernd wrote: Fri Mar 29, 2019 6:04 am You could check these documentations ...Extend_FEM_Module, the module names have changed to lower case character, but basically it is the same.
I am yet to read this one.

bernd wrote: Fri Mar 29, 2019 6:04 am I may give more informations later on over the weekend
I will be waiting.
Post Reply