Fem constraint contact

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
PrzemoF
Posts: 2608
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Fem constraint contact

Postby PrzemoF » Mon Sep 26, 2016 4:40 pm

ccx path is not set in my case (for testing purpose) and:

Code: Select all

$ bin/FreeCAD ~/Downloads/contact_example.FCStd 
FreeCAD 0.17, Libs: 0.17R8509 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Using CalculiX binary path from FEM preferences: /home/przemo/software/FreeCAD/CalculiX/bin/ccx
FemTools.setup_working_dir()  -->  self.working_dir = /tmp
'FemToolsCcx' object has no attribute 'ccx_binary'Traceback (most recent call last):
  File "/home/przemo/software/FreeCAD/build/Mod/Fem/_TaskPanelFemSolverCalculix.py", line 186, in write_input_file_handler
    if self.check_prerequisites_helper():
  File "/home/przemo/software/FreeCAD/build/Mod/Fem/_TaskPanelFemSolverCalculix.py", line 208, in check_prerequisites_helper
    fea = FemToolsCcx.FemToolsCcx(None, self.solver_object)
  File "/home/przemo/software/FreeCAD/build/Mod/Fem/FemToolsCcx.py", line 79, in __init__
    self.setup_ccx()
  File "/home/przemo/software/FreeCAD/build/Mod/Fem/FemToolsCcx.py", line 150, in setup_ccx
    format(ccx_binary, ccx_stdout, ccx_binary_sig))
Exception: FEM: CalculiX ccx 'None' output 'None' doesn't contain expected phrase 'CalculiX'. Please use ccx 2.6 or newer
OS: "Fedora release 24 (Twenty Four)"
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8509 (Git)
Build type: Unknown
Branch: master
Hash: e4a086752f96823c43586ea88c73ab7c81ebbd13
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.8.0.oce-0.17
User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Fem constraint contact

Postby bernd » Mon Sep 26, 2016 7:58 pm

PrzemoF wrote:ccx path is not set in my case (for testing purpose) and:
I can reproduce the issue on

OS: Debian GNU/Linux 8.6 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8507 (Git)
Build type: Unknown
Branch: master
Hash: cb3da6ff9c45fe5726ad0d17580ebe6636b3ea55
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.0.0

If in preferences the check box use standard path is activated I get the same error. Funny thing is if the path is empty and the checkbox is not set it works fine for me. We need to have a look on this.
User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Fem constraint contact

Postby bernd » Tue Sep 27, 2016 4:42 am

User avatar
PrzemoF
Posts: 2608
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Fem constraint contact

Postby PrzemoF » Tue Sep 27, 2016 8:05 am

I managed to break it :-) If there is no ccx at all (one of my test setups) FreeCAD stays on checking dependencies with no error and command line shows this:

Code: Select all

[przemo@localhost build]$ bin/FreeCAD /media/sf_Transfer/FC/contact_example.FCStd 
FreeCAD 0.17, Libs: 0.17R8510 +1 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

which: no ccx in (/home/przemo/software/FreeCAD/build/bin:/home/przemo/software/FreeCAD/build/Mod/Sketcher:/home/przemo/software/FreeCAD/build/Mod/ReverseEngineering:/home/przemo/software/FreeCAD/build/Mod/Show:/home/przemo/software/FreeCAD/build/Mod/Image:/home/przemo/software/FreeCAD/build/Mod/PartDesign:/home/przemo/software/FreeCAD/build/Mod/Measure:/home/przemo/.FreeCAD/Mod/FreeCAD_assembly2:/home/przemo/software/FreeCAD/build/Mod/Ship:/home/przemo/software/FreeCAD/build/Mod/Plot:/home/przemo/software/FreeCAD/build/Mod/MeshPart:/home/przemo/software/FreeCAD/build/Mod/OpenSCAD:/home/przemo/software/FreeCAD/build/Mod/Fem:/home/przemo/software/FreeCAD/build/Mod/Spreadsheet:/home/przemo/software/FreeCAD/build/Mod/Start:/home/przemo/software/FreeCAD/build/Mod/Draft:/home/przemo/software/FreeCAD/build/Mod/Test:/home/przemo/software/FreeCAD/build/Mod/Import:/home/przemo/software/FreeCAD/build/Mod/TechDraw:/home/przemo/software/FreeCAD/build/Mod/Complete:/home/przemo/software/FreeCAD/build/Mod/Web:/home/przemo/software/FreeCAD/build/Mod/Material:/home/przemo/software/FreeCAD/build/Mod/Raytracing:/home/przemo/software/FreeCAD/build/Mod/Mesh:/home/przemo/software/FreeCAD/build/Mod/Path:/home/przemo/software/FreeCAD/build/Mod/Part:/home/przemo/software/FreeCAD/build/Mod/Arch:/home/przemo/software/FreeCAD/build/Mod/Robot:/home/przemo/software/FreeCAD/build/Mod/Points:/home/przemo/software/FreeCAD/build/Mod/Idf:/home/przemo/software/FreeCAD/build/Mod/Inspection:/home/przemo/software/FreeCAD/build/Mod/Drawing:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/przemo/.local/bin:/home/przemo/bin)
I didn't test it, but if I had ccx somewhere it would work :D

Failed "which" sets exit code to 1 - it can be used to tell there is no ccx on the system:

Code: Select all

[przemo@localhost freecad]$ which ccx
/usr/bin/which: no ccx in (/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/przemo/.local/bin:/home/przemo/bin)
[przemo@localhost freecad]$ echo $?
1
Shockley
Posts: 10
Joined: Sun Sep 25, 2016 11:44 pm
Location: Spain

Re: Fem constraint contact

Postby Shockley » Tue Sep 27, 2016 5:22 pm

bernd wrote:
Shockley wrote:FEM wb works fine on FreeCAD 0.17-8508 win 32bit version
Great

Shockley wrote:but FEM wb doesn't work on FreeCAD 0.17-8508 Linux 64 bit.
Does the contact example does not work for you on Linux or does FEMWB at all does not work on Linux. You can test easily by:
- start FreeCAD
- change to start workbench
- load 3d FEM example
- run Calculations

Does it create a Result for you on Linux?
Fixed!!

I've change the standard calculix path given by FreeCAD for "/usr/bin/ccx" I don't know why it error happen but after change the path the simulation works fine.
fixed2.png
fixed2.png (111.57 KiB) Viewed 1251 times
fixed1.png
fixed1.png (142.8 KiB) Viewed 1251 times
My system is:

OS: "Linux Mint 17.3 "Rosa""
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8509 (Git)
Build type: Unknown
Branch: master
Hash: e4a086752f96823c43586ea88c73ab7c81ebbd13
Python version: 2.7.12

I have one more question, Have you got this displacement when you run the simulation on your computer? (It seems going on the worng direction but I don't know).
wrong.png
wrong.png (184.48 KiB) Viewed 1251 times
Shockley
Posts: 10
Joined: Sun Sep 25, 2016 11:44 pm
Location: Spain

Re: Fem constraint contact

Postby Shockley » Tue Sep 27, 2016 9:42 pm

Cool sim achieved with FreeCAD
sim1.png
sim1.png (422.27 KiB) Viewed 1234 times
sim2.png
sim2.png (212.84 KiB) Viewed 1234 times
sim3.png
sim3.png (620.45 KiB) Viewed 1234 times
sim4.png
sim4.png (285.19 KiB) Viewed 1234 times
User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Fem constraint contact

Postby bernd » Wed Sep 28, 2016 5:33 am

Shockley wrote:I have one more question, Have you got this displacement when you run the simulation on your computer? (It seems going on the worng direction but I don't know).
Yes it moves up! The displacement constraint moves the half sphere up. As soon as the half sphere has contact with the cantilever it moves the cantilever up. The pressure is just another stiffness which results in more stress introduced by the moving up of the half sphere. Hope this explains it. BTW: great to see some one new using FEM.

There have been some changes, fixes and new features commited to FreeCAD master in the regard of FEM. I recommend to upgrade to at least 0.17.8537
User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Fem constraint contact

Postby bernd » Wed Sep 28, 2016 5:38 am

PrzemoF wrote:I managed to break it :-) If there is no ccx at all (one of my test setups) FreeCAD stays on checking dependencies with no error and command line shows this:

Code: Select all

[przemo@localhost build]$ bin/FreeCAD /media/sf_Transfer/FC/contact_example.FCStd 
FreeCAD 0.17, Libs: 0.17R8510 +1 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

which: no ccx in (/home/przemo/software/FreeCAD/build/bin:/home/przemo/software/FreeCAD/build/Mod/Sketcher:/home/przemo/software/FreeCAD/build/Mod/ReverseEngineering:/home/przemo/software/FreeCAD/build/Mod/Show:/home/przemo/software/FreeCAD/build/Mod/Image:/home/przemo/software/FreeCAD/build/Mod/PartDesign:/home/przemo/software/FreeCAD/build/Mod/Measure:/home/przemo/.FreeCAD/Mod/FreeCAD_assembly2:/home/przemo/software/FreeCAD/build/Mod/Ship:/home/przemo/software/FreeCAD/build/Mod/Plot:/home/przemo/software/FreeCAD/build/Mod/MeshPart:/home/przemo/software/FreeCAD/build/Mod/OpenSCAD:/home/przemo/software/FreeCAD/build/Mod/Fem:/home/przemo/software/FreeCAD/build/Mod/Spreadsheet:/home/przemo/software/FreeCAD/build/Mod/Start:/home/przemo/software/FreeCAD/build/Mod/Draft:/home/przemo/software/FreeCAD/build/Mod/Test:/home/przemo/software/FreeCAD/build/Mod/Import:/home/przemo/software/FreeCAD/build/Mod/TechDraw:/home/przemo/software/FreeCAD/build/Mod/Complete:/home/przemo/software/FreeCAD/build/Mod/Web:/home/przemo/software/FreeCAD/build/Mod/Material:/home/przemo/software/FreeCAD/build/Mod/Raytracing:/home/przemo/software/FreeCAD/build/Mod/Mesh:/home/przemo/software/FreeCAD/build/Mod/Path:/home/przemo/software/FreeCAD/build/Mod/Part:/home/przemo/software/FreeCAD/build/Mod/Arch:/home/przemo/software/FreeCAD/build/Mod/Robot:/home/przemo/software/FreeCAD/build/Mod/Points:/home/przemo/software/FreeCAD/build/Mod/Idf:/home/przemo/software/FreeCAD/build/Mod/Inspection:/home/przemo/software/FreeCAD/build/Mod/Drawing:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/przemo/.local/bin:/home/przemo/bin)
I didn't test it, but if I had ccx somewhere it would work :D

Failed "which" sets exit code to 1 - it can be used to tell there is no ccx on the system:

Code: Select all

[przemo@localhost freecad]$ which ccx
/usr/bin/which: no ccx in (/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/przemo/.local/bin:/home/przemo/bin)
[przemo@localhost freecad]$ echo $?
1
I did not test without ccx. I will have a look. BTW on my system (debian jessie) it gives without ccx:

Code: Select all

FemTools.setup_working_dir()  -->  self.working_dir = /tmp/FEMWB/
Running the Python command 'Fem_RunSolver' failed:
Traceback (most recent call last):
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/_CommandRunSolver.py", line 59, in Activated
    self.fea = FemToolsCcx.FemToolsCcx(None, self.solver)
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/FemToolsCcx.py", line 79, in __init__
    self.setup_ccx()
  File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Fem/FemToolsCcx.py", line 120, in setup_ccx
    self.ccx_binary = ccx_path

local variable 'ccx_path' referenced before assignment
Shockley
Posts: 10
Joined: Sun Sep 25, 2016 11:44 pm
Location: Spain

Re: Fem constraint contact

Postby Shockley » Wed Sep 28, 2016 5:48 pm

bernd wrote:
Shockley wrote:I have one more question, Have you got this displacement when you run the simulation on your computer? (It seems going on the worng direction but I don't know).
Yes it moves up! The displacement constraint moves the half sphere up. As soon as the half sphere has contact with the cantilever it moves the cantilever up. The pressure is just another stiffness which results in more stress introduced by the moving up of the half sphere. Hope this explains it. BTW: great to see some one new using FEM.

There have been some changes, fixes and new features commited to FreeCAD master in the regard of FEM. I recommend to upgrade to at least 0.17.8537
I've FreeCAD Daily version but the lastest update for me is 0.17-8509 version I've the PPAs added to my computer for every day update, I guess that in windows updates are published first and after the update come to the PPAs for the Linux version, it has one day of delay (at least for me) between windows and Linux version.
User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Fem constraint contact

Postby bernd » Thu Sep 29, 2016 4:24 pm

PrzemoF wrote:I managed to break it :-)
Fixed. Are you still able to break it? https://github.com/berndhahnebach/FreeC ... athonlinux