Thanks. I am gradually getting in the swing of things.
OK this all works now for a dummy file. So far so good. Next the task of writing FC data in OOFEM input formatbernd wrote: ↑Mon Oct 08, 2018 8:19 pmbranch 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 ... 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.
Code: Select all
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 !PrzemoF wrote: ↑Thu Oct 11, 2018 7:52 amAs 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.
no pressure Harrybernd wrote: ↑Thu Oct 11, 2018 10:33 amthere 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