Gmsh: extrusion help

Mesh generators, CAD programs, and other tools
Post Reply
drmike
Posts: 39
Joined: 17 Mar 2024, 18:52
Antispam: Yes

Gmsh: extrusion help

Post by drmike »

Using the C API, I finally got gmsh to feed ElmerGrid a 2D mesh I like, but I can not get an extrusion to 3D. gmsh reports it is happy, but there are no 3D points in the output mesh file, so ElmerGrid reports it meshed a 3D volume, but ElmerGUI does not see anything but the 2D mesh.

The surface before the extrusion is fine:
Screenshot from 2024-03-20 11-16-32.png
Screenshot from 2024-03-20 11-16-32.png (27.77 KiB) Viewed 961 times
After this is created I use the following code

Code: Select all

  elist[0] = 5;
  elist[1] = 5;
  tlist[0] = 2;  // dimension
  tlist[1] = tag;  // tag
  gmshModelGeoExtrude(tlist, 2, 0.0, 0.0, 1.0, NULL, 0, elist, 1, NULL, 0, 1, &ierr);
  gmshModelGeoSynchronize(&ierr);
  gmshModelMeshGenerate(3, &ierr);
  
  gmshWrite("mymesh_test.msh", &ierr);
where "tag" is the result of the AddPhysicalGroup for the final surface. What am I not doing that is required?

gmsh reports

Code: Select all

Info    : Meshing 3D...
Info    : Meshing volume 1 (Extruded)
Info    : Done meshing 3D (Wall 0.0040657s, CPU 0.002608s)
and ElmerGrid reports

Code: Select all

Reading 12 entities in 0D
Reading 17 entities in 1D
Reading 8 entities in 2D
Reading 1 entities in 3D
So there is some 3D info somewhere. Just not visible. What am I doing wrong?
Any pointers appreciated!
raback
Site Admin
Posts: 4841
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Gmsh: extrusion help

Post by raback »

Hi

Maybe you only save physical entities. Ask Gmsh to "save all".

-Peter
kevinarden
Posts: 2366
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Gmsh: extrusion help

Post by kevinarden »

If you extrude the surface elements into solids you probably do not get a surface boundary on the solids. EmerGUI displays solid bodies by its boundary elements so in this case nothing will be visible. To turn on solid elements use view and che k on the solid element option
drmike
Posts: 39
Joined: 17 Mar 2024, 18:52
Antispam: Yes

Re: Gmsh: extrusion help

Post by drmike »

SaveAll definitely helps! I now get this:
Screenshot from 2024-03-20 12-25-01.png
Screenshot from 2024-03-20 12-25-01.png (18.21 KiB) Viewed 954 times
So now I just have to figure out where the other 2/3 of the mesh went. Thanks!!
Post Reply