[Gmsh] merge surface

Geordie McBain gdmcbain at freeshell.org
Thu Oct 27 01:26:00 CEST 2011


2011/10/27 isettagi at libero.it <isettagi at libero.it>:
> Hi all,
> thank you again for support and for the possibility to use this programm.
>
> I'd like to know if there is a command to merge different surface in one.

I'm not sure if this will exactly answer your question, but I do have
an example of creating a volume bounded by multiple surfaces.  (I
preferred to keep the surfaces distinct so I could put different
boundary conditions on them later.)  Hopefully you'll be able to
modify this to achieve your end.

You can "Merge" multiple Stl surfaces and then call "CreateTopology".
This latter command doesn't appear in the manual
<http://geuz.org/gmsh/doc/texinfo/gmsh.html>, but is mentioned at
https://geuz.org/trac/gmsh/wiki/STLRemeshing.

Here's a complete example.  I have three STL files, corresponding to
the different boundary conditions in my finite element problem:
inlet.stl, outlet.stl, and wall.stl.  I get Gmsh to create the volume
that they jointly enclose and then mesh the volume and the three
surfaces and export the mesh.

%<---
Merge "inlet.stl";
Merge "outlet.stl";
Merge "wall.stl";

CreateTopology;

Physical Surface (1) = {1};
Physical Surface (2) = {2};
Physical Surface (3) = {3};

Surface Loop (1) = {1, 2, 3};
Volume (1) = {1};
Physical Volume (4) = {1};
%<---

Hope this helps.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inlet.stl
Type: application/octet-stream
Size: 25219 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20111027/151c1756/attachment.stl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: outlet.stl
Type: application/octet-stream
Size: 25519 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20111027/151c1756/attachment-0001.stl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wall.stl
Type: application/octet-stream
Size: 48961 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20111027/151c1756/attachment-0002.stl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: merge2.geo
Type: application/octet-stream
Size: 235 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20111027/151c1756/attachment.geo>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: merge2.png
Type: image/png
Size: 30319 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20111027/151c1756/attachment.png>