alternatives to netgen? gmsh?

About the development of the FEM module/workbench.

Moderator: bernd

kuroshivo
Posts: 39
Joined: Mon Dec 22, 2014 3:16 pm
Contact:

alternatives to netgen? gmsh?

Post by kuroshivo »

Hi all

I am one of those who were not able to compile FreeCAD with -DBUILD_FEM_NETGEN=1.
Would it be possible to use Gmsh (http://geuz.org/gmsh/) instead of netgen?
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: alternatives to netgen? gmsh?

Post by wmayer »

Would it be possible to use Gmsh (http://geuz.org/gmsh/) instead of netgen?
No. The point is that we don't use netgen directly but by a thin wrapper offered by the SMESH module. However, SMESH doesn't support gmesh and I guess it won't do in the future because gmsh is available under GPL which will cause some license problems.
kuroshivo
Posts: 39
Joined: Mon Dec 22, 2014 3:16 pm
Contact:

Re: alternatives to netgen? gmsh?

Post by kuroshivo »

What about exporting as BREP, calling gmsh and parsing the resulting .msh file?
It would be something similar to the way I understand calculix is used from FreeCAD, wouldn't it?
User avatar
psicofil
Posts: 154
Joined: Thu Dec 15, 2011 11:02 pm

Re: alternatives to netgen? gmsh?

Post by psicofil »

A few weeks ago I created a small macro to create mesh inside of freecad with GMSH, because I could never compile NetGen with FreeCAD. Yet is not finished yet but it works ..
I've noticed that FreeCAD not display 2D and 1D meshes or am I wrong?

The original idea is to make a plugin for calculations of structures with Code_Aster which is the software I use.

Here the macro
GMSH Mesh.FCMacro.zip
Not really zip
(4.14 KiB) Downloaded 517 times
Sorry for my bad English.

Regards
Attachments
GMSHMACRO.png
GMSHMACRO.png (281.07 KiB) Viewed 6993 times
Ing. Gomez Lucio
Scope Ingenieria (scopeingenieria.com)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: alternatives to netgen? gmsh?

Post by bernd »

Wow, Thanks for sharing the macro.
psicofil wrote:... I've noticed that FreeCAD not display 2D and 1D meshes or am I wrong?...
Yes that's true FreeCAD does not display 2D or 1D mesh. Have you been able to create a 2D or 1D mesh ? I've been trying to do some time ago but currently I'm on other projects.
kuroshivo
Posts: 39
Joined: Mon Dec 22, 2014 3:16 pm
Contact:

Re: alternatives to netgen? gmsh?

Post by kuroshivo »

nice psicofil! it works like a charm! +1!

just for the record, I think that forking a execing a GPL'ed binary from a LGPL'ed program is legal, isn't it?
BTW, it is a pity that we cannot call a GPL'ed API from a program called Free-something :(
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: alternatives to netgen? gmsh?

Post by wmayer »

just for the record, I think that forking a execing a GPL'ed binary from a LGPL'ed program is legal, isn't it?
http://www.gnu.org/licenses/gpl-faq.htm ... GPLPlugins
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: alternatives to netgen? gmsh?

Post by bernd »

Yeah meshing on Linux works like a charm ...

Just encountered a problem. Can someone confirm? Attached a file including a mesh generated by the macro above and an analysis. If I try to write the CalculiX file I get a crash of FreeCAD

Code: Select all

*** Abort *** an exception was raised, but no catch was found.
        ... The exception is:SIGSEGV 'segmentation violation' detected. Address 0

OS: Debian GNU/Linux 8.0 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4642 (Git)
Branch: master
Hash: cc7c1d1f44715b4b024d625d36f2a34ea3b50b8c
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.0
Attachments
gmsh-cube.fcstd
(37.48 KiB) Downloaded 109 times
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: alternatives to netgen? gmsh?

Post by wmayer »

Just encountered a problem. Can someone confirm? Attached a file including a mesh generated by the macro above and an analysis. If I try to write the CalculiX file I get a crash of FreeCAD
There is a bug in FemMesh::writeABAQUS. The volume has only four elements but it tries to access a fifth element:

Code: Select all

apair.second.push_back(aVol->GetNode(4)->GetID());
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: alternatives to netgen? gmsh?

Post by PrzemoF »

What version of gmsh do you use? I have:
$ rpm -qi gmsh
Name : gmsh
Version : 2.8.5
Release : 5.fc21
Architecture: x86_64

and it's crashing badly with the macro with memory corruption error even for a cube.

P.S. Is it possible to rename GMSH Mesh.FCMacro.zip to GMSH Mesh.FCMacro? it's not a zip file.

Edit:
Looks like my problem was related to netgen. Selecting iso or tetgen works fine.
Post Reply