Hi Julian,
There were several problems in your geometry.
1. For having an embedded circle/ellipse in a square you have to put first the outer loop and then the inner loop (the hole). 2. You should be careful when duplicating lines: that can be a problem when building the final volume.

See the attached and correct version of your geometry.
Regards,
Ruth


On 05/04/11 13:43, Julian Dean wrote:
Dear all,

I'm trying to mesh a circular shape on the top of the cube for use as a contact 
(if you image a block of material with a wire attaching to the top you have the 
idea of why i need to design it like this.)

What i'm having issues with is how to generate the top surface so that it is 
still one surface but the mesh will follow the circle shape.

Any help would be gratefully received!!

Best regards

Julian




Geometry.AutoCoherence=0;

Lc1 = 1.00000;

Point(0)={-0.500000,0.500000,0.500000, Lc1};
Point(1)={0.500000,0.500000,0.500000, Lc1};
Point(2)={-0.500000,0.500000,-0.500000, Lc1};
Point(3)={0.500000,0.500000,-0.500000, Lc1};
Point(4)={-0.500000,-0.500000,0.500000, Lc1};
Point(5)={0.500000,-0.500000,0.500000, Lc1};
Point(6)={-0.500000,-0.500000,-0.500000, Lc1};
Point(7)={0.500000,-0.500000,-0.500000, Lc1};

Line(1)={1,5};
Line(2)={5,4};
Line(3)={4,0};
Line(4)={0,1};
Line Loop(1)={1,2,3,4};

Point(8)={0.000000,0.000000,0.500000, Lc1};
Point(9)={-0.250000,0.000000,0.500000, Lc1};
Point(10)={0.000000,-0.250000,0.500000, Lc1};
Point(11)={0.250000,0.000000,0.500000, Lc1};
Point(12)={0.000000,0.250000,0.500000, Lc1};

Ellipse(6)={9, 8, 9, 10};
Ellipse(7)={10, 8, 9, 11};
Ellipse(8)={11, 8, 9, 12};
Ellipse(9)={12, 8, 9, 9};

Line Loop(2)={6, 7, 8, 9};
Plane Surface(1)={1};
Plane Surface(2)={2,1};
Line(10)={2,3};
Line(11)={3,1};
Line(12)={1,0};
Line(13)={0,2};
Line Loop(3)={10,11,12,13};
Plane Surface(3)={3};
Line(15)={3,7};
Line(16)={7,5};
Line(17)={5,1};
Line(18)={1,3};
Line Loop(4)={15,16,17,18};
Plane Surface(4)={4};
Line(20)={6,2};
Line(21)={2,0};
Line(22)={0,4};
Line(23)={4,6};
Line Loop(5)={20,21,22,23};
Plane Surface(5)={5};
Line(25)={7,6};
Line(26)={6,4};
Line(27)={4,5};
Line(28)={5,7};
Line Loop(6)={25,26,27,28};
Plane Surface(6)={6};
Line(30)={6,7};
Line(31)={7,3};
Line(32)={3,2};
Line(33)={2,6};
Line Loop(7)={30,31,32,33};
Plane Surface(7)={7};
Surface Loop(1)={1,2,3,4,5,6,7};
Volume(1)={1};

Coherence;
Mesh.CharacteristicLengthExtendFromBoundary = 0;
Mesh.CharacteristicLengthMax = 1.000000;


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


--
Dr. Ir. Ruth V. Sabariego
University of Liege, Dept. of Electrical Engineering&  Computer Science,
Applied&  Computational Electromagnetics (ACE),
phone: +32-4-3663737 - fax: +32-4-3662910 - http://ace.montefiore.ulg.ac.be/

Lc1 = .25;

Point(0)={-0.500000,0.500000, 0.500000, Lc1};
Point(1)={ 0.500000,0.500000, 0.500000, Lc1};
Point(2)={-0.500000,0.500000,-0.500000, Lc1};
Point(3)={ 0.500000,0.500000,-0.500000, Lc1};

Point(4)={-0.500000,-0.500000, 0.500000, Lc1};
Point(5)={ 0.500000,-0.500000, 0.500000, Lc1};
Point(6)={-0.500000,-0.500000,-0.500000, Lc1};
Point(7)={ 0.500000,-0.500000,-0.500000, Lc1};

// Up 
Line(1)={1,5};
Line(2)={5,4};
Line(3)={4,0};
Line(4)={0,1};
Line Loop(1)={1,2,3,4}; 

Line(5) = {0, 2};
Line(6) = {2, 3};
Line(7) = {3, 1};
Line(8) = {2, 6};
Line(9) = {6, 4};
Line(10) = {6, 7};
Line(11) = {7, 5};
Line(12) = {7, 3};
Line Loop(13) = {7, -4, 5, 6};
Plane Surface(14) = {13};
Line Loop(15) = {1, -11, 12, 7};
Plane Surface(16) = {15};
Line Loop(17) = {2, -9, 10, 11};
Plane Surface(18) = {17};
Line Loop(19) = {3, 5, 8, 9};
Plane Surface(20) = {19};
Line Loop(21) = {6, -12, -10, -8};
Plane Surface(22) = {21};

//Circle
Point(8)={0.000000,0.000000,0.500000, Lc1};
Point(9)={-0.250000,0.000000,0.500000, Lc1};
Point(10)={0.000000,-0.250000,0.500000, Lc1};
Point(11)={0.250000,0.000000,0.500000, Lc1};
Point(12)={0.000000,0.250000,0.500000, Lc1};

Circle(23) = {9, 8, 10};
Circle(24) = {10, 8, 11};
Circle(25) = {11, 8, 12};
Circle(26) = {12, 8, 9};
Line Loop(27) = {24, 25, 26, 23};

Plane Surface(28) = {27}; // Circle
Plane Surface(29) = {1, 27}; // Square minus circle


Surface Loop(30) = {16, 29, 18, 20, 14, 22, 28};
Volume(31) = {30};
_______________________________________________
gmsh mailing list
[email protected]
http://www.geuz.org/mailman/listinfo/gmsh

Reply via email to