same macro, same version of freecad, but very different meshes between linux and windows.

About the development of the FEM module/workbench.

Moderator: bernd

theodoresyroco
Posts: 9
Joined: Mon May 22, 2023 9:34 am

same macro, same version of freecad, but very different meshes between linux and windows.

Post by theodoresyroco »

hello everyone !

windows freecad :

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.2.29177 +426 (Git)
Build type: Release
Branch: (HEAD detached from 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: French/France (fr_FR)
Installed mods: 
  * Curves 0.6.8
linux freecad :

Code: Select all

OS: Ubuntu 20.04.5 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.2.29603 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.10.8, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
I am a student in internship and I have the following problem:

I was using freecad on windows and I developed a macro allowing me to generate a foil geometry, apply constraints to it and mesh it into the FEM workbench with Netgen (finesse = coarse, opimize = true, secondorder = true, maxsize = 1000). After some work, everything worked perfectly and my CalculiX files were correct. For information, my mesh still had about 15 000 nodes (which is very good for me)

Except that the rest of my work is done on a Ubuntu 20.04.5 LTS virtual machine. So I wanted to transfer my work from freecad windows to freecad linux. I was able to install freecad 0.20.2 and use the same macro (Netgen config : finesse = coarse, opimize = true, secondorder = true, maxsize = 1000) as on windows. And here is the problem: there are no errors but the mesh has now 400 000 nodes, which is much too fine for me.

I don't understand why I can't get the same mesh result as on windows ! I have not found any evidence of this problem on the forum.

My only clue is that when I run netgen through the terminal, I get this :

Code: Select all

vagrant@precicevm:~$ netgen 
NETGEN-6.2.2302-49-gf8021975
Developed by Joachim Schoeberl at
2010-xxxx Vienna University of Technology
2006-2010 RWTH Aachen University
1996-2006 Johannes Kepler University Linz
optfile ./ng.opt does not exist - using default values
togl-version : 2
loading ngsolve library
NGSolve-6.2.2302-103-g5d9aa1de3
Using Lapack
Including sparse direct solver UMFPACK
Running parallel using 6 thread(s)
... when I should get this :

Code: Select all

NETGEN-6.2-dev
Developed by Joachim Schoeberl at
2010-xxxx Vienna University of Technology
2006-2010 RWTH Aachen University
1996-2006 Johannes Kepler University Linz
Including OpenCascade geometry kernel
Run parallel Netgen with 'mpirun -np xy netgen'
NETGENDIR = .
Tcl header version = 8.6.8
Tcl runtime version = 8.6.8 
using internal Tcl-script
optfile ./ng.opt does not exist - using default values
togl-version : 2
OCC module loaded
But I don't even know if it's important.
Thank you for your help.

Theodore
Last edited by theodoresyroco on Mon May 22, 2023 11:50 am, edited 1 time in total.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: same macro, same version of freecad, but very different meshes between linux and windows.

Post by PrzemoF »

Welcome to the forum! For start - please provide version info (see the red banner above) for both FreeCAD versions. Also I'd use the same version of netgen. NETGEN-6.2.2302-49-gf8021975 might work differently than NETGEN-6.2-dev
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: same macro, same version of freecad, but very different meshes between linux and windows.

Post by GeneFC »

theodoresyroco wrote: Mon May 22, 2023 11:10 am
It is possible that you have different precision settings in the Preferences for the two installations. For example, the Tessellation settings for maximum deviation and maximum angular deflection might be different.

If you still have access to both installations that would be something to check.

Gene
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: same macro, same version of freecad, but very different meshes between linux and windows.

Post by chrisb »

Moved to FEM forum.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
theodoresyroco
Posts: 9
Joined: Mon May 22, 2023 9:34 am

Re: same macro, same version of freecad, but very different meshes between linux and windows.

Post by theodoresyroco »

Thank you very much for your answers.

It seems that in both cases (windows and linux), Netgen is installed directly with FreeCAD.
https://wiki.freecad.org/FEM_Install : "Depending on your operating system and your FreeCAD installation Netgen may be bundled with the FreeCAD installation binaries."

However I still had installed a version of netgen on my VM. If I remove my netgen installation in my VM, the Netgen tool integrated in FreeCAD still works (and give the same result than before) even though when I enter "netgen" in the terminal I get: "command 'netgen' not found".
So it seems that for my freecad on my linux VM, Netgen is already integrated and so the Netgen configuration I copied in my first message does not correspond to the Netgen that was used by FreeCAD (but rather corresponds to the Netgen I just deleted). Also,
in my preferences I don't have a FEM/Netgen section (while we have FEM/Gmsh!). I can't install "my" Netgen and send its path to FreeCAD as I would for Gmsh. (see the image)
De plus je ne sais pas comment avoir acces à l'installation de netgen intégrée à FreeCAD.
Attachments
preferences (freecad VM linux)
preferences (freecad VM linux)
Capture d'écran 2023-05-22 172318.png (242.6 KiB) Viewed 917 times
theodoresyroco
Posts: 9
Joined: Mon May 22, 2023 9:34 am

Re: same macro, same version of freecad, but very different meshes between linux and windows.

Post by theodoresyroco »

PrzemoF wrote: Mon May 22, 2023 11:36 am Welcome to the forum! For start - please provide version info (see the red banner above) for both FreeCAD versions. Also I'd use the same version of netgen. NETGEN-6.2.2302-49-gf8021975 might work differently than NETGEN-6.2-dev
I can choose the version I download (in addition to the one already integrated in freecad) but I cannot replace the freecad version
(or rather I don't know how)
theodoresyroco
Posts: 9
Joined: Mon May 22, 2023 9:34 am

Re: same macro, same version of freecad, but very different meshes between linux and windows.

Post by theodoresyroco »

GeneFC wrote: Mon May 22, 2023 12:08 pm
theodoresyroco wrote: Mon May 22, 2023 11:10 am
It is possible that you have different precision settings in the Preferences for the two installations. For example, the Tessellation settings for maximum deviation and maximum angular deflection might be different.

If you still have access to both installations that would be something to check.

Gene
I don't think I will be able to change the settings of the Netgen used by my FreeCAD in my VM linux. I will try to uninstall freecad and re-install.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: same macro, same version of freecad, but very different meshes between linux and windows.

Post by PrzemoF »

theodoresyroco wrote: Mon May 22, 2023 3:40 pm
PrzemoF wrote: Mon May 22, 2023 11:36 am Welcome to the forum! For start - please provide version info (see the red banner above) for both FreeCAD versions. Also I'd use the same version of netgen. NETGEN-6.2.2302-49-gf8021975 might work differently than NETGEN-6.2-dev
I can choose the version I download (in addition to the one already integrated in freecad) but I cannot replace the freecad version
(or rather I don't know how)
Not sure what you mean by "replace the freecad version", but I'm sure you can provide info what you use - again the pale red banner at the top of this page.

Why you can't change the settings in the VM? It should work the same way as it was installed on bare metal.
theodoresyroco
Posts: 9
Joined: Mon May 22, 2023 9:34 am

Re: same macro, same version of freecad, but very different meshes between linux and windows.

Post by theodoresyroco »

for more details, here is the code I use
Attachments
macro_from_the_linux_vm.FCMacro
here is the macro I use to generate the geometry and the mesh
(6.65 KiB) Downloaded 30 times
theodoresyroco
Posts: 9
Joined: Mon May 22, 2023 9:34 am

Re: same macro, same version of freecad, but very different meshes between linux and windows.

Post by theodoresyroco »

PrzemoF wrote: Mon May 22, 2023 3:55 pm
Not sure what you mean by "replace the freecad version", but I'm sure you can provide info what you use - again the pale red banner at the top of this page.

Why you can't change the settings in the VM? It should work the same way as it was installed on bare metal.
Thanks so much for your answer
You are true, it is more that I have no idea how to change the "deep" parameters of the Netgen mesh used by FreeCAD in both Windows and linux VM. I used "deep" because I know how to change the mesh params visible from the interface (max size, second order, fineness, optimize, growth radius, ...) just click on them or write a line in the macro. But I don't know how to access the other parameters that are not visible in the interface (the "deep" ones, the ones that should be visible I don't know where in my machine).
Moreover, I didn't need to change the deep params of FreeCAD on Windows (I wouldn't know how to do it anyway)
Post Reply