Skip to main content
Share Your Experience: Take the 2024 Developer Survey
6 votes
Accepted

Creating a proper quad-mesh in GMSH for an "I"-shaped geometry

So, by default and without recombination to quads (comment out Recombine Surface {1}), GMSH creates a mesh like the one in the left part of the picture. And by ...
Anton Menshov's user avatar
  • 8,672
4 votes
Accepted

Combined translational and rotational meshing in gmsh

I cannot visualize your geometry properly using Gmsh, or export it. I generated something similar using FreeCAD. Maybe you can modify this script for your purposes. ...
nicoguaro's user avatar
  • 8,515
4 votes

How can I coarsen a mesh in Gmsh when 'Mesh options' include 'Refine by splitting' but nothing about coarsening?

To create a coarser mesh, you can set the characteristic length globally to a larger value, e.g., ...
H. Rittich's user avatar
4 votes

Creating 3D Mesh from stl files with gmsh

I am not entirely sure what is going wrong in your version of the command-line approach. However, I think it works on my test STL file (with gmsh 4.0.7) with the following line: ...
Anton Menshov's user avatar
  • 8,672
4 votes
Accepted

Definition of Lagrange nodes in Gmsh

I think you've got slightly the wrong end of the stick from the documentation. As with a lot of other software in the area, GMSH started out with low order, hard coded numberings. These are the ones ...
origimbo's user avatar
  • 2,249
4 votes
Accepted

C++ library unstructured mesh writer to VTK format (or similar)

I think you are looking for Kitware VTK, basically, the main library for interaction with VTK files. Examples page will contain a lot of samples, including the one you are looking for: output of an ...
Anton Menshov's user avatar
  • 8,672
4 votes
Accepted

Second-order quadrangle mesh of a curved surface using Gmsh

The second order elements are 9 node non-flat quadrilaterals. The fact that they look like two "flat" elements is a plotting artifact. They are actually parabolically curved elements. If you ...
helloworld922's user avatar
3 votes

Gmsh Python: Specify mesh regularity conditons

If you're prepared to be a little more flexible with your definition of cell "centres", it's possible to achieve the regularity constraints you seek via Delaunay Triangulations and Voronoi ...
Darren Engwirda's user avatar
3 votes

gmsh python api ignores quad mesh option

Based on the comment from Biswajit Banerjee (above) I determined that I was missing mesh recombine option: gmsh.option.setNumber("Mesh.RecombineAll", 1) ...
Eric Eckert's user avatar
3 votes

Gmsh for .inp file

There are powerful tools for mesh conversion, for example MeshIO. With this open-source tool installed you would only have to type for conversion of msh-to-inp (vice versa for inp-to-msh) ...
Dominik Kern's user avatar
3 votes

Going From Blender Structure defined by triangles to full 3D mesh (Using GMSH?)

Tools like gmsh often require more information than STL provides -- the connectivity between triangles of the input surface mesh. You might be interested in trying TetWild, which can apparently ...
Daniel Shapero's user avatar
3 votes
Accepted

Does 'Recombine' work for this geometry in Gmsh?

To get the triangles in the last surface Recombined into quadrilaterals, you simply need to add the surface #9 into the last line: ...
Anton Menshov's user avatar
  • 8,672
3 votes
Accepted

Gmsh meshes flat faces incorrectly for cylindrical faces

I think you need to know that when you discretize a volume by using tetrahedral meshes, you will get just an approximation of your perfect surfaces because of triangulation. You started with STEP ...
Mithridates the Great's user avatar
3 votes
Accepted

Node re-numbering in 1D mesh GMSH

I'm not aware of any way to do this in a .geo file, under the GMSH application, or using the libgmsh interfaces. Somewhat annoyingly, the last operation gmsh does before a write tends to be a ...
origimbo's user avatar
  • 2,249
3 votes

Gmsh problems in Google Colab, visualize mesh

The graphical user interface (GUI) of Gmsh was written in FLTK. This is for desktop systems, therefore, the Gmsh GUI will not be embedded in Jupyter notebooks (including Google Colab). If you run your ...
Zoltan Csati's user avatar
2 votes
Accepted

Custom Mesh Sizes in GMSH

There are a couple of different ways to specify element mesh sizes in GMSH, I will explain the simplest one using the points here but for the others I suggest you check the manual: http://gmsh.info/...
swedishcheff's user avatar
2 votes
Accepted

Multi-domain 3D Geometries for MATLAB PDE Toolbox

For complicated geometries, you probably need some kind of a devoted CAD tool rather than a built-in Matlab functionality. GMSH is a nice open-source tool, and this is my weapon of choice for such ...
Anton Menshov's user avatar
  • 8,672
2 votes

Is it possible to remesh with gmsh?

It is a tricky thing to do (in pure GMSH) by using only the MSH file. Because, conceptually, the MSH file does not contain information about the underlying geometry that was discretized. However, ...
Anton Menshov's user avatar
  • 8,672
2 votes
Accepted

Creating 3D Mesh from stl files with gmsh

I solved my problem now. Despite initially not wanting to do that, I now generate .geo-files in my script. I do it with ...
A.M.'s user avatar
  • 71
2 votes

Meshing surface of a sphere with a subdomain

Why don't you take a look a HEALpix which provides a nice equal area hierarchical triangulation of the surface of the sphere with no distorted triangles: https://healpix.jpl.nasa.gov/ https://en....
JonesTheAstronomer's user avatar
2 votes

Meshing surface of a sphere with a subdomain

I found a solution by replacing the points with line segments: ...
Fab von Bellingshausen's user avatar
2 votes

Convert unstructured mesh to structured mesh

in Gmsh only planes that have four corner points could be meshed with structured meshes using Trasnfinite option. In your file, ...
Masa's user avatar
  • 194
2 votes
Accepted

Gmsh: what is the right syntax to iterate over a list of numbers with a For loop on the native language?

It seems for-loops in gmsh are made for consecutive numbering only, so I would define an array to map from consecutive index numbers to arbitrary entity numbers. ...
Dominik Kern's user avatar
1 vote
Accepted

Quads with some nodes shifted

You can make use of third party libraries like meshio to read the generated mesh file using meshio's read function ...
ThivinAnandh's user avatar
1 vote

GMSH: How can I extrude a surface in a non-linear way?

As a general suggestion: you can use CAD software (such as FreeCAD) when your geometry starts to get more complex. Gmsh has some CAD capabilities but its main purpose is to create meshes from CAD ...
nicoguaro's user avatar
  • 8,515
1 vote

Parametric surface in 3D

There is probably an option to do this through Gmsh API, but I am not aware of it. In the graphic interface there is not an option for this. If you are interested of doing this just in Gmsh, you ...
nicoguaro's user avatar
  • 8,515
1 vote

Gmsh for .inp file

As you want to get any suggestion, here are mine: If you need to get started with gmsh from scratch, take a look at their tutorial section here, their wiki or on youtube. You can mesh your created ...
riyansh.legend's user avatar
1 vote
Accepted

Creating a mesh around an 1-D line to form a 2-D object

You have several options. Option A. Go for the gmsh::model::geo::extrude The API call specification is given, as follows: ...
Anton Menshov's user avatar
  • 8,672
1 vote
Accepted

Convert existing gmsh mesh from first- to second-order elements?

You should ask this on gmsh list. The gmsh developer answers questions. Searching online suggests an answer http://geuz.org/pipermail/gmsh/2020/013631.html Create a geo file like this ...
cfdlab's user avatar
  • 3,028
1 vote
Accepted

Why addCylinder function not respecting the given coordinates?

I don't know gmsh, but I have an idea you could check. How are the coordinates interpreted? If the coordinates are $x$ $y$ $z$, shouldn't the second cylinder be straight upwards, length one? ...
Bru's user avatar
  • 134

Only top scored, non community-wiki answers of a minimum length are eligible