Felt in FEM Workbench

About the development of the FEM module/workbench.

Moderator: bernd

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

Re: Felt in FEM Workbench

Postby Sudhanshu » Sat May 04, 2019 7:26 pm

hardeeprai wrote:
Sat May 04, 2019 12:19 pm

@ Sudhanshu

It is long, we have not heard from you. Have you progressed further or any thing else who did related to FElt solver?
Due to my exams going on, I wasn't able to actively work on the project and report here, but I surely have done a few things.

Sudhanshu wrote:
Sat Apr 20, 2019 7:20 pm
When you say FreeCAD mod directory, are you referring to this:

Code: Select all

sudhanshu@dubey:/snap/freecad/8/opt/local/FreeCAD-0.18/Mod/Fem$ ls
femcommands    feminout  femobjects  femsolver  femtools    Init.py        Resources
femguiobjects  femmesh   femresult   femtest    InitGui.py  ObjectsFem.py  TestFem.py


So by putting my files here, I would be able to test them in FreeCAD?
As you can see in my Ubuntu system, the freecad files are there in /snap/freecad/ directory.
But this directory is mounted as a squashfs file system in read-only mode and so I wasn't able to put my code here.

So I tried compiling my the code instead, which is expected if I am trying to make some changes in freecad.
At first I encountered the error that some boost libraries are missing, but installing libboost-all-dev removed the error.

Then, there was "recompile with -fPIC" error which I removed by compiling freecad with python3.6 (earlier it was compiling with 2.7).

So finally my freecad compiled and I installed it in a directory in which I had the write permission.
But executing the FreeCAD binary showed the error that libFreeCADGUI.so is not found.
This error was removed by adding the location of libFreeCADGUI.so in /etc/ld.so.conf.d/freecad.conf and running libconfig command.

But I am getting "signal SIGSEGV, Segmentation fault." error which i am unable to remove as of now.
Quite strangely, this error is only there when I execute FreeCAD binary, whereas FreeCADCmd is executing without any error.
I can share the whole error message if someone wants to view it.

For the time being, I will test my code in FreeCADCmd only since I don't have any designing part to do.
User avatar
Sudhanshu
Posts: 50
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Postby Sudhanshu » Sun May 05, 2019 5:26 am

Sudhanshu wrote:
Sat May 04, 2019 7:26 pm

But I am getting "signal SIGSEGV, Segmentation fault." error which i am unable to remove as of now.
Quite strangely, this error is only there when I execute FreeCAD binary, whereas FreeCADCmd is executing without any error.
I can share the whole error message if someone wants to view it.

For the time being, I will test my code in FreeCADCmd only since I don't have any designing part to do.
I couldn't find any tutorial to get started with FreeCADCmd. I searched here but in vain.
Contrary to my expectations, FreeCADCmd seems to be different than the python intrepreter in the FreeCAD Gui.

Also, here is the error message that I am getting when trying to run FreeCAD that I compiled and installed:

Code: Select all

sudhanshu@dubey:~$ FreeCAD
FreeCAD 0.19, Libs: 0.19R16540 +10 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2019
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f6cc0a69f20]
#1  /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(Py_InitModule4_64+0x2b) [0x7f6cb634940b]
#2  /usr/lib/python3/dist-packages/PySide/QtCore.cpython-36m-x86_64-linux-gnu.so(PyInit_QtCore+0x4b) [0x7f6c8aff34cb]
#3  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyImport_LoadDynamicModuleWithSpec+0x180) [0x7f6cc2701360]
#4  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x15f3ff) [0x7f6cc27033ff]
#5  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyCFunction_Call+0xc1) [0x7f6cc27b7c11]
#6  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x7940) [0x7f6cc2728b10]
#7  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17b63f) [0x7f6cc271f63f]
#8  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17bd1e) [0x7f6cc271fd1e]
#9  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#10  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#11  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17beeb) [0x7f6cc271feeb]
#12  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#13  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#14  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17beeb) [0x7f6cc271feeb]
#15  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#16  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#17  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17beeb) [0x7f6cc271feeb]
#18  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#19  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#20  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17beeb) [0x7f6cc271feeb]
#21  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#22  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#23  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyFunction_FastCallDict+0x2c3) [0x7f6cc271fa43]
#24  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_FastCallDict+0x131) [0x7f6cc280cb41]
#25  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_CallMethodIdObjArgs+0xe6) [0x7f6cc280cea6]
#26  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyImport_ImportModuleLevelObject+0x45c) [0x7f6cc2614b4c]
#27  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x186538) [0x7f6cc272a538]
#28  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyCFunction_Call+0x96) [0x7f6cc27b7be6]
#29  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x7940) [0x7f6cc2728b10]
#30  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17b63f) [0x7f6cc271f63f]
#31  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17bd1e) [0x7f6cc271fd1e]
#32  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#33  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17b63f) [0x7f6cc271f63f]
#34  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyFunction_FastCallDict+0x1d1) [0x7f6cc271f951]
#35  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_FastCallDict+0x131) [0x7f6cc280cb41]
#36  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_CallMethodIdObjArgs+0xe6) [0x7f6cc280cea6]
#37  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyImport_ImportModuleLevelObject+0x55f) [0x7f6cc2614c4f]
#38  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x6f5a) [0x7f6cc272812a]
#39  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#40  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17beeb) [0x7f6cc271feeb]
#41  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#42  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#43  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17beeb) [0x7f6cc271feeb]
#44  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#45  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17b63f) [0x7f6cc271f63f]
#46  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCodeEx+0x3e) [0x7f6cc27200fe]
#47  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCode+0x1b) [0x7f6cc2720fdb]
#48  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x18827d) [0x7f6cc272c27d]
#49  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyCFunction_Call+0xc1) [0x7f6cc27b7c11]
#50  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x7940) [0x7f6cc2728b10]
#51  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17b63f) [0x7f6cc271f63f]
#52  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17bd1e) [0x7f6cc271fd1e]
#53  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#54  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#55  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17beeb) [0x7f6cc271feeb]
#56  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#57  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#58  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17beeb) [0x7f6cc271feeb]
#59  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#60  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#61  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17beeb) [0x7f6cc271feeb]
#62  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#63  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#64  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyFunction_FastCallDict+0x2c3) [0x7f6cc271fa43]
#65  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_FastCallDict+0x131) [0x7f6cc280cb41]
#66  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_CallMethodIdObjArgs+0xe6) [0x7f6cc280cea6]
#67  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyImport_ImportModuleLevelObject+0x45c) [0x7f6cc2614b4c]
#68  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x6f5a) [0x7f6cc272812a]
#69  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17b63f) [0x7f6cc271f63f]
#70  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCodeEx+0x3e) [0x7f6cc27200fe]
#71  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCode+0x1b) [0x7f6cc2720fdb]
#72  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x18827d) [0x7f6cc272c27d]
#73  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyCFunction_Call+0xc1) [0x7f6cc27b7c11]
#74  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x7940) [0x7f6cc2728b10]
#75  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17b63f) [0x7f6cc271f63f]
#76  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17bd1e) [0x7f6cc271fd1e]
#77  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#78  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#79  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17beeb) [0x7f6cc271feeb]
#80  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#81  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#82  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17beeb) [0x7f6cc271feeb]
#83  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#84  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#85  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17beeb) [0x7f6cc271feeb]
#86  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#87  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#88  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyFunction_FastCallDict+0x2c3) [0x7f6cc271fa43]
#89  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_FastCallDict+0x131) [0x7f6cc280cb41]
#90  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyObject_CallMethodIdObjArgs+0xe6) [0x7f6cc280cea6]
#91  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyImport_ImportModuleLevelObject+0x45c) [0x7f6cc2614b4c]
#92  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x6f5a) [0x7f6cc272812a]
#93  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17b63f) [0x7f6cc271f63f]
#94  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCodeEx+0x3e) [0x7f6cc27200fe]
#95  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x18716b) [0x7f6cc272b16b]
#96  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyCFunction_FastCallDict+0x20a) [0x7f6cc27b7a3a]
#97  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17be0c) [0x7f6cc271fe0c]
#98  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#99  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17b63f) [0x7f6cc271f63f]
#100  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCodeEx+0x3e) [0x7f6cc27200fe]
#101  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCode+0x1b) [0x7f6cc2720fdb]
#102  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyRun_StringFlags+0x8b) [0x7f6cc26f21ab]
#103  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x1881e7) [0x7f6cc272c1e7]
#104  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyCFunction_FastCallDict+0x1bb) [0x7f6cc27b79eb]
#105  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17be0c) [0x7f6cc271fe0c]
#106  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#107  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a4a3) [0x7f6cc271e4a3]
#108  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17beeb) [0x7f6cc271feeb]
#109  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec2) [0x7f6cc2726092]
#110  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17b63f) [0x7f6cc271f63f]
#111  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCodeEx+0x3e) [0x7f6cc27200fe]
#112  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCode+0x1b) [0x7f6cc2720fdb]
#113  /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyRun_StringFlags+0x8b) [0x7f6cc26f21ab]
#114  0x7f6cc2dcab12 in Base::InterpreterSingleton::runString[abi:cxx11](char const*) from /usr/local/lib/libFreeCADBase.so+0xf0
#115  0x7f6cc47d8e28 in Gui::Application::runInitGuiScript() from /usr/local/lib/libFreeCADGui.so+0x46
#116  0x7f6cc47daa64 in Gui::Application::runApplication() from /usr/local/lib/libFreeCADGui.so+0x1c14
#117  FreeCAD(main+0xa89) [0x564ba579a393]
#118  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f6cc0a4cb97]
#119  FreeCAD(_start+0x2a) [0x564ba579976a]

User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Felt in FEM Workbench

Postby bernd » Sun May 05, 2019 6:07 am

About all the general problem in the regard of installing or compiling it is best to make a separate topic in intstall/compile part of the forum.

But as stated before for teting your code you can use an installed FreeCAD too.
User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Felt in FEM Workbench

Postby bernd » Sun May 05, 2019 6:07 am

About all the general problem in the regard of installing or compiling it is best to make a separate topic in intstall/compile part of the forum.

But as stated before for teting your code you can use an installed FreeCAD too.
User avatar
Sudhanshu
Posts: 50
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Postby Sudhanshu » Sun May 05, 2019 7:35 am

bernd wrote:
Sun May 05, 2019 6:07 am
About all the general problem in the regard of installing or compiling it is best to make a separate topic in intstall/compile part of the forum.
Ok, I will do that.

bernd wrote:
Sun May 05, 2019 6:07 am
But as stated before for teting your code you can use an installed FreeCAD too.
The files of my installed freecad are in /snap/freecad which is mounted as a squashfs file system in read-only mode, and so I am unable to put my files there.

I found a good way of learning or using FreeCADCmd. I just need to make a macro using the GUI, cause the same commands run in FreeCADCmd too.
So finding a good FEM analysis macro will be helpful for me.
User avatar
hardeeprai
Posts: 164
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

Re: Felt in FEM Workbench

Postby hardeeprai » Sun May 05, 2019 1:24 pm

Sudhanshu wrote:
Sun May 05, 2019 7:35 am
I found a good way of learning or using FreeCADCmd. I just need to make a macro using the GUI, cause the same commands run in FreeCADCmd too.
So finding a good FEM analysis macro will be helpful for me.
This is sort of Reverse Engineering.

Things are not so difficult as described by you.

It looks that you are destined to learn much more than what you wished ;-)

You may try AppImage as well.

https://github.com/FreeCAD/FreeCAD/releases
https://www.freecadweb.org/wiki/Appimage

May read there: "Using AppImages in your Development Workflow"
--
H.S.Rai
User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Felt in FEM Workbench

Postby bernd » Mon May 06, 2019 8:41 am

Code: Select all

from femexamples import ccx_cantilever_std as canti
canti.setup_cantileverfaceload()
Will set up the calculix cantilever. Code can be found here: https://github.com/FreeCAD/FreeCAD/blob ... ver_std.py but I am with HarDeepRai, you should be able to use appimage or fix compile problems.
User avatar
Sudhanshu
Posts: 50
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Postby Sudhanshu » Mon May 06, 2019 3:17 pm

hardeeprai wrote:
Sun May 05, 2019 1:24 pm
Sudhanshu wrote:
Sun May 05, 2019 7:35 am
I found a good way of learning or using FreeCADCmd. I just need to make a macro using the GUI, cause the same commands run in FreeCADCmd too.
So finding a good FEM analysis macro will be helpful for me.
This is sort of Reverse Engineering.

Things are not so difficult as described by you.

It looks that you are destined to learn much more than what you wished ;-)

You may try AppImage as well.

https://github.com/FreeCAD/FreeCAD/releases
https://www.freecadweb.org/wiki/Appimage

May read there: "Using AppImages in your Development Workflow"
Thanks @hardeeprai for this wonderful advice.
This is by far the best approach for running and checking your code in FreeCAD.

Though there were some warnings when I executed the Appimage which I am sharing here:

Code: Select all

sudhanshu@dubey:~/Downloads/FreeCAD_App/squashfs-root$ ./AppRun 
/home/sudhanshu/Downloads/FreeCAD_App/squashfs-root
FreeCAD 0.19, Libs: 0.19R16540 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2019
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Gtk-Message: 20:20:58.409: Failed to load module "overlay-scrollbar"
Gtk-Message: 20:20:58.414: Failed to load module "gail"
Gtk-Message: 20:20:58.415: Failed to load module "atk-bridge"
Gtk-Message: 20:20:58.511: Failed to load module "canberra-gtk-module"
During initialization the error Missing parentheses in call to 'print'. Did you mean print("run import ...")? (<string>, line 108) occurred in /home/sudhanshu/.FreeCAD/Mod/geodata.bak/InitGui.py
Please look into the log file for further information
During initialization the error invalid syntax (<string>, line 69) occurred in /home/sudhanshu/.FreeCAD/Mod/animation/InitGui.py
Please look into the log file for further information

(FreeCAD:19994): GdkPixbuf-WARNING **: 20:21:29.142: Cannot open pixbuf loader module file '/home/travis/build/FreeCAD/FreeCAD-AppImage/conda/linux_dev/AppDir/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory

This likely means that your installation is broken.
Try running the command
  gdk-pixbuf-query-loaders > /home/travis/build/FreeCAD/FreeCAD-AppImage/conda/linux_dev/AppDir/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
So are they something serious or I can just let them be for the moment.
In my opinion, they don't seem much of a problem for now as they are somewhat related to AppImage only.

Also, is sharing the error message as "code" the right way? Or there is some specific way of sharing the error messages here in FreeCAD Forum?
User avatar
Sudhanshu
Posts: 50
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Postby Sudhanshu » Tue May 07, 2019 6:33 am

bernd wrote:
Mon May 06, 2019 8:41 am

Code: Select all

from femexamples import ccx_cantilever_std as canti
canti.setup_cantileverfaceload()
Will set up the calculix cantilever. Code can be found here: https://github.com/FreeCAD/FreeCAD/blob ... ver_std.py but I am with HarDeepRai, you should be able to use appimage or fix compile problems.
I am using AppImage for now.
Will also look into the compile error later on.

So using the AppImage, I was able to create the solver object and successfully write the input file.
But when I try to run solver, it gets hanged up here:

Image

The message I get at the terminal is this:

Code: Select all

No finite elemente mesh object was given to the writer class. In rare cases this might not be an error.
FemInputWriterCcx --> self.file_name  -->  /home/sudhanshu/Downloads/sample/freecad/beam.flt
Writing time input file: 0.0 seconds 

FELT-info: infile: beam.flt 

Solver binary path: /usr/local/bin/felt 
FELT-info: refile: /home/sudhanshu/Downloads/sample/freecad/1Dbeam.out 

Earlier, it was writing file beam.flt and searching for input file beam.in. So, I thought that was the error and modified it to search for beam.flt but its still not running.
The felt executable is there at /usr/local/bin/
Is it not able to execute the solver?
Come to think of it, felt needs some flags to run properly. Is that the issue?
If yes, the how can I pass the flags from tasks.py?
User avatar
Sudhanshu
Posts: 50
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Postby Sudhanshu » Wed May 15, 2019 6:55 pm

Today I finally got some time from my exams to continue my work.

First of, the code:

Code: Select all

FreeCAD.Console.PrintError('FELT-info: infile: {} \n\n'.format(infile))
Prints the error on the console:

Code: Select all

FELT-info: infile: beam.flt
(I still don't know the proper way of showing errors in the forum :?: )
So is that really an error or just an informational message?
My answer is that its's just a message because there is no exception handling code around it and it executes everytime.

That "error" message also forced me to think that whether there is a specific file format (or atleast extension) for the input file?
But after looking into the code of calculix and elmer, I guess the answer is no and the file format depends only on solver and not on FreeCAD.

Sudhanshu wrote:
Tue May 07, 2019 6:33 am

Earlier, it was writing file beam.flt and searching for input file beam.in. So, I thought that was the error and modified it to search for beam.flt but its still not running.
The felt executable is there at /usr/local/bin/
Is it not able to execute the solver?
Come to think of it, felt needs some flags to run properly. Is that the issue?
If yes, the how can I pass the flags from tasks.py?
To check this, I modified the code a bit in the tasks.py (with help from elmer's tasks.py) and its Solve method looks like this:

Code: Select all

class Solve(run.Solve):

    def run(self):
        if not _inputFileName:
            # TODO do not run solver, do not try to read results in a smarter way than an Exception
            raise Exception('Error on writing FELT input file.\n')
        infile = _inputFileName + '.flt'
        FreeCAD.Console.PrintError('FELT-info: infile: {} \n\n'.format(infile))

        self.pushStatus("Executing solver...\n")
       # binary = settings.get_binary("felt")
        binary = '/usr/bin/felt'  # if something goes wrong the binary path could be set for debugging
        if binary is not None:
      	    self._process = subprocess.Popen(
                [binary, "-f", infile],
                cwd=self.directory,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE)
            self.signalAbort.add(self._process.terminate)
            output = self._observeSolver(self._process)
            self._process.communicate()
            self.signalAbort.remove(self._process.terminate)
           # if not self.aborted:
            #     self._updateOutput(output)
	 else:
            self.report.error("Felt executable not found.")
            self.fail()
         del output   # get flake8 quiet
The changes being:

Code: Select all

diff --git a/src/Mod/Fem/femsolver/felt/tasks.py b/src/Mod/Fem/femsolver/felt/tasks.py
index 979c677d9..b483866e4 100644
--- a/src/Mod/Fem/femsolver/felt/tasks.py
+++ b/src/Mod/Fem/femsolver/felt/tasks.py
@@ -92,24 +92,28 @@ class Solve(run.Solve):
         if not _inputFileName:
             # TODO do not run solver, do not try to read results in a smarter way than an Exception
             raise Exception('Error on writing FELT input file.\n')
-        infile = _inputFileName + '.in'
+        infile = _inputFileName + '.flt'
         FreeCAD.Console.PrintError('FELT-info: infile: {} \n\n'.format(infile))
 
         self.pushStatus("Executing solver...\n")
-        binary = settings.get_binary("felt")
-        # binary = '/usr/bin/felt'  # if something goes wrong the binary path could be set for debugging
-        self._process = subprocess.Popen(
-            [binary, "-f", infile],
-            cwd=self.directory,
-            stdout=subprocess.PIPE,
-            stderr=subprocess.PIPE)
-        self.signalAbort.add(self._process.terminate)
-        output = self._observeSolver(self._process)
-        self._process.communicate()
-        self.signalAbort.remove(self._process.terminate)
-        # if not self.aborted:
-        #     self._updateOutput(output)
-        del output   # get flake8 quiet
+       # binary = settings.get_binary("felt")
+        binary = '/usr/bin/felt'  # if something goes wrong the binary path could be set for debugging
+        if binary is not None:
+           self._process = subprocess.Popen(
+                [binary, "-f", infile],
+                cwd=self.directory,
+                stdout=subprocess.PIPE,
+                stderr=subprocess.PIPE)
+            self.signalAbort.add(self._process.terminate)
+            output = self._observeSolver(self._process)
+            self._process.communicate()
+            self.signalAbort.remove(self._process.terminate)
+           # if not self.aborted:
+            #     self._updateOutput(output)
+        else:
+            self.report.error("Felt executable not found.")
+            self.fail()
+         del output   # get flake8 quiet
 
 
 class Results(run.Results):
 
And now when I execute the solver I get:

Code: Select all

Touched (but must be executed), Internal name: SolverFELT
as you can see in the below pic:

Image

So, my this doubt:

Sudhanshu wrote:
Tue May 07, 2019 6:33 am

Is it not able to execute the solver?
Come to think of it, felt needs some flags to run properly. Is that the issue?
If yes, the how can I pass the flags from tasks.py?
might actually be correct!!!
Investigating that, I got to know about the subprocess library of python which is used in tasks.py.
And it looks really interesting ;)
So now I will explore this, run the solver in python (outside of FreeCAD) and implement that tasks.py.