FEM on Mac OSX

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
Kunda1
Posts: 4581
Joined: Thu Jan 05, 2017 9:03 pm

Re: FEM on Mac OSX

Postby Kunda1 » Thu Feb 22, 2018 12:51 am

That should be stated in the documentation somewhere
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
chrisb
Posts: 16320
Joined: Tue Mar 17, 2015 9:14 am

Re: FEM on Mac OSX

Postby chrisb » Wed Mar 07, 2018 1:03 am

Update/comprehension to these posts:
https://forum.freecadweb.org/viewtopic. ... 30#p198642
https://forum.freecadweb.org/viewtopic. ... 40#p216356

I used the FreeCAD precompiled version shown below.
  • Install homebrew see https://brew.sh/
  • open a Terminal
  • run the command

    Code: Select all

    brew tap brewsci/science
    This is because the repository where the formula for installing calculix has been retired and moved to this new location.
    (No "sudo" is needed, nor even allowed.)
  • run the command

    Code: Select all

    brew install calculix-ccx
    (again no sudo or root installation)
  • type "ccx" and hit the TAB key. the "ccx" is expanded to the program found in the search path, in my case "ccx_2.13". Now go to the beginning of the line and enter in total the command

    Code: Select all

    type ccx_2.13
    This shows the place where ccx is installed. To be precise: this is only a link pointing to the executable. In my case it showed

    Code: Select all

    ccx_2.13 is /usr/local/bin/ccx_2.13
  • Start FreeCAD.
    Switch to FEM. This is important; otherwise the FEM preferences will not show up. Open Preferences, and switch to FEM->Calculix
  • Enter for ccx binary path the previously determined position. If you use the finder to select the binary, hit the keys CMD+SHIFT+. (the dot key).
    Dont worry if the path changes after selection. It's only the symbolic link being expanded
  • Save the Preferences
  • Close FreeCAD. This is important, otherwise calculix might not be found.
  • After restarting FreeCAD, you can go through the example as described in the wiki.
OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13346 (Git)
Build type: Release
Branch: (HEAD detached at 22ee06d)
Hash: 22ee06de8441bfcc9fded2c6de4232d763fb11bc
Python version: 2.7.14
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)
chrisb
Posts: 16320
Joined: Tue Mar 17, 2015 9:14 am

Re: FEM on Mac OSX

Postby chrisb » Wed Mar 07, 2018 1:17 am

I just finished my first FEM calculation. Thank you!
User avatar
bernd
Posts: 7908
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FEM on Mac OSX

Postby bernd » Wed Mar 07, 2018 6:43 am

chrisb wrote:
Wed Mar 07, 2018 1:17 am
I just finished my first FEM calculation. Thank you!
:) how about a coloured pic? Isn't it what all FEM is about? :mrgreen:
chrisb
Posts: 16320
Joined: Tue Mar 17, 2015 9:14 am

Re: FEM on Mac OSX

Postby chrisb » Wed Mar 07, 2018 7:39 am

bernd wrote:
Wed Mar 07, 2018 6:43 am
:) how about a coloured pic? Isn't it what all FEM is about? :mrgreen:
If it was my own model: sure. But now I have to confess that it was only one of the examples given on the Start page.
ppenguin
Posts: 1
Joined: Fri Mar 23, 2018 11:49 am

Re: FEM on Mac OSX

Postby ppenguin » Fri Mar 23, 2018 11:52 am

On a side note (since, no offense, the postproc capabilities of FC are a bit limited), I have had great results using paraview as a post processor for FEM results.
jmaustpc
Posts: 9406
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: FEM on Mac OSX

Postby jmaustpc » Fri Mar 23, 2018 12:08 pm

ppenguin wrote:
Fri Mar 23, 2018 11:52 am
On a side note (since, no offense, the postproc capabilities of FC are a bit limited), I have had great results using paraview as a post processor for FEM results.
what version of FreeCAD are you comparing to? The Help forum has a "forum rules" link above it that will show you how to use the FreeCAD tool to quote all your version data.
Locost
Posts: 6
Joined: Sun May 06, 2018 10:15 am

Re: FEM on Mac OSX

Postby Locost » Sun May 06, 2018 10:35 am

I'm trying to run FEM in FreeCAD on Mac OSX and having an issue that I don't believe was covered here. I did the following:

1. Installed freecad 0.17 using the dmg from the free cad wiki
2. Installed Gmsh using home brew (ie brew install gmsh --with-opencascade) and changed the binary path (ie /usr/local/Cellar/gmsh/3.0.6_2/bin/gmsh)
3. Tested Gmsh on a simple part which worked
4. Installed CalculiX (ie brew install Homebrew/homebrew-science/calculix-ccx) and changed the binary path (ie /usr/local/Cellar/calculix-ccx/2.13/bin/ccx_2.13)
5. Loaded the "FEM 3D example analysis", purged the results and tried executing the "Write .inp file" command.

The result is an error popup:

FEM: CalculiX ccx '/usr/local/Cellar/calculix-ccx/2.13/bin/ccx_2.13' output '' doesn't contain expected phrase 'CalculiX'. Please use ccx 2.6 or newer"

the message:

0.0: Check dependencies...

and the following in report view:

Using CalculiX binary path from FEM preferences: /usr/local/Cellar/calculix-ccx/2.13/bin/ccx_2.13
FemConstraintForce has Face reference shapes.
FEM preferences working dir is not set, the solver working directory is used.
Dir '' doesn't exist and cannot be created.
Dir '/var/folders/dh/d9y38r797610qkqhwf9qn6n00000gn/T' will be used instead.
FemToolsCCx.setup_working_dir() --> self.working_dir = /var/folders/dh/d9y38r797610qkqhwf9qn6n00000gn/T
FEM: wrong ccx binaryTraceback (most recent call last):
File "/Applications/FreeCAD.app/Contents/Mod/Fem/femguiobjects/_ViewProviderFemSolverCalculix.py", line 258, in write_input_file_handler
if self.check_prerequisites_helper():
File "/Applications/FreeCAD.app/Contents/Mod/Fem/femguiobjects/_ViewProviderFemSolverCalculix.py", line 279, in check_prerequisites_helper
fea = ccxtools.FemToolsCcx(None, self.solver_object)
File "/Applications/FreeCAD.app/Contents/Mod/Fem/femtools/ccxtools.py", line 81, in __init__
self.setup_ccx()
File "/Applications/FreeCAD.app/Contents/Mod/Fem/femtools/ccxtools.py", line 625, in setup_ccx
raise Exception(error_message)
Exception: FEM: CalculiX ccx '/usr/local/Cellar/calculix-ccx/2.13/bin/ccx_2.13' output '' doesn't contain expected phrase 'CalculiX'. Please use ccx 2.6 or newer

Has anyone had this issue in the past. From reading through posts on this forum it seems like I've installed everything properly. I'm stumped and would appreciate some advice regarding solving it.

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13519 (Git)
Build type: Release
Branch: (HEAD detached at 1a8b868)
Hash: 1a8b868018f45ea486c0023fdbfeb06febc1fb89
Python version: 2.7.14
Qt version: 5.10.1
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
User avatar
bernd
Posts: 7908
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FEM on Mac OSX

Postby bernd » Sun May 06, 2018 3:42 pm

could you run
/usr/local/Cellar/calculix-ccx/2.13/bin/ccx_2.13
in a shell and post the output?
Locost
Posts: 6
Joined: Sun May 06, 2018 10:15 am

Re: FEM on Mac OSX

Postby Locost » Mon May 07, 2018 10:18 am

I'm not all the familiar with python, but here are some outputs.

If I run it as a subprocess (ie subprocess.check_output("/usr/local/Cellar/calculix-ccx/2.13/bin/ccx_2.13")) I get

Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Applications/FreeCAD.app/Contents/lib/python2.7/subprocess.py", line 219, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '/usr/local/Cellar/calculix-ccx/2.13/bin/ccx_2.13' returned non-zero exit status -6

I also tried running it in terminal (ie ./usr/local/Cellar/calculix-ccx/2.13/bin/ccx_2.13) and got something similar

./ccx_2.13
dyld: Library not loaded: /usr/local/opt/gcc/lib/gcc/7/libgfortran.4.dylib
Referenced from: /usr/local/Cellar/calculix-ccx/2.13/bin/./ccx_2.13
Reason: image not found
Abort trap: 6

If I run through the FEM python tutorial (ie https://www.freecadweb.org/wiki/FEM_Tutorial_Python) I get an error in the python console after running fea = ccxtools.FemToolsCcx()

Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Applications/FreeCAD.app/Contents/Mod/Fem/femtools/ccxtools.py", line 81, in __init__
self.setup_ccx()
File "/Applications/FreeCAD.app/Contents/Mod/Fem/femtools/ccxtools.py", line 625, in setup_ccx
raise Exception(error_message)
Exception: FEM: CalculiX ccx '/usr/local/Cellar/calculix-ccx/2.13/bin/ccx_2.13' output '' doesn't contain expected phrase 'CalculiX'. Please use ccx 2.6 or newer

and in report view

FemConstraintForce has Face reference shapes.
FEM preferences working dir is not set, the solver working directory is used.
Dir '' doesn't exist and cannot be created.
Dir '/var/folders/dh/d9y38r797610qkqhwf9qn6n00000gn/T' will be used instead.
FemToolsCCx.setup_working_dir() --> self.working_dir = /var/folders/dh/d9y38r797610qkqhwf9qn6n00000gn/T
FEM: wrong ccx binary
Last edited by Locost on Wed May 09, 2018 2:52 am, edited 1 time in total.