Felt in FEM Workbench

About the development of the FEM module/workbench.

Moderator: 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 10:05 am @Jee-Bee: how did you find this?
just searched with this: https://duckduckgo.com/?q=qingfengxia+p ... org&ia=web
I remember that he has written something for developers so i scrolled down till i find something related ;) (in my case 13th item)
User avatar
bernd
Veteran
Posts: 12851
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 10:28 am 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?
not from the ActiveDocument, from the analysis group the selected solver object is inside for which the writer was called. Yes this is what I have written before ... If I start a new solver I set up the solver object, the tasks module and the writer module. In writer module I do not use objects from the document, just the analysis and the solver object and on run solver exact this example_input_file is written to file. If this works including result reading I go further and step by step really implement the writer to use FreeCAD FEM objects. This is done in all following commits. BTW. The example file was just copied from oofem manual: http://www.oofem.org/resources/doc/oofe ... ode61.html


Sudhanshu wrote: Fri Mar 29, 2019 10:28 am 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?
it depends. Best is if the FEM software can write the results to vtk or vtu. This is what oofem is able to. If so in tasks.py this vtu file is read and a vtk result pipline object in FreeCAD created. That is, very easy :-) One could also take the vtu and make PostProcessing in Paraview.


Sudhanshu wrote: Fri Mar 29, 2019 10:28 am 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,
it actually this module is the solver object with all its properties. have a look at calculix solver object. It has lots of properties to play with, mainly for nonlinear analysises.


Sudhanshu wrote: Fri Mar 29, 2019 10:28 am but what is a solver object in the first place?
Before you gone start a new solver, it is recommended to play with FreeCAD FEM and existing solver calculix. You will know than what a solver object is. There are some examples on Start WB

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

Re: Felt in FEM Workbench

Post by Sudhanshu »

Sudhanshu wrote: Fri Mar 29, 2019 10:28 am
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
I have read till the last commit: - FEM: oofem unit tests, input file writing

Now if I were to write out the steps that you followed (or that one should follow) while including a new solver are:

1. Make __init__.py and solver.py.
2. Register the new files in Fem.ObjectsFem.py, Fem.CMakeLists.txt, Fem.FemSolver.settings.py, and Fem.Femtest.testobject.py.
3. Create writer.py (with sample input file)
4. Create tasks.py
5. Add solver command in GUI.
6. Divide writer.py into seperate methods/functions and description of each function. (an example mesh was also added in writer.py)
7. Create mesh exporter file (in Fem.feminout/ )
8. Add mesh writing ability in writer.py and tasks.py (the example mesh is now removed)
9. Add the ability in writer.py to use solver specific input file instead of sample input file.
10. Add domain and cross-section in writer.py and tasks.py.
11. Add material, component size, constraints etc in writer.py.
12. Add GUI settings of solver (in Fem.Gui.*)
13. Add test files (in Fem.femtest.testfiles.<solver>.*)

Now what else is needed for complete inclusion of the solver?

Also, are any of these steps oofem specific?

Sudhanshu wrote: Fri Mar 29, 2019 10:28 am
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.
I read it and it says that the solver object is a document object that contains the properties of the solver that can be managed during analysis, which is similar to what you said.

I will ask my Civil Engineering friends to gain more knowledge of FEM analysis and FEM workbench.
Last edited by Sudhanshu on Sat Mar 30, 2019 8:35 am, edited 2 times in total.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Felt in FEM Workbench

Post by bernd »

mainly you are on the right track ...
Sudhanshu wrote: Sat Mar 30, 2019 5:50 am 7. Create mesh exporter file (in Fem.feminout/ )
your only need this if the solvers mesh input format is not known by FreeCAD FEM. If the mesh format is known by FreeCAD FEM I would not spend time to write another exporter :mrgreen: The other way around ... If your solver does write the results to a format which is not known by FreeCAD FEM you need to write an result importer, as we did with CalculiX frd result format.

Sudhanshu wrote: Sat Mar 30, 2019 5:50 am ... the solver object is a document object that contains the properties of the solver that can be managed during analysis, which is similar to what you said.
but you only need this if you would like to change solver parameter, which is normally needed for nonlinear analysis only. Thus z88 and oofem do not have any such parameter.
User avatar
hardeeprai
Posts: 177
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

Re: Felt in FEM Workbench

Post by hardeeprai »

bernd wrote: Fri Mar 29, 2019 6:04 am 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.
@Sudhanshu

The above is the great advice by @bernd

Start following it, and whatever difficulties you face, ask here.

All the best,
--
H.S.Rai
User avatar
Sudhanshu
Posts: 357
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Post by Sudhanshu »

bernd wrote: Sat Mar 30, 2019 6:22 am mainly you are on the right track ...
That's good then.
I will write try to document the steps of including a solver through my blog posts.

bernd wrote: Sat Mar 30, 2019 6:22 am
Sudhanshu wrote: Sat Mar 30, 2019 5:50 am 7. Create mesh exporter file (in Fem.feminout/ )
your only need this if the solvers mesh input format is not known by FreeCAD FEM. If the mesh format is known by FreeCAD FEM I would not spend time to write another exporter :mrgreen: The other way around ... If your solver does write the results to a format which is not known by FreeCAD FEM you need to write an result importer, as we did with CalculiX frd result format.
Since Felt also takes a mesh format unknown to FreeCAD FEM as input, guess I will have to write a mesh exporter/ parser after all.

bernd wrote: Sat Mar 30, 2019 6:22 am
Sudhanshu wrote: Sat Mar 30, 2019 5:50 am ... the solver object is a document object that contains the properties of the solver that can be managed during analysis, which is similar to what you said.
but you only need this if you would like to change solver parameter, which is normally needed for nonlinear analysis only. Thus z88 and oofem do not have any such parameter.
Felt also only does linear static and dynamic analysis, so I guess just copying the solver.py of oofem/z88 and making slight changes will do, right?
User avatar
Sudhanshu
Posts: 357
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Post by Sudhanshu »

hardeeprai wrote: Sun Mar 31, 2019 3:17 am
bernd wrote: Fri Mar 29, 2019 6:04 am 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.
@Sudhanshu

The above is the great advice by @bernd

Start following it, and whatever difficulties you face, ask here.
Ok, I will start coding and report here.

hardeeprai wrote: Sun Mar 31, 2019 3:17 am All the best,
Thanks. :D
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Felt in FEM Workbench

Post by bernd »

bad news:
- no further documentation, because I did do a lot of other stuff for FreeCAD
- a lot small changes in solver framework and thus in oofem branch
- a lot of changes in the commits inside oofem branch


very, very good news:
- just pushed all this to https://github.com/berndhahnebach/FreeC ... s/femoofem
- commits in oofem branch should be much better to understand and thus if one knows FEM workbench and Python, easy to understand whats happening


@hardeeprai:
thanks for your advice to Sudhanshu
User avatar
Sudhanshu
Posts: 357
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Post by Sudhanshu »

bernd wrote: Sun Mar 31, 2019 2:34 pm bad news:
- no further documentation, because I did do a lot of other stuff for FreeCAD
Are you saying that you are not going to do further documentation or further documentation is just not required because already enough is there?

bernd wrote: Sun Mar 31, 2019 2:34 pm - a lot small changes in solver framework and thus in oofem branch
- a lot of changes in the commits inside oofem branch


very, very good news:
- just pushed all this to https://github.com/berndhahnebach/FreeC ... s/femoofem
- commits in oofem branch should be much better to understand and thus if one knows FEM workbench and Python, easy to understand whats happening
Ok, I will look into them.
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 31, 2019 1:56 pm
Ok, I will start coding and report here.
I have created the solver object.
You can have a look at the code in my repo.

I am also trying to maintain daily blog of whatever I am doing related to this project.
Post Reply