Yixin-Hu / TetWild

Robust Tetrahedral Meshing in the Wild.
https://yixin-hu.github.io/tetwild.pdf
GNU General Public License v3.0
620 stars 98 forks source link

How to generate quadratic meshes? #66

Open acbergan opened 4 years ago

acbergan commented 4 years ago

Thanks for the awesome package! It's really an amazing tool.

I would like to use the mesh in structural analysis, for which a quadratic mesh is preferred. Do you have a suggestion for generating a quadratic mesh either instead of the linear mesh or a method to convert the linear mesh to a quadratic mesh (insert midside nodes)?

teseoch commented 4 years ago

The method generates linear meshes (ie linear tetrahedron).

You can add midpoints on every edge to transform it into quadratic. Note that even if you will have additional nodes the tetrahedra will remain linear (a part if you move the midpoints). I don't understand how this will benefit the simulation. You can use P2 FE bases on linear meshes without any problem.

That being said, you can use gmsh to open a mesh, open the mesh menu on the left, and click set order 2, this will add the midpoints. You can toggle the node visibility to verify.

Once you have your "fake" quadratic mesh in gmsh you export it for you simulation.

acbergan commented 4 years ago

Thanks for the comments. I'm not a gmsh user so I didn't know it had the capability to add the midside nodes. That is helpful.

I mainly use hex meshes so I apologize if this an ignorant comment. My understanding is that state-of-the-art meshing of curved CAD geometries using quadratic tet elements utilizes the midside nodes to approximate curvature, for a better representation comparable with the faceted representation of linear tet elements. I suppose in most problems, this small difference in the initial geometric representation is negligible. Just a curiosity.