[Gmsh] Imported stl mesh size control

Ashton Peters ashton.peters at canterbury.ac.nz
Fri Jun 6 04:35:25 CEST 2008


Hi,

I have an stl file generated in another program that I want to use as input, and create a 3D tetrahedral mesh with Gmsh. I can import the stl by opening a .geo file with the following contents into Gmsh:

Merge "surf.stl";
Surface Loop (1)= {1};
Volume (1)= {1};
Recombine Surface {1};

... here obviously my stl file is called "surf.stl".

After importing the stl I can generate a 3D mesh easily.

The problem is that I have no idea how to impose any kind of size control on the 3D elements Gmsh creates. All I want to do is control mesh size using a single number that represents an average element edge length (or similar) across the entire mesh. Characteristic lengths don't seem to work, as my stl import has no points associated with it that I can assign a characteristic length. I've tried Fields, but nothing I try seems to have any effect on the size of the final mesh - it always ends up with the same size elements!

I'm sure Gmsh can do this (very simple) task, but I am getting lost amongst a lot of very flexible, complicated, and sparsely-documented controls, and I'm now stuck.

Can someone please tell me what I need to do to impose a constant size control on an imported stl file when meshing with simple tetrahedral elements? Ideally I want Gmsh to re-mesh the surface with the new element size before meshing the internal volume.

Thanks in advance for any help. I'm using Gmsh 2.2.0 on Windows, ideally in non-interactive mode.

Ashton

-- 
Ashton Peters
Centre for Bioengineering
University of Canterbury
Christchurch, New Zealand