Discussion:
[Gmsh] detect negative jacobians
Christophe Geuzaine
2016-03-24 18:06:00 UTC
Permalink
Hi GMSH users and developers,
Is it possible to check a mesh in gmsh in the regard of negative jacobians? If yes, is it possible to show such elements in gmsh gui?
Yes (see attached picture):

- Load your mesh
- Open Tools->Plugins->AnalyzeCurvedMesh
- Select "0" in the first option (to compute the Jacobian determinant J and plot min(J))

To accurately visualize the curved grid (and post-processing dataset):

- Select "Adapt visualization grid" in the view options ("General" tab)
- Increase the "High-order element subdvisions" in the mesh options ("Aspect" tab)

This can all be scripted of course.

The calculation method is described in the following paper:

Johnen, A., Remacle, J. F., & Geuzaine, C. (2013). Geometrical validity of curvilinear finite elements. Journal of Computational Physics, 233, 359-372. http://gmsh.info/doc/preprints/gmsh_curved_preprint.pdf

Christophe
Attached a mesh wich has negative jacobians to test with.
mesh: Shape_mesh_negative_jacobian.unv.zip (remove .zip)
http://forum.freecadweb.org/download/file.php?id=21583&sid=a7b68cea7fa02126487316248b875c2d
What is the recommended way to avoid such negative jacobians? Attached the geometry of the mesh above.
geometry: Shape.brep
http://forum.freecadweb.org/download/file.php?id=21588
kind regards bernd
_______________________________________________
gmsh mailing list
http://onelab.info/mailman/listinfo/gmsh
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine

Tetrahedron V, July 4-5 2016: http://tetrahedron.montefiore.ulg.ac.be
Free software: http://gmsh.info | http://getdp.info | http://onelab.info
Christophe Geuzaine
2016-03-24 18:13:06 UTC
Permalink
What is the recommended way to avoid such negative jacobians? Attached the geometry of the mesh above.
And to avoid such negative jacobians, you can use the "High order tools" (in the Mesh menu). This is still experimental, but works quite well. The algorithms are described (in part) in

T. Toulorge, C. Geuzaine, J.-F. Remacle, J. Lambrechts. Robust untangling of curvilinear meshes. Journal of Computational Physics 254, pp. 8-26, 2013. http://gmsh.info/doc/preprints/gmsh_untangling_preprint.pdf

Christophe
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine

Tetrahedron V, July 4-5 2016: http://tetrahedron.montefiore.ulg.ac.be
Free software: http://gmsh.info | http://getdp.info | http://onelab.info
Christophe Geuzaine
2016-03-30 09:43:53 UTC
Permalink
Thanks Christophe!
I got the problem of the high order meshes by reading a big part of the paper. :-) :-) Is there any user documentation or an example how to use the HighOrderTools around?
Just to get it the right way done. How does it work in the gui?
1) Load the geometry
2) Mesh (e.g. press "3" to do a 3D mesh)
3) Open "High order tools"
- Choose the polynomial order and press "Generate" (this will create high order elements)
- Press "Regularize" (this will optimize the high order elements)
- Load the geometry (in my case a BRep)
- make the adjustments on Tools --> Options --> Geometry and Mesh --> one of them is 2nd order mesh
- In GMSH Tree press Mesh 1D, 2D, 3D
- on 3D I get negative Jacobians if the mesh order in options is set to two
- do not use any optimization, do not use the order buttons (mesh is 2nd order already)
- open HighOrderTools
- Generate 2nd order vertices
- Regularize with given values
- Or do I have to start with a 1st order mesh and use Generate 2nd order vertices on a 1st order mesh?
- Should any of the optimizations be done before the HighOrderTools?
kind regards bernd
Post by Christophe Geuzaine
What is the recommended way to avoid such negative jacobians? Attached the geometry of the mesh above.
And to avoid such negative jacobians, you can use the "High order tools" (in the Mesh menu). This is still experimental, but works quite well. The algorithms are described (in part) in
T. Toulorge, C. Geuzaine, J.-F. Remacle, J. Lambrechts. Robust untangling of curvilinear meshes. Journal of Computational Physics 254, pp. 8-26, 2013. http://gmsh.info/doc/preprints/gmsh_untangling_preprint.pdf
Christophe
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine
Tetrahedron V, July 4-5 2016: http://tetrahedron.montefiore.ulg.ac.be
Free software: http://gmsh.info | http://getdp.info | http://onelab.info
_______________________________________________
gmsh mailing list
http://onelab.info/mailman/listinfo/gmsh
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine

Tetrahedron V, July 4-5 2016: http://tetrahedron.montefiore.ulg.ac.be
Free software: http://gmsh.info | http://getdp.info | http://onelab.info
Christophe Geuzaine
2016-04-05 07:32:56 UTC
Permalink
Thanks Christophe, got again the point! Works quit well for me now.
Is it possible to script the hight order tools in a geo file? I could not find anything in this regard (only the window position ?!?)
You can use:

Mesh.ElementOrder = 2;
Mesh.HighOrderOptimize = 1;
bernd
Post by Christophe Geuzaine
Thanks Christophe!
I got the problem of the high order meshes by reading a big part of the paper. :-) :-) Is there any user documentation or an example how to use the HighOrderTools around?
Just to get it the right way done. How does it work in the gui?
1) Load the geometry
2) Mesh (e.g. press "3" to do a 3D mesh)
3) Open "High order tools"
- Choose the polynomial order and press "Generate" (this will create high order elements)
- Press "Regularize" (this will optimize the high order elements)
- Load the geometry (in my case a BRep)
- make the adjustments on Tools --> Options --> Geometry and Mesh --> one of them is 2nd order mesh
- In GMSH Tree press Mesh 1D, 2D, 3D
- on 3D I get negative Jacobians if the mesh order in options is set to two
- do not use any optimization, do not use the order buttons (mesh is 2nd order already)
- open HighOrderTools
- Generate 2nd order vertices
- Regularize with given values
- Or do I have to start with a 1st order mesh and use Generate 2nd order vertices on a 1st order mesh?
- Should any of the optimizations be done before the HighOrderTools?
kind regards bernd
Post by Christophe Geuzaine
What is the recommended way to avoid such negative jacobians? Attached the geometry of the mesh above.
And to avoid such negative jacobians, you can use the "High order tools" (in the Mesh menu). This is still experimental, but works quite well. The algorithms are described (in part) in
T. Toulorge, C. Geuzaine, J.-F. Remacle, J. Lambrechts. Robust untangling of curvilinear meshes. Journal of Computational Physics 254, pp. 8-26, 2013. http://gmsh.info/doc/preprints/gmsh_untangling_preprint.pdf
Christophe
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine
Tetrahedron V, July 4-5 2016: http://tetrahedron.montefiore.ulg.ac.be
Free software: http://gmsh.info | http://getdp.info | http://onelab.info
_______________________________________________
gmsh mailing list
http://onelab.info/mailman/listinfo/gmsh
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine
Tetrahedron V, July 4-5 2016: http://tetrahedron.montefiore.ulg.ac.be
Free software: http://gmsh.info | http://getdp.info | http://onelab.info
--
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine

Tetrahedron V, July 4-5 2016: http://tetrahedron.montefiore.ulg.ac.be
Free software: http://gmsh.info | http://getdp.info | http://onelab.info
Geordie McBain
2016-03-29 08:22:25 UTC
Permalink
if I try to clone gmsh source code it asks me for a password?
Try username & password "gmsh".
Loading...