[Gmsh] Problem with Extrude

Mike B. mb78aa at yahoo.com
Thu Jul 2 06:05:20 CEST 2009


Dear Gmsh users,

Can someone please confirm this:
I define a rectangle (planar surface) as Surface( 2 ) and then extrude it to a cuboid (please see full script below). However, meshing the cuboid fails. It seems the problem is with Extrude. From the Gmsh manual:
`As explained in 4.2.1 Floating point expressions, extrude can be used in an expression, in which case it returns a list of identification numbers. By default, the list contains the "top" of the extruded entity at index 0 and the extruded entity at index 1, followed by the "sides" of the extruded entity at indices 2, 3, etc.'

In the script I use
Plane Surface( 2 ) = {1};
z1[] = Extrude{ 0, 0, 3 }{ Surface{ 2 }; };

so z1 is the variable holding the indices of the surfaces created by extrusion. This means z1[0] should hold the index of the original planar surface, that is, 2. However, it shows 1, which is a non-existing surface.

If the index of the original planar surface is 1 then meshing works, that is:
Plane Surface( 1 ) = {1};
z1[] = Extrude{ 0, 0, 3   }{ Surface{ 1 }; };


Here is the full script:

Point(1) = {-1, -1, -1};
Point(2) = {-1, 1, -1};
Point(3) = {1, 1, -1};
Point(4) = {1 ,-1, -1};
Line(1) = {1,2};
Line(2) = {2,3};
Line(3) = {3,4};
Line(4) = {4,1};
Line Loop(1) = {1,2,3,4};

Plane Surface( 2 ) = {1};
z1[] = Extrude{ 0, 0, 3 }{ Surface{ 2 }; };

// meshing works when commenting the above 2 lines and uncommenting the following 2 lines 
//Plane Surface( 1 ) = {1};
//z1[] = Extrude{ 0, 0, 3 }{ Surface{ 1 }; };

Surface Loop( 2 ) = { z1[ 0 ], z1[ 1 ], z1[ 2 ], z1[ 3 ], z1[ 4 ], z1[ 5 ] };

Printf( "%g %g %g %g %g %g", z1[ 0 ], z1[ 1 ], z1[ 2 ], z1[ 3 ], z1[ 4 ], z1[ 5 ] );

Volume( 2 ) = { 2 };
Mesh 3;

Thanks,
Mike.


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20090701/76844dda/attachment.html>