Plenty of changes (https://github.com/HarryvL/FreeCAD/tree/assess) compared to my forked master, but so far “no show” of OOFEM solver object in the Fem>Solve drop down menu ![]()
I guess I still need to add a menu item here … https://github.com/HarryvL/FreeCAD/blob/f3f9ab96bff4de3bc2f340e958d82fac00105fca/src/Mod/Fem/Gui/Workbench.cpp#L121-L134
If so, why is there not also an entry for Z88, whereas it pops up in the Fem>Solve drop-down menu?
And I guess I missed one here:
A lot of guesswork ![]()
Once i get a tip of @bernd (he is kind of grep master) for searching terms in some files/ folders if some other exist
$ $ git checkout remotes/jee-bee/bucklebranch Note: checking out 'remotes/jee-bee/bucklebranch'. ... HEAD ist jetzt bei ed9e707... few bug fixes and typos $ $ grep -r EigenmodesCount src/Mod/Fem/FemTools.py: elif not hasattr(self.solver, "EigenmodesCount"): src/Mod/Fem/FemTools.py: message += "Frequency analysis: Solver has no EigenmodesCount.\n" src/Mod/Fem/Gui/DlgSettingsFemCcx.ui: <cstring>EigenmodesCount</cstring> src/Mod/Fem/TestFem.py: self.solver_object.EigenmodesCount = 10 src/Mod/Fem/TestFem.py: fea.solver.EigenmodesCount = 1 # we should only have one result object $Does this helps ? There are still a few in your bucklebranch. I assume the one which produces the error is in the “def check_prerequisites(self):” of FemTools but I did not have a closer look.
Once i get a tip of @bernd (he is kind of grep master) for searching terms in some files/ folders if some other exist
$ $ git checkout remotes/jee-bee/bucklebranch Note: checking out 'remotes/jee-bee/bucklebranch'. ... HEAD ist jetzt bei ed9e707... few bug fixes and typos $ $ grep -r EigenmodesCount src/Mod/Fem/FemTools.py: elif not hasattr(self.solver, "EigenmodesCount"): src/Mod/Fem/FemTools.py: message += "Frequency analysis: Solver has no EigenmodesCount.\n" src/Mod/Fem/Gui/DlgSettingsFemCcx.ui: <cstring>EigenmodesCount</cstring> src/Mod/Fem/TestFem.py: self.solver_object.EigenmodesCount = 10 src/Mod/Fem/TestFem.py: fea.solver.EigenmodesCount = 1 # we should only have one result object $Does this helps ? There are still a few in your bucklebranch. I assume the one which produces the error is in the “def check_prerequisites(self):” of FemTools but I did not have a closer look.
Thanks @ Jee-Bee
Plenty of changes (https://github.com/HarryvL/FreeCAD/tree/assess) compared to my forked master, but so far “no show” of OOFEM solver object in the Fem>Solve drop down menu
I guess I still need to add a menu item here … https://github.com/HarryvL/FreeCAD/blob/f3f9ab96bff4de3bc2f340e958d82fac00105fca/src/Mod/Fem/Gui/Workbench.cpp#L121-L134
If so, why is there not also an entry for Z88, whereas it pops up in the Fem>Solve drop-down menu?
because it is here https://github.com/HarryvL/FreeCAD/blob/f3f9ab96bff4de3bc2f340e958d82fac00105fca/src/Mod/Fem/Gui/Workbench.cpp#L252
z88 is missing above because these lines define the tool bar and z88 has no tool bar icon only a menue
Plenty of changes (https://github.com/HarryvL/FreeCAD/tree/assess) compared to my forked master, but so far “no show” of OOFEM solver object in the Fem>Solve drop down menu
I guess I still need to add a menu item here … https://github.com/HarryvL/FreeCAD/blob/f3f9ab96bff4de3bc2f340e958d82fac00105fca/src/Mod/Fem/Gui/Workbench.cpp#L121-L134
If so, why is there not also an entry for Z88, whereas it pops up in the Fem>Solve drop-down menu?
And I guess I missed one here:
A lot of guesswork
this is needed too. Without this workbench.cpp does not know the command which iss added to the menue and toolbar by workbench.cpp
But we can only export to vtk file format a FreeCAD FEM result ATM. We can not export a vtk pipeline to vtk even this would be not difficult to implement, because it just need to be writen. BTW, stefan would be something very easy to tackle down for you ?!
Yes, sure, I think this are few lines of code only. I will have a look at this too when I find time to tackle the VTK and node numbering issue we talked about.
@HarryvL: this may bei helpful too in the regbard of adding new command to FreeCAD FEM 7d7a02e
But we can only export to vtk file format a FreeCAD FEM result ATM. We can not export a vtk pipeline to vtk even this would be not difficult to implement, because it just need to be writen. BTW, stefan would be something very easy to tackle down for you ?!
Yes, sure, I think this are few lines of code only. I will have a look at this too when I find time to tackle the VTK and node numbering issue we talked about.
3628 and some helpful links …
@HarryvL: this may bei helpful too in the regbard of adding new command to FreeCAD FEM 7d7a02e
Thanks. I am gradually getting in the swing of things.
branch assess looks good to me. To get it first started I would go for the following.
- in module src/Mod/Fem/femsolver/oofem/writer.py define a string testinputfile = ‘’’ an simple complete oofem input file ‘’’
- in method def write_OOFEM_input(self): ( https://github.com/HarryvL/FreeCAD/blob/5abe315154de43e27946bf35de74232f81032a1d/src/Mod/Fem/femsolver/oofem/writer.py#L64-L81 ) you gone write the string testinputfile
- means no matter what FreeCAD analysis for objects has, if it has an oofem solver object in any case your testinputfile will be written.
- With this you can test if the new solver object works at all.
- if it works you can start to step by step implement the writer for oofem which does write the real FreeCAD object data to the oofem input file.
Hope you got my point. It is just an idea, how I did it when I mplemented the Z88.
OK this all works now for a dummy file. So far so good. Next the task of writing FC data in OOFEM input format ![]()
![]()
calculix cantilever is a good example and we will need it anyway as a official example for the new solver. see startwb, we have it for all three solvers in new solver frame work example.
There is another one you should keep in mind. All FEM python code is pep8 compatible. You can check easily by running the following command in your FreeCAD source tree.
find src/Mod/Fem/ -name "*\.py" | grep -v convert2TetGen.py | grep -v InitGui.py | grep -v TestFem.py | xargs -I [] flake8 --ignore=E501,E265,E266,E402 []
Thanks. Are there any good references about the architecture of FreeCAD? I mean the philosophy and implementation of C++ and Python class structure. It feel it would help speed up understanding of where and how methods and attributes are defined and perhaps more importantly when NOT to worry about this and just apply a method or data structure in a confident and predictable manner.
As far as I can tell the best way is to read the source and just do your thing, make a pull request (as small as possible) and the gurus will tell you if that’s OK or not. “git grep” + basic understanding how C++ works (headers, definitions, inheritance) is really a powerful tool. I know sometimes it would be better to read a doc i.e. “How to add a new command to a workbench”, but instead you can check git log for commit that added a new command and you’ll see all required changes in one place.
I also recommend using text editor that can run flake8/pep8 tests on file save - you get immediate feedback if your code formatting is OK.
As far as I can tell the best way is to read the source and just do your thing, make a pull request (as small as possible) and the gurus will tell you if that’s OK or not. “git grep” + basic understanding how C++ works (headers, definitions, inheritance) is really a powerful tool. I know sometimes it would be better to read a doc i.e. “How to add a new command to a workbench”, but instead you can check git log for commit that added a new command and you’ll see all required changes in one place.
I also recommend using text editor that can run flake8/pep8 tests on file save - you get immediate feedback if your code formatting is OK.
Thanks !
there is no coding standard in FreeCAD. I know just one, which is used in any workbench. Use spaces and no tabs.
As I wrote, in FEM we use pep8 compliant code. Since I have done most Python development in the last two years I check this on any new code. Means if you would like to have your code merged into FreeCAD FEM it is highly possible it has to pass my eyes before it gets merged and I will for sure check if it is pep8 compliant. ![]()
Thus runing flake8 from time to time while you are developing makes sence.
BTW: since I’m highly interested in this integrateion I will for sure try your new solver and have a look at the code before you are ready for a PR ![]()
bernd
there is no coding standard in FreeCAD. I know just one, which is used in any workbench. Use spaces and no tabs.
As I wrote, in FEM we use pep8 compliant code. Since I have done most Python development in the last two years I check this on any new code. Means if you would like to have your code merged into FreeCAD FEM it is highly possible it has to pass my eyes before it gets merged and I will for sure check if it is pep8 compliant.
Thus runing flake8 from time to time while you are developing makes sence.
BTW: since I’m highly interested in this integrateion I will for sure try your new solver and have a look at the code before you are ready for a PR
bernd
no pressure Harry ![]()