[Gmsh] Warnings when 3D mesh ...

Catalin Bondrea cbondrea at robotics.ucv.ro
Wed Jun 11 16:51:33 CEST 2003


Dear GMSH users,
 
I have a small problem:
With this code I create a geometrical form:

c1 = 0.2;
l1 = 0.2;
l2 = 0.3;


Point(newp) = {l1, l1, -(l2-l1)/2, c1};
Point(newp) = {-l1, l1, -(l2-l1)/2, c1};
Point(newp) = {-l1, -l1, -(l2-l1)/2, c1};
Point(newp) = {l1, -l1, -(l2-l1)/2, c1};
Point(newp) = {l1, l1, (l2-l1)/2, c1};
Point(newp) = {-l1, l1, (l2-l1)/2, c1};
Point(newp) = {-l1, -l1, (l2-l1)/2, c1};
Point(newp) = {l1, -l1, (l2-l1)/2, c1};

Point(newp) = {l2, l2, -(l2-l1)/2, c1};
Point(newp) = {-l2, l2, -(l2-l1)/2, c1};
Point(newp) = {-l2, -l2, -(l2-l1)/2, c1};
Point(newp) = {l2, -l2, -(l2-l1)/2, c1};
Point(newp) = {l2, l2, (l2-l1)/2, c1};
Point(newp) = {-l2, l2, (l2-l1)/2, c1};
Point(newp) = {-l2, -l2, (l2-l1)/2, c1};
Point(newp) = {l2, -l2, (l2-l1)/2, c1};


Line(1) = {1, 9};
Line(2) = {9, 13};
Line(3) = {13, 5};
Line(4) = {5, 1};
Line(5) = {5, 6};
Line(6) = {1, 2};
Line(7) = {9, 10};
Line(8) = {13, 14};
Line(9) = {6, 14};
Line(10) = {14, 10};
Line(11) = {10, 2};
Line(12) = {2, 6};
Line(13) = {2, 3};
Line(14) = {6, 7};
Line(15) = {14, 15};
Line(16) = {10, 11};
Line(17) = {11, 3};
Line(18) = {3, 7};
Line(19) = {7, 15};
Line(20) = {15, 11};
Line(21) = {3, 4};
Line(22) = {7, 8};
Line(23) = {15, 16};
Line(24) = {11, 12};
Line(25) = {4, 12};
Line(26) = {12, 16};
Line(27) = {16, 8};
Line(28) = {8, 4};
Line(29) = {12, 9};
Line(30) = {16, 13};
Line(31) = {4, 1};
Line(32) = {8, 5};


Line Loop(45) = {1, 2, 3, 4};
Plane Surface(46) = {45};
Line Loop(47) = {12, 9, 10, 11};
Plane Surface(48) = {47};
Line Loop(49) = {19, 20, 17, 18};
Plane Surface(50) = {49};
Line Loop(51) = {28, 25, 26, 27};
Plane Surface(52) = {51};
Line Loop(53) = {-3, -30, 27, 32};
Plane Surface(54) = {53};
Line Loop(55) = {-30, -26, 29, 2};
Plane Surface(56) = {55};
Line Loop(57) = {29, -1, -31, 25};
Plane Surface(58) = {57};
Line Loop(59) = {31, -4, -32, 28};
Plane Surface(60) = {59};
Line Loop(61) = {9, -8, 3, 5};
Plane Surface(62) = {61};
Line Loop(63) = {-7, 2, 8, 10};
Plane Surface(64) = {63};
Line Loop(65) = {11, -6, 1, 7};
Plane Surface(66) = {65};
Line Loop(67) = {-5, 4, 6, 12};
Plane Surface(68) = {67};
Line Loop(69) = {13, -17, -16, 11};
Plane Surface(70) = {69};
Line Loop(71) = {-18, -13, 12, 14};
Plane Surface(72) = {71};
Line Loop(73) = {19, -15, -9, 14};
Plane Surface(74) = {73};
Line Loop(75) = {-20, -15, 10, 16};
Plane Surface(76) = {75};
Line Loop(77) = {-23, 20, 24, 26};
Plane Surface(78) = {77};
Line Loop(79) = {-24, 17, 21, 25};
Plane Surface(80) = {79};
Line Loop(81) = {22, 28, -21, 18};
Plane Surface(82) = {81};
Line Loop(83) = {-22, 19, 23, 27};
Plane Surface(84) = {83};


Surface Loop(100) = {52, 60, 58, 56, 54, 46};
Volume(101) = {100};
Surface Loop(102) = {46, 66, 48, 68, 62, 64};
Volume(103) = {102};
Surface Loop(104) = {50, 74, 76, 48, 72, 70};
Volume(105) = {104};
Surface Loop(106) = {52, 82, 84, 50, 78, 80};
Volume(107) = {106};


Physical Volume(2) = {101, 103, 105, 107};

Line Loop(108) = {22,32,5,14};
Plane Surface(109) = {108};
Line Loop(110) = {31,6,13,21};
Plane Surface(111) = {110};
Surface Loop(112) = {111,60,68,109,82,72};
Volume(113) = {112};

 
the 3D mesh it's working fine.
Now I try to make this code more general, in the hypothesis like I want to multiply the form generated.
The code is this:

Function CreateVolume   

p1=newp; Point(p1) = {PX+l1,   PY+l1,   PZ+(-(l2-l1)*2), c1};
p2=newp; Point(p2) = {PX+(-l1),  PY+l1,   PZ+(-(l2-l1)*2), c1};
p3=newp; Point(p3) = {PX+(-l1),  PY+(-l1), PZ+(-(l2-l1)*2), c1};
p4=newp; Point(p4) = {PX+l1,   PY+(-l1), PZ+(-(l2-l1)*2), c1};

p5=newp; Point(p5) = {PX+l1,   PY+l1,  PZ+(+(l2-l1)*2), c1};
p6=newp; Point(p6) = {PX+(-l1),  PY+l1,   PZ+(+(l2-l1)*2), c1};
p7=newp; Point(p7) = {PX+(-l1),  PY+(-l1),  PZ+(+(l2-l1)*2), c1};
p8=newp; Point(p8) = {PX+l1,   PY+(-l1),  PZ+(+(l2-l1)*2), c1};

p9=newp; Point(p9) = {PX+l2,   PY+l2,   PZ+(-(l2-l1)*2), c1};
p10=newp; Point(p10) = {PX+(-l2),  PY+l2,   PZ+(-(l2-l1)*2), c1};
p11=newp; Point(p11) = {PX+(-l2),  PY+(-l2), PZ+(-(l2-l1)*2), c1};
p12=newp; Point(p12) = {PX+l2,   PY+(-l2),  PZ+(-(l2-l1)*2), c1};

p13=newp; Point(p13) = {PX+l2,   PY+l2,   PZ+(+(l2-l1)*2), c1};
p14=newp; Point(p14) = {PX+(-l2),  PY+l2,   PZ+(+(l2-l1)*2), c1};
p15=newp; Point(p15) = {PX+(-l2),  PY+(-l2),  PZ+(+(l2-l1)*2), c1};
p16=newp; Point(p16) = {PX+l2,   PY+(-l2),  PZ+(+(l2-l1)*2), c1};


L1=newreg; Line(L1) = {p1, p9};
L2=newreg; Line(L2) = {p9, p13};
L3=newreg; Line(L3) = {p13, p5};
L4=newreg; Line(L4) = {p5, p1};
L5=newreg; Line(L5) = {p5, p6};
L6=newreg; Line(L6) = {p1, p2};
L7=newreg; Line(L7) = {p9, p10};
L8=newreg; Line(L8) = {p13, p14};
L9=newreg; Line(L9) = {p6, p14};
L10=newreg; Line(L10) = {p14, p10};
L11=newreg; Line(L11) = {p10, p2};
L12=newreg; Line(L12) = {p2, p6};
L13=newreg; Line(L13) = {p2, p3};
L14=newreg; Line(L14) = {p6, p7};
L15=newreg; Line(L15) = {p14, p15};
L16=newreg; Line(L16) = {p10, p11};
L17=newreg; Line(L17) = {p11, p3};
L18=newreg; Line(L18) = {p3, p7};
L19=newreg; Line(L19) = {p7, p15};
L20=newreg; Line(L20) = {p15, p11};
L21=newreg; Line(L21) = {p3, p4};
L22=newreg; Line(L22) = {p7, p8};
L23=newreg; Line(L23) = {p15, p16};
L24=newreg; Line(L24) = {p11, p12};
L25=newreg; Line(L25) = {p4, p12};
L26=newreg; Line(L26) = {p12, p16};
L27=newreg; Line(L27) = {p16, p8};
L28=newreg; Line(L28) = {p8, p4};
L29=newreg; Line(L29) = {p12, p9};
L30=newreg; Line(L30) = {p16, p13};
L31=newreg; Line(L31) = {p4, p1};
L32=newreg; Line(L32) = {p8, p5};

Line Loop(newreg) = {L1, L2, L3, L4};
Plane Surface(newreg) = {newreg-1}; ps1=newreg-1; 
Line Loop(newreg) = {L12, L9, L10, L11};
Plane Surface(newreg) = {newreg-1}; ps2=newreg-1; 
Line Loop(newreg) = {L19, L20, L17, L18}; 
Plane Surface(newreg) = {newreg-1}; ps3=newreg-1;
Line Loop(newreg) = {L28, L25, L26, L27};
Plane Surface(newreg) = {newreg-1}; ps4=newreg-1;

Line Loop(newreg) = {-L3, -L30, L27, L32};
Plane Surface(newreg) = {newreg-1}; ps5=newreg-1;
Line Loop(newreg) = {-L30, -L26, L29, L2};
Plane Surface(newreg) = {newreg-1}; ps6=newreg-1;
Line Loop(newreg) = {L29, -L1, -L31, L25};
Plane Surface(newreg) = {newreg-1}; ps7=newreg-1;
Line Loop(newreg) = {L31, -L4, -L32, L28};
Plane Surface(newreg) = {newreg-1}; ps8=newreg-1;

Line Loop(newreg) = {L9, -L8, L3, L5};
Plane Surface(newreg) = {newreg-1}; ps9=newreg-1;
Line Loop(newreg) = {-L7, L2, L8, L10};
Plane Surface(newreg) = {newreg-1}; ps10=newreg-1;
Line Loop(newreg) = {L11, -L6, L1, L7};
Plane Surface(newreg) = {newreg-1}; ps11=newreg-1;
Line Loop(newreg) = {-L5, L4, L6, L12};
Plane Surface(newreg) = {newreg-1}; ps12=newreg-1;

Line Loop(newreg) = {L13, -L17, -L16, L11};
Plane Surface(newreg) = {newreg-1}; ps13=newreg-1;
Line Loop(newreg) = {-L18, -L13, L12, L14};
Plane Surface(newreg) = {newreg-1}; ps14=newreg-1;
Line Loop(newreg) = {L19, -L15, -L9, L14};
Plane Surface(newreg) = {newreg-1}; ps15=newreg-1;
Line Loop(newreg) = {-L20, -L15, L10, L16};
Plane Surface(newreg) = {newreg-1}; ps16=newreg-1;


Line Loop(newreg) = {-L23, L20, L24, L26};
Plane Surface(newreg) = {newreg-1}; ps17=newreg-1;
Line Loop(newreg) = {-L24, L17, L21, L25};
Plane Surface(newreg) = {newreg-1}; ps18=newreg-1;
Line Loop(newreg) = {L22, L28, -L21, L18};
Plane Surface(newreg) = {newreg-1}; ps19=newreg-1;
Line Loop(newreg) = {-L22, L19, L23, L27};
Plane Surface(newreg) = {newreg-1}; ps20=newreg-1;

sl1=newreg; Surface Loop(sl1) = {ps4,ps8,ps7,ps6,ps5,ps1};
V1=newreg; Volume(V1) = {sl1};
sl2=newreg; Surface Loop(sl2) = {ps1,ps11,ps2,ps12,ps9,ps10};
V2=newreg; Volume(V2) = {sl2};
sl3=newreg; Surface Loop(sl3) = {ps3,ps15,ps16,ps2,ps14,ps13};
V3=newreg; Volume(V3) = {sl3};
sl4=newreg; Surface Loop(sl4) = {ps4,ps19,ps20,ps3,ps17,ps18};
V4=newreg; Volume(V4) = {sl4};

phvX=newreg; CooperV=phvX; Physical Volume(phvX) = {V1,V2,V3,V4};

Return    

Function CreateVolumeInterior 

Printf("L: =%G =%G =%G =%G ",L22,L32,L5,L14);
Line Loop(newreg) = {L22,L32,L5,L14};
Plane Surface(newreg) = {newreg-1}; Mps1=newreg-1; 
Line Loop(newreg) = {L21,L31,L6,L13};
Printf("L: =%G =%G =%G =%G ",L21,L31,L6,L13);
Plane Surface(newreg) = {newreg-1}; Mps2=newreg-1; 
Printf("ps14=%G,ps12=%G,ps8=%G,ps19=%G,Mps1=%G,Mps2=%G",ps14,ps12,ps8,ps19,Mps1,Mps2);
Msl1=newreg; Surface Loop(Msl1) = {ps19,Mps1,ps14,Mps2,ps12,ps8};
V5=newreg; IronX1=V5; Volume(V5) = {Msl1};
phvX=newreg; IronVol=phvX; Physical Volume(phvX) = {V5};

Return        


c1 = 0.1;
l1 = 0.1; l2 = 0.15;
PX=0.0;PY=0.0;PZ=0.0;
Call CreateVolume;
Call CreateVolumeInterior; 

Now looks again in the same way like before but when I try to mesh this geo file I have a lot of errors.

What is the problem? 
I will attach also the code files.

Regards,
Catalin
 

--------------------------------------------------------------------------------
Department of Engineering Science 
University of Oxford 
Parks Road,OXFORD,OX1 3PJ,UK 
Land-Line: +44 1865 273001 
Mobile : +44 7791 860696 
E-mail: cbondrea at robotics.ucv.ro 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20030611/e6e7d42a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: code2.geo
Type: application/octet-stream
Size: 5214 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20030611/e6e7d42a/attachment.geo>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: code1.geo
Type: application/octet-stream
Size: 3011 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20030611/e6e7d42a/attachment-0001.geo>