In my last post, we looked at the backstory of my current project which is inclusion of the FElt FEM solver in FreeCAD. But before actually doing anything, we should know "how to do it" i.e the algorithm of that process. So what we will discuss today is the step-by-step procedure of including a new solver in FreeCAD.
I made this guide after studying the commits made by Bernd for including the OOFEM solver in FreeCAD. I can't gaurantee about the correctness of this guide right now as I haven't actually performed these steps, myself yet. But surely, as I go about doing them, I will update this blog with the most accurate descriptions of each steps and add what ateps I may need to take to completly integrate FElt in FreeCAD.
So the steps are as follow:
- Make init.py and solver.py.
- Register the new files in Fem.ObjectsFem.py, Fem.CMakeLists.txt, Fem.FemSolver.settings.py, and Fem.Femtest.testobject.py.
- Create writer.py (with sample input file)
- Create tasks.py
- Add solver command in GUI.
- Divide writer.py into seperate methods/functions and description of each function. (an example mesh was also added in writer.py)
- Create mesh exporter file (in Fem.feminout/ ) [You only need to perform this step if your solver's mesh format in unknown to FreeCAD FEM]
- Add mesh writing ability in writer.py and tasks.py (the example mesh is now removed)
- Add the ability in writer.py to use solver specific input file instead of sample input file.
- Add domain and cross-section in writer.py and tasks.py.
- Add material, component size, constraints etc in writer.py.
- Add GUI settings of solver (in Fem.Gui.*)
- Add test files (in Fem.femtest.testfiles..*)
So as I said, there will be more additions and changes in this blog, so stay tuned!