porting to smesh 8.3

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
wmayer
Founder
Posts: 20305
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: porting to smesh 8.3

Post by wmayer »

This git commit 1b7224cdf9 fixes the order of the elements. However, when creating e.g. a FEM mesh from a cone then a lot of elements are missing.

EDIT: Link to old thread about wrong order: https://forum.freecadweb.org/viewtopic.php?f=18&t=16312
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: porting to smesh 8.3

Post by looo »

thanks @wmayer. I will try to apply the mentioned patches...
bernd wrote: I do not like patches, I like git. Our smesh is a certain commit of original smesh. Get this original smesh and merge our commits. Then try to rebase to newer original smesh until you are on 8.3. Just an idea?
any ideas how to deal with the different directory structures? I don't see an easy way to get commits from freecad to smesh...
cherry-picking works only if the directory structure matches.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: porting to smesh 8.3

Post by looo »

wmayer wrote: Sat May 05, 2018 9:29 pm FYI, this issue is back: https://forum.freecadweb.org/viewtopic. ... 40#p135981
So, this means that git commit 5c791306d and git commit 1b08ae0 must be added to the external smesh.
I applied the two commits, but the problem is still there
wmayer wrote: Sat May 05, 2018 11:01 pm This git commit 1b7224cdf9 fixes the order of the elements. However, when creating e.g. a FEM mesh from a cone then a lot of elements are missing.
With this commit meshing with netgen seems to be broken. At least for the external smesh.
wmayer
Founder
Posts: 20305
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: porting to smesh 8.3

Post by wmayer »

wmayer
Founder
Posts: 20305
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: porting to smesh 8.3

Post by wmayer »

I applied the two commits, but the problem is still there
As said above these commits are needed to make reading in a file on Windows that has been created on Linux. The problem are the CR and LF.
Without the fix reading in such a file on Windows the system starts to freeze and allocate all RAM. This can take several minutes and makes your system unusable.
With this commit meshing with netgen seems to be broken. At least for the external smesh.
Exactly. Writing a UNV file would be working again but creating a FEM mesh from a shape leads to an incomplete mesh.

So, far the problem seems to be only the export of UNV files but not the import. When I create a correct file with the bundled smesh then the imported file using external smesh shows the same good result. And when I load a file with the bundled smesh that has been created with the external smesh then everything looks messy, too.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: porting to smesh 8.3

Post by looo »

wmayer wrote:FYI, here are my changes: https://github.com/wwmayer/SMESH/commits/smesh_win32
ah you are already working on this smesh8.3. Great!

As said above these commits are needed to make reading in a file on Windows that has been created on Linux. The problem are the CR and LF.
Without the fix reading in such a file on Windows the system starts to freeze and allocate all RAM. This can take several minutes and makes your system unusable.
So, far the problem seems to be only the export of UNV files but not the import. When I create a correct file with the bundled smesh then the imported file using external smesh shows the same good result. And when I load a file with the bundled smesh that has been created with the external smesh then everything looks messy, too.
Yes I also came to the conclusion the export is the failing part. The UNV-files seem to have different node ordering.
The diff of the node-orders of a simple 10node tetrahedron looks like this: (this was generated with git diff on the two unv-files.

Code: Select all

-         1         7         3         6         2         5         8        10
-         9         4
+         1         3         2         4         7         6         5         8
+        10         9
btw. compiling your fork doesn't solve the problem for my configuration. (But I think this is expected)
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: porting to smesh 8.3

Post by looo »

the test can be simplified. Maybe the problem is not really related to unv?

Code: Select all

import Fem
tetra10 = Fem.FemMesh()
tetra10.addNode(6, 12, 18, 1)
tetra10.addNode(0, 0, 18, 2)
tetra10.addNode(12, 0, 18, 3)
tetra10.addNode(6, 6, 0, 4)
tetra10.addNode(3, 6, 18, 5)
tetra10.addNode(6, 0, 18, 6)
tetra10.addNode(9, 6, 18, 7)
tetra10.addNode(6, 9, 9, 8)
tetra10.addNode(3, 3, 9, 9)
tetra10.addNode(9, 3, 9, 10)
tetra10.addVolume([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
Fem.show(tetra10)
nothing is shown for me with py3/smesh8.3/qt5.

edit.: with the fixes from @wmayer this works...
wmayer
Founder
Posts: 20305
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: porting to smesh 8.3

Post by wmayer »

Which fix do you mean? The one about the enum size?
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: porting to smesh 8.3

Post by looo »

Simple by using your branch for smesh8.3:
https://github.com/wwmayer/SMESH/commits/smesh_win32
wmayer
Founder
Posts: 20305
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: porting to smesh 8.3

Post by wmayer »

looo wrote: Wed May 09, 2018 7:55 am Simple by using your branch for smesh8.3:
https://github.com/wwmayer/SMESH/commits/smesh_win32
Really? For my configuration Py3+smesh8.3+Qt5+Win64 it doesn't show anything. When I look at the property editor of the FEM object then it says that it has 10 nodes but 0 volumes. But when I look at the created object in the Python console then it says it has 1 volume. So, the volume is lost when trying to display it.
Post Reply