Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fem: Add partial support for hexahedral elements #12698

Merged
merged 1 commit into from Mar 11, 2024

Conversation

marioalexis84
Copy link
Member

As discussed with @FEA-eng, this gives partial support for hexahedral elements meshing.

@github-actions github-actions bot added the WB FEM Related to the FEM Workbench label Mar 2, 2024
@FEA-eng
Copy link
Contributor

FEA-eng commented Mar 2, 2024

A few notes:

  • one test has to be updated because the checks are failing
  • can you unlink the issue so that it's not closed automatically (since only a small part of it will be completed) ? In such cases, I just mention the issue without using keywords like "fixes"
  • it seems that second-order quad and hex elements can't be created this way even though Gmsh should be able to handle this. Can you check it ? Those elements should be S8 and C3D20, respectively (Gmsh may name them differently, one has to be careful).

@marioalexis84 marioalexis84 changed the title Fem: Add partial support for hexahedral elements - fixes #5698 Fem: Add partial support for hexahedral elements Mar 2, 2024
@marioalexis84
Copy link
Member Author

can you unlink the issue so that it's not closed automatically (since only a small part of it will be completed) ? In such cases, I just mention the issue without using keywords like "fixes"

Of course, I just thought the problem would be replaced by another one.

it seems that second-order quad and hex elements can't be created this way even though Gmsh should be able to handle this

What parameters for gmsh are you using? I can create S8 and C3D20.

@FEA-eng
Copy link
Contributor

FEA-eng commented Mar 3, 2024

What parameters for gmsh are you using? I can create S8 and C3D20.

I test it with all defaults:

gmsh

Including 2nd order but linear elements are generated:

gmsh 2

@marioalexis84
Copy link
Member Author

Please, set SecondOrderIncomplete to true.
For S8 set SubidvisionAlgorithm to All Quadrangles

@FEA-eng
Copy link
Contributor

FEA-eng commented Mar 4, 2024

Please, set SecondOrderIncomplete to true. For S8 set SubidvisionAlgorithm to All Quadrangles

All right, it works now, thanks.

If you decide to add more ways to create hex elements in the future, let me know and we’ll try to figure this out. I have some ideas but they might be more difficult to implement.

@marioalexis84
Copy link
Member Author

I think it's better to force SecondOrderIncomplete to 1 if SubdivisionAlgorithm is All Quadrangles or All Hexahedra.
Currently the internal workflow is as follows:

  • Create the mesh with gmsh and export it as a .unv file.
  • Create FemMesh object and read the .unv file using Salome Mesh.
  • Export to .inp file (if selected solver is CalculiX).

After some study of gmsh and Salome Mesh source code, I found some limitations when working with .unv files:
With second order elements, SubdivisionAlgorithm equal to All Hexahedrons and SsecondOrderIncomplete equal to 0, gmsh creates a 27-node element, but Salome Mesh only reads 8 nodes and creates an 8-node hexahedron.
By setting SecondOrderIncomplete to 1, gmsh creates a 20-node hexahedron which Salome Mesh can correctly read.
The same goes for quadrangles: without SecondOrderIncomplete, gmesh creates a 9-node quadrangle that Salome cannot fully read, so SecondOrderIncomplete is needed to create the 8-node quadrangle.

In addition, we must take into account the possible limitations on the solver side when working with this variety of elements.

@marioalexis84
Copy link
Member Author

If you decide to add more ways to create hex elements in the future, let me know and we’ll try to figure this out. I have some ideas but they might be more difficult to implement.

It is necessary to take into account not only gmsh's capabilities, but also those of Salome.

@chennes
Copy link
Member

chennes commented Mar 4, 2024

@marioalexis84 is this good to merge now?

@FEA-eng
Copy link
Contributor

FEA-eng commented Mar 4, 2024

I think it's better to force SecondOrderIncomplete to 1 if SubdivisionAlgorithm is All Quadrangles or All Hexahedra.

Right, this would definitely make sense.

It is necessary to take into account not only gmsh's capabilities, but also those of Salome.

Yes, but it seems that Gmsh is somewhat superior (especially with extruded/revolved meshes) and might be easier to integrate in this regard. But of course we could also utilize some strengths of Salome, if possible.

@FEA-eng
Copy link
Contributor

FEA-eng commented Mar 4, 2024

The same goes for quadrangles: without SecondOrderIncomplete, gmesh creates a 9-node quadrangle that Salome cannot fully read, so SecondOrderIncomplete is needed to create the 8-node quadrangle.

Great, thanks to that this PR can also fix #12526

Thus, I think that SecondOrderIncomplete should be enabled by default also when RecombineAll is set to true.

@marioalexis84
Copy link
Member Author

SecondOrderIncomplete property is removed and set internally according to the values of SubdivisionAlgorithm and RecombineAllproperties.

@marioalexis84
Copy link
Member Author

@marioalexis84 is this good to merge now?

Ready. Just waiting for @FEA-eng testing.

@FEA-eng
Copy link
Contributor

FEA-eng commented Mar 4, 2024

Ready. Just waiting for @FEA-eng testing.

I tested it after the newest change, It's working as expected.

@chennes Can you merge it ?

@chennes chennes merged commit 673f5d0 into FreeCAD:main Mar 11, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WB FEM Related to the FEM Workbench
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants