Hi,
Your original script works properly with my laptop. No problems for meshing.
I don't understand why you need to make a surface loop yourself and create a volume after.

I've printed the content of z1[], using:

For k In {0:#z1[]-1}
Printf("z1[%g] %g", k, z1[k]);
EndFor
As expected the list contains the top of the cuboid at index 0 and the volume at index 1:
z1[0] = 26 ==> top surface
z1[1] = 1   ==> volume

The rest are the other sides:
z1[2] 13
z1[3] 17
z1[4] 21
z1[5] 25

Regards,
Ruth



Mike B. wrote:
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.


_______________________________________________ gmsh mailing list [email protected] http://www.geuz.org/mailman/listinfo/gmsh


-- 
Dr. Ir. Ruth V. Sabariego
University of Liege, Institut Montefiore,
Dept. of Electrical Engineering & Computer Science, 
Applied & Computational Electromagnetics (ACE),
Sart Tilman Campus, Grande Traverse, 10 (B28), B-4000 LIEGE, Belgium
phone: +32-4-3663737 -- fax: +32-4-3662910 -- http://elap.montefiore.ulg.ac.be/



_______________________________________________
gmsh mailing list
[email protected]
http://www.geuz.org/mailman/listinfo/gmsh

Reply via email to