/[escript]/trunk/pycad/test/python/run_pycad_test.py
ViewVC logotype

Diff of /trunk/pycad/test/python/run_pycad_test.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1044 by ksteube, Sun Mar 4 23:15:15 2007 UTC revision 1045 by gross, Tue Mar 20 01:30:58 2007 UTC
# Line 750  class Test_PyCAD_Primitives(unittest.Tes Line 750  class Test_PyCAD_Primitives(unittest.Tes
750         p*=Dilation(2)         p*=Dilation(2)
751         self.failUnless(p.isColocated(Point(8,16,24)),"applying in-place Dilation factor failed")         self.failUnless(p.isColocated(Point(8,16,24)),"applying in-place Dilation factor failed")
752    
        # get gmsh code  
        code=p.getGmshCommand(2.)  
        self.failUnless("Point(1) = {8.0 , 16.0, 24.0 , 6.0 };"== code, "wrong gmsh code")  
   
753     def test_Spline(self):     def test_Spline(self):
754          p0=Point(0,0,0,0.1)          p0=Point(0,0,0,0.1)
755          p1=Point(1,1,1,0.2)          p1=Point(1,1,1,0.2)
# Line 791  class Test_PyCAD_Primitives(unittest.Tes Line 787  class Test_PyCAD_Primitives(unittest.Tes
787          self.failUnless(co[2].getLocalScale() == 3., "new local scale of 3rd control point is wrong.")          self.failUnless(co[2].getLocalScale() == 3., "new local scale of 3rd control point is wrong.")
788          self.failUnless(co[3].getLocalScale() == 3., "new local scale of 4th control point is wrong.")          self.failUnless(co[3].getLocalScale() == 3., "new local scale of 4th control point is wrong.")
789    
         code=c.getGmshCommand()  
         self.failUnless(code == "Spline(6) = {1, 2, 3, 4};", "gmsh command wrong.")  
   
790          h=c.getPrimitives()          h=c.getPrimitives()
791          self.failUnless(len(h) == 5, "number of primitives in history is wrong.")          self.failUnless(len(h) == 5, "number of primitives in history is wrong.")
792          self.failUnless(p0 in h, "missing p0 in history.")          self.failUnless(p0 in h, "missing p0 in history.")
# Line 868  class Test_PyCAD_Primitives(unittest.Tes Line 861  class Test_PyCAD_Primitives(unittest.Tes
861          self.failUnless(co[2].getLocalScale() == 3., "new local scale of 3rd control point is wrong.")          self.failUnless(co[2].getLocalScale() == 3., "new local scale of 3rd control point is wrong.")
862          self.failUnless(co[3].getLocalScale() == 3., "new local scale of 4th control point is wrong.")          self.failUnless(co[3].getLocalScale() == 3., "new local scale of 4th control point is wrong.")
863    
         code=c.getGmshCommand()  
         self.failUnless(code == "Spline(6) = {1, 2, 3, 4};", "gmsh command wrong.")  
   
864          h=c.getPrimitives()          h=c.getPrimitives()
865          self.failUnless(len(h) == 5, "number of primitives in history is wrong.")          self.failUnless(len(h) == 5, "number of primitives in history is wrong.")
866          self.failUnless(p0 in h, "missing p0 in history.")          self.failUnless(p0 in h, "missing p0 in history.")
# Line 939  class Test_PyCAD_Primitives(unittest.Tes Line 929  class Test_PyCAD_Primitives(unittest.Tes
929          self.failUnless(co[2].getLocalScale() == 3., "new local scale of 3rd control point is wrong.")          self.failUnless(co[2].getLocalScale() == 3., "new local scale of 3rd control point is wrong.")
930          self.failUnless(co[3].getLocalScale() == 3., "new local scale of 4th control point is wrong.")          self.failUnless(co[3].getLocalScale() == 3., "new local scale of 4th control point is wrong.")
931    
         code=c.getGmshCommand()  
         self.failUnless(code == "Bezier(6) = {1, 2, 3, 4};", "gmsh command wrong.")  
   
932          h=c.getPrimitives()          h=c.getPrimitives()
933          self.failUnless(len(h) == 5, "number of primitives in history is wrong.")          self.failUnless(len(h) == 5, "number of primitives in history is wrong.")
934          self.failUnless(p0 in h, "missing p0 in history.")          self.failUnless(p0 in h, "missing p0 in history.")
# Line 1012  class Test_PyCAD_Primitives(unittest.Tes Line 999  class Test_PyCAD_Primitives(unittest.Tes
999          self.failUnless(co[2].getLocalScale() == 3., "new local scale of 3rd control point is wrong.")          self.failUnless(co[2].getLocalScale() == 3., "new local scale of 3rd control point is wrong.")
1000          self.failUnless(co[3].getLocalScale() == 3., "new local scale of 4th control point is wrong.")          self.failUnless(co[3].getLocalScale() == 3., "new local scale of 4th control point is wrong.")
1001    
         code=c.getGmshCommand()  
         self.failUnless(code == "BSpline(6) = {1, 2, 3, 4};", "gmsh command wrong.")  
   
1002          h=c.getPrimitives()          h=c.getPrimitives()
1003          self.failUnless(len(h) == 5, "number of primitives in history is wrong.")          self.failUnless(len(h) == 5, "number of primitives in history is wrong.")
1004          self.failUnless(p0 in h, "missing p0 in history.")          self.failUnless(p0 in h, "missing p0 in history.")
# Line 1089  class Test_PyCAD_Primitives(unittest.Tes Line 1073  class Test_PyCAD_Primitives(unittest.Tes
1073          self.failUnless(co[2].getLocalScale() == 3., "new local scale of 3rd control point is wrong.")          self.failUnless(co[2].getLocalScale() == 3., "new local scale of 3rd control point is wrong.")
1074          self.failUnless(co[3].getLocalScale() == 3., "new local scale of 4th control point is wrong.")          self.failUnless(co[3].getLocalScale() == 3., "new local scale of 4th control point is wrong.")
1075    
         code=c.getGmshCommand()  
         self.failUnless(code == "BSpline(6) = {1, 2, 3, 4};", "gmsh command wrong.")  
   
1076          h=c.getPrimitives()          h=c.getPrimitives()
1077          self.failUnless(len(h) == 5, "number of primitives in history is wrong.")          self.failUnless(len(h) == 5, "number of primitives in history is wrong.")
1078          self.failUnless(p0 in h, "missing p0 in history.")          self.failUnless(p0 in h, "missing p0 in history.")
# Line 1161  class Test_PyCAD_Primitives(unittest.Tes Line 1142  class Test_PyCAD_Primitives(unittest.Tes
1142          self.failUnless(co[0].getLocalScale() == 3., "new local scale of 1st control point is wrong.")          self.failUnless(co[0].getLocalScale() == 3., "new local scale of 1st control point is wrong.")
1143          self.failUnless(co[1].getLocalScale() == 3., "new local scale of 2nd control point is wrong.")          self.failUnless(co[1].getLocalScale() == 3., "new local scale of 2nd control point is wrong.")
1144    
         code=c.getGmshCommand()  
         self.failUnless(code == "Line(4) = {1, 2};", "gmsh command wrong.")  
   
1145          h=c.getPrimitives()          h=c.getPrimitives()
1146          self.failUnless(len(h) == 3, "number of primitives in history is wrong.")          self.failUnless(len(h) == 3, "number of primitives in history is wrong.")
1147          self.failUnless(p0 in h, "missing p0 in history.")          self.failUnless(p0 in h, "missing p0 in history.")
# Line 1224  class Test_PyCAD_Primitives(unittest.Tes Line 1202  class Test_PyCAD_Primitives(unittest.Tes
1202          self.failUnless(co[0].getLocalScale() == 3., "new local scale of 1st control point is wrong.")          self.failUnless(co[0].getLocalScale() == 3., "new local scale of 1st control point is wrong.")
1203          self.failUnless(co[1].getLocalScale() == 3., "new local scale of 2nd control point is wrong.")          self.failUnless(co[1].getLocalScale() == 3., "new local scale of 2nd control point is wrong.")
1204    
         code=c.getGmshCommand()  
         self.failUnless(code == "Line(4) = {1, 2};", "gmsh command wrong.")  
   
1205          h=c.getPrimitives()          h=c.getPrimitives()
1206          self.failUnless(len(h) == 3, "number of primitives in history is wrong.")          self.failUnless(len(h) == 3, "number of primitives in history is wrong.")
1207          self.failUnless(p0 in h, "missing p0 in history.")          self.failUnless(p0 in h, "missing p0 in history.")
# Line 1271  class Test_PyCAD_Primitives(unittest.Tes Line 1246  class Test_PyCAD_Primitives(unittest.Tes
1246          self.failUnless(c.hasSameOrientation(c),"has not same orientation like itself")          self.failUnless(c.hasSameOrientation(c),"has not same orientation like itself")
1247          self.failUnless(not c.hasSameOrientation(-c),"has same orientation like -itself")          self.failUnless(not c.hasSameOrientation(-c),"has same orientation like -itself")
1248    
         code=c.getGmshCommand()  
         self.failUnless(code == "Circle(6) = {2, 1, 3};", "gmsh command wrong.")  
   
1249          self.failUnless(not c.isColocated(p4),"spline is colocated with point.")          self.failUnless(not c.isColocated(p4),"spline is colocated with point.")
1250          self.failUnless(not c.isColocated(Arc(p4,p_start,p_end)),"spline is colocated with spline with differnt center point.")          self.failUnless(not c.isColocated(Arc(p4,p_start,p_end)),"spline is colocated with spline with differnt center point.")
1251          self.failUnless(not c.isColocated(Arc(center,p4,p_end)),"spline is colocated with spline with differnt start point.")          self.failUnless(not c.isColocated(Arc(center,p4,p_end)),"spline is colocated with spline with differnt start point.")
# Line 1336  class Test_PyCAD_Primitives(unittest.Tes Line 1308  class Test_PyCAD_Primitives(unittest.Tes
1308          self.failUnless(c.hasSameOrientation(c),"has not same orientation like itself")          self.failUnless(c.hasSameOrientation(c),"has not same orientation like itself")
1309          self.failUnless(not c.hasSameOrientation(-c),"has same orientation like -itself")          self.failUnless(not c.hasSameOrientation(-c),"has same orientation like -itself")
1310    
         code=c.getGmshCommand()  
         self.failUnless(code == "Circle(6) = {2, 1, 3};", "gmsh command wrong.")  
   
1311          self.failUnless(not c.isColocated(p4),"spline is colocated with point.")          self.failUnless(not c.isColocated(p4),"spline is colocated with point.")
1312          self.failUnless(not c.isColocated(Arc(p4,p_start,p_end)),"spline is colocated with spline with differnt center point.")          self.failUnless(not c.isColocated(Arc(p4,p_start,p_end)),"spline is colocated with spline with differnt center point.")
1313          self.failUnless(not c.isColocated(Arc(center,p4,p_end)),"spline is colocated with spline with differnt start point.")          self.failUnless(not c.isColocated(Arc(center,p4,p_end)),"spline is colocated with spline with differnt start point.")
# Line 1408  class Test_PyCAD_Primitives(unittest.Tes Line 1377  class Test_PyCAD_Primitives(unittest.Tes
1377          self.failUnless(c.hasSameOrientation(c),"has not same orientation like itself")          self.failUnless(c.hasSameOrientation(c),"has not same orientation like itself")
1378          self.failUnless(not c.hasSameOrientation(-c),"has same orientation like -itself")          self.failUnless(not c.hasSameOrientation(-c),"has same orientation like -itself")
1379    
         code=c.getGmshCommand()  
         self.failUnless(code == "Line Loop(14) = {8, 10, 9};", "gmsh command wrong.")  
   
1380          self.failUnless(not c.isColocated(p4),"CurveLoop is colocated with point.")          self.failUnless(not c.isColocated(p4),"CurveLoop is colocated with point.")
1381          self.failUnless(c.isColocated(c),"CurveLoop is not colocated with its self.")          self.failUnless(c.isColocated(c),"CurveLoop is not colocated with its self.")
1382          self.failUnless(c.isColocated(CurveLoop(l01,l12,l20)),"CurveLoop is not colocated with its copy.")          self.failUnless(c.isColocated(CurveLoop(l01,l12,l20)),"CurveLoop is not colocated with its copy.")
# Line 1505  class Test_PyCAD_Primitives(unittest.Tes Line 1471  class Test_PyCAD_Primitives(unittest.Tes
1471          self.failUnless(c.hasSameOrientation(c),"has not same orientation like itself")          self.failUnless(c.hasSameOrientation(c),"has not same orientation like itself")
1472          self.failUnless(not c.hasSameOrientation(-c),"has same orientation like -itself")          self.failUnless(not c.hasSameOrientation(-c),"has same orientation like -itself")
1473    
         code=c.getGmshCommand()  
         self.failUnless(code == "Line Loop(13) = {8, 10, 9};", "gmsh command wrong.")  
   
   
1474          self.failUnless(not c.isColocated(p4),"-CurveLoop is colocated with point.")          self.failUnless(not c.isColocated(p4),"-CurveLoop is colocated with point.")
1475          self.failUnless(c.isColocated(c),"-CurveLoop is not colocated with its self.")          self.failUnless(c.isColocated(c),"-CurveLoop is not colocated with its self.")
1476          self.failUnless(c.isColocated(CurveLoop(l01,l12,l20)),"-CurveLoop is not colocated with its copy.")          self.failUnless(c.isColocated(CurveLoop(l01,l12,l20)),"-CurveLoop is not colocated with its copy.")
# Line 1622  class Test_PyCAD_Primitives(unittest.Tes Line 1584  class Test_PyCAD_Primitives(unittest.Tes
1584          self.failUnless(crvs[crvs.index(l20)].hasSameOrientation(l20),"l12_1 has incorrect orientation.")          self.failUnless(crvs[crvs.index(l20)].hasSameOrientation(l20),"l12_1 has incorrect orientation.")
1585                                
1586    
         code=s.getGmshCommand()  
         self.failUnless(code == "Ruled Surface(17) = {14};", "gmsh command wrong.")  
   
1587          self.failUnless(not s.isColocated(p4),"RuledSurface is colocated with point.")          self.failUnless(not s.isColocated(p4),"RuledSurface is colocated with point.")
1588          self.failUnless(s.isColocated(s),"RuledSurface is not colocated with its self.")          self.failUnless(s.isColocated(s),"RuledSurface is not colocated with its self.")
1589          self.failUnless(s.isColocated(RuledSurface(cl1)),"RuledSurface is not colocated with its copy.")          self.failUnless(s.isColocated(RuledSurface(cl1)),"RuledSurface is not colocated with its copy.")
# Line 1764  class Test_PyCAD_Primitives(unittest.Tes Line 1723  class Test_PyCAD_Primitives(unittest.Tes
1723          self.failUnless(crvs[crvs.index(l20)].hasSameOrientation(-l20),"l12_1 has incorrect orientation.")          self.failUnless(crvs[crvs.index(l20)].hasSameOrientation(-l20),"l12_1 has incorrect orientation.")
1724                                
1725    
         code=s.getGmshCommand()  
         self.failUnless(code == "Ruled Surface(17) = {14};", "gmsh command wrong.")  
   
1726          self.failUnless(not s.isColocated(p4),"RuledSurface is colocated with point.")          self.failUnless(not s.isColocated(p4),"RuledSurface is colocated with point.")
1727          self.failUnless(s.isColocated(s),"RuledSurface is not colocated with its self.")          self.failUnless(s.isColocated(s),"RuledSurface is not colocated with its self.")
1728          self.failUnless(s.isColocated(RuledSurface(cl1)),"RuledSurface is not colocated with its copy.")          self.failUnless(s.isColocated(RuledSurface(cl1)),"RuledSurface is not colocated with its copy.")
# Line 1935  class Test_PyCAD_Primitives(unittest.Tes Line 1891  class Test_PyCAD_Primitives(unittest.Tes
1891          self.failUnless(l6 in crvs, "l6 is missing in boundary")          self.failUnless(l6 in crvs, "l6 is missing in boundary")
1892          self.failUnless(crvs[crvs.index(l6)].hasSameOrientation(l6),"l6 has incorrect orientation.")          self.failUnless(crvs[crvs.index(l6)].hasSameOrientation(l6),"l6 has incorrect orientation.")
1893                                
         code=s.getGmshCommand()  
         self.failUnless(code == "Plane Surface(29) = {23, 24};", "gmsh command wrong.")  
   
1894          self.failUnless(not s.isColocated(p4),"PlaneSurface is colocated with point.")          self.failUnless(not s.isColocated(p4),"PlaneSurface is colocated with point.")
1895          self.failUnless(s.isColocated(s),"PlaneSurface is not colocated with its self.")          self.failUnless(s.isColocated(s),"PlaneSurface is not colocated with its self.")
1896          self.failUnless(s.isColocated(PlaneSurface(cl,holes=[h])),"PlaneSurface is not colocated with its copy.")          self.failUnless(s.isColocated(PlaneSurface(cl,holes=[h])),"PlaneSurface is not colocated with its copy.")
# Line 2185  class Test_PyCAD_Primitives(unittest.Tes Line 2138  class Test_PyCAD_Primitives(unittest.Tes
2138          self.failUnless(s9 in cc, "s9 is missing")          self.failUnless(s9 in cc, "s9 is missing")
2139          self.failUnless(s10 in cc, "s10 is missing")          self.failUnless(s10 in cc, "s10 is missing")
2140    
         code=s.getGmshCommand()  
         self.failUnless(code == "Surface Loop(65) = {43, 46, 49, 52, 54, 56, -58, -60, -62, -64};", "gmsh command wrong.")  
   
2141          self.failUnless(not s.isColocated(p4),"SurfaceLoop is colocated with point.")          self.failUnless(not s.isColocated(p4),"SurfaceLoop is colocated with point.")
2142          self.failUnless(s.isColocated(s),"SurfaceLoop is not colocated with its self.")          self.failUnless(s.isColocated(s),"SurfaceLoop is not colocated with its self.")
2143          self.failUnless(s.isColocated(-s),"SurfaceLoop is not colocated with its reverse.")          self.failUnless(s.isColocated(-s),"SurfaceLoop is not colocated with its reverse.")
# Line 2512  class Test_PyCAD_Primitives(unittest.Tes Line 2462  class Test_PyCAD_Primitives(unittest.Tes
2462          self.failUnless(s9 in cc, "s9 is missing")          self.failUnless(s9 in cc, "s9 is missing")
2463          self.failUnless(s10 in cc, "s10 is missing")          self.failUnless(s10 in cc, "s10 is missing")
2464    
         code=s.getGmshCommand()  
         self.failUnless(code == "Surface Loop(65) = {43, 46, 49, 52, 54, 56, -58, -60, -62, -64};", "gmsh command wrong.")  
   
2465          self.failUnless(not s.isColocated(p4),"SurfaceLoop is colocated with point.")          self.failUnless(not s.isColocated(p4),"SurfaceLoop is colocated with point.")
2466          self.failUnless(s.isColocated(s),"SurfaceLoop is not colocated with its self.")          self.failUnless(s.isColocated(s),"SurfaceLoop is not colocated with its self.")
2467          self.failUnless(s.isColocated(-s),"SurfaceLoop is not colocated with its reverse.")          self.failUnless(s.isColocated(-s),"SurfaceLoop is not colocated with its reverse.")
# Line 2833  class Test_PyCAD_Primitives(unittest.Tes Line 2780  class Test_PyCAD_Primitives(unittest.Tes
2780          self.failUnless(s5_i in cc, "s5_i is missing")          self.failUnless(s5_i in cc, "s5_i is missing")
2781          self.failUnless(s6_i in cc, "s6_i is missing")          self.failUnless(s6_i in cc, "s6_i is missing")
2782    
         code=v.getGmshCommand()  
         self.failUnless(code == "Volume(67) = {33, 66};", "gmsh command wrong.")  
   
2783          self.failUnless(not v.isColocated(p4),"Volume is colocated with point.")          self.failUnless(not v.isColocated(p4),"Volume is colocated with point.")
2784          self.failUnless(v.isColocated(v),"Volume is not colocated with its self.")          self.failUnless(v.isColocated(v),"Volume is not colocated with its self.")
2785          self.failUnless(v.isColocated(Volume(s_out,holes=[s_inner])),"Volume is not colocated with its copy.")          self.failUnless(v.isColocated(Volume(s_out,holes=[s_inner])),"Volume is not colocated with its copy.")
# Line 3118  class Test_PyCAD_Primitives(unittest.Tes Line 3062  class Test_PyCAD_Primitives(unittest.Tes
3062         self.failUnless(p3 in pp, "p3 missing in items.")         self.failUnless(p3 in pp, "p3 missing in items.")
3063         self.failUnless(p4 in pp, "p4 missing in items.")         self.failUnless(p4 in pp, "p4 missing in items.")
3064    
        code=ps.getGmshCommand()  
        self.failUnless(code == "Physical Point(8) = {1, 2, 3, 4};","wrong gmsh code")  
   
3065         pp=ps.getPrimitives()         pp=ps.getPrimitives()
3066         self.failUnless(len(pp) == 5, "wrong number of items")         self.failUnless(len(pp) == 5, "wrong number of items")
3067         self.failUnless(ps in pp, "ps missing in items.")         self.failUnless(ps in pp, "ps missing in items.")
# Line 3163  class Test_PyCAD_Primitives(unittest.Tes Line 3104  class Test_PyCAD_Primitives(unittest.Tes
3104         self.failUnless(l1 in pp, "l1 missing in items.")         self.failUnless(l1 in pp, "l1 missing in items.")
3105         self.failUnless(l2 in pp, "l2 missing in items.")         self.failUnless(l2 in pp, "l2 missing in items.")
3106    
        code=ps.getGmshCommand()  
        self.failUnless(code == "Physical Line(10) = {5, 6, 7};","wrong gmsh code")  
   
3107         pp=ps.getPrimitives()         pp=ps.getPrimitives()
3108         self.failUnless(len(pp) == 8, "wrong number of items")         self.failUnless(len(pp) == 8, "wrong number of items")
3109         self.failUnless(ps in pp, "ps missing in items.")         self.failUnless(ps in pp, "ps missing in items.")
# Line 3216  class Test_PyCAD_Primitives(unittest.Tes Line 3154  class Test_PyCAD_Primitives(unittest.Tes
3154    
3155         self.failUnless(ps.getTag() == 20, "wrong tag")         self.failUnless(ps.getTag() == 20, "wrong tag")
3156                
        code=ps.getGmshCommand()  
        self.failUnless(code == "Physical Surface(20) = {17};","wrong gmsh code")  
   
3157         pp=ps.getPrimitives()         pp=ps.getPrimitives()
3158         self.failUnless(len(pp) == 18, "wrong number of items")         self.failUnless(len(pp) == 18, "wrong number of items")
3159         self.failUnless(ps in pp, "ps missing in items.")         self.failUnless(ps in pp, "ps missing in items.")
# Line 3334  class Test_PyCAD_Primitives(unittest.Tes Line 3269  class Test_PyCAD_Primitives(unittest.Tes
3269    
3270         self.failUnless(ps.getTag() == 70, "wrong tag")         self.failUnless(ps.getTag() == 70, "wrong tag")
3271                
        code=ps.getGmshCommand()  
        self.failUnless(code == "Physical Volume(70) = {67};","wrong gmsh code")  
   
3272         pp=ps.getPrimitives()         pp=ps.getPrimitives()
3273         self.failUnless(len(pp) == 68, "too many primitives.")         self.failUnless(len(pp) == 68, "too many primitives.")
3274         self.failUnless(ps in pp, "ps is missing")         self.failUnless(ps in pp, "ps is missing")
# Line 3603  class Test_PyCAD_Design(unittest.TestCas Line 3535  class Test_PyCAD_Design(unittest.TestCas
3535         pl2=PropertySet("B",l12,l23)         pl2=PropertySet("B",l12,l23)
3536         d.addItems(s,pl1,pl2)         d.addItems(s,pl1,pl2)
3537         d.addItems(ps)         d.addItems(ps)
3538         srpt=d.getScriptString()         scrpt=d.getScriptString()
3539         ref = \         ref = \
3540  """// generated by esys.pycad  """// generated by esys.pycad
3541  Point(1) = {0.0 , 0.0, 0.0 , 0.01 };  Point(1) = {0.0 , 0.0, 0.0 , 0.01 };
# Line 3620  Physical Surface(11) = {10}; Line 3552  Physical Surface(11) = {10};
3552  Physical Line(12) = {5, 8};  Physical Line(12) = {5, 8};
3553  Physical Line(13) = {6, 7};  Physical Line(13) = {6, 7};
3554  """  """
3555         self.failUnless(srpt == ref )         self.failUnless(scrpt == ref )
3556    
3557       def test_generate_Point(self):
3558           d=GMSHDesign(dim=2, element_size=0.01)
3559           d.addItems(Point(1.,2.,3.,local_scale=9.))
3560    
3561           scrpt=d.getScriptString()
3562           ref = \
3563    """// generated by esys.pycad
3564    Point(1) = {1.0 , 2.0, 3.0 , 0.09 };
3565    """
3566           self.failUnless(scrpt == ref )
3567      
3568    
3569       def test_generate_Spline(self):
3570            d=GMSHDesign(dim=2, element_size=0.01)
3571            p0=Point(0,0,0,0.1)
3572            p1=Point(1,1,1,0.2)
3573            p2=Point(2,2,2,0.3)
3574            p3=Point(3,3,3,0.4)
3575    
3576            d.addItems(Spline(p0,p1,p2,p3))
3577    
3578            scrpt=d.getScriptString()
3579            ref = \
3580    """// generated by esys.pycad
3581    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3582    Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3583    Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3584    Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3585    Spline(5) = {1, 2, 3, 4};
3586    """
3587            self.failUnless(scrpt == ref )
3588    
3589       def test_generate_ReverseSpline(self):
3590            d=GMSHDesign(dim=2, element_size=0.01)
3591            p0=Point(0,0,0,0.1)
3592            p1=Point(1,1,1,0.2)
3593            p2=Point(2,2,2,0.3)
3594            p3=Point(3,3,3,0.4)
3595    
3596            CC0=Spline(p0,p1,p2,p3)
3597            d.addItems(-CC0)
3598    
3599            scrpt=d.getScriptString()
3600            ref = \
3601    """// generated by esys.pycad
3602    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3603    Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3604    Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3605    Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3606    Spline(5) = {1, 2, 3, 4};
3607    """
3608            self.failUnless(scrpt == ref )
3609    
3610       def test_generate_BezierCurve(self):
3611            d=GMSHDesign(dim=2, element_size=0.01)
3612            p0=Point(0,0,0,0.1)
3613            p1=Point(1,1,1,0.2)
3614            p2=Point(2,2,2,0.3)
3615            p3=Point(3,3,3,0.4)
3616    
3617            d.addItems(BezierCurve(p0,p1,p2,p3))
3618    
3619            scrpt=d.getScriptString()
3620            ref = \
3621    """// generated by esys.pycad
3622    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3623    Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3624    Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3625    Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3626    Bezier(5) = {1, 2, 3, 4};
3627    """
3628            self.failUnless(scrpt == ref )
3629    
3630       def test_generate_BSpline(self):
3631            d=GMSHDesign(dim=2, element_size=0.01)
3632            p0=Point(0,0,0,0.1)
3633            p1=Point(1,1,1,0.2)
3634            p2=Point(2,2,2,0.3)
3635            p3=Point(3,3,3,0.4)
3636    
3637            self.failUnlessRaises(ValueError,BSpline,p0)
3638            d.addItems(BSpline(p0,p1,p2,p3))
3639    
3640            scrpt=d.getScriptString()
3641            ref = \
3642    """// generated by esys.pycad
3643    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3644    Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3645    Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3646    Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3647    BSpline(5) = {1, 2, 3, 4};
3648    """
3649            self.failUnless(scrpt == ref )
3650    
3651       def test_generate_ReverseBSpline(self):
3652            d=GMSHDesign(dim=2, element_size=0.01)
3653            p0=Point(0,0,0,0.1)
3654            p1=Point(1,1,1,0.2)
3655            p2=Point(2,2,2,0.3)
3656            p3=Point(3,3,3,0.4)
3657            p4=Point(1,2,3)
3658    
3659            CC0=BSpline(p0,p1,p2,p3)
3660            d.addItems(-CC0)
3661    
3662            scrpt=d.getScriptString()
3663            ref = \
3664    """// generated by esys.pycad
3665    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3666    Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3667    Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3668    Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3669    BSpline(6) = {1, 2, 3, 4};
3670    """
3671            self.failUnless(scrpt == ref )
3672    
3673       def test_generate_LineSegment(self):
3674            d=GMSHDesign(dim=2, element_size=0.01)
3675            p0=Point(0,0,0,0.1)
3676            p1=Point(1,1,1,0.2)
3677    
3678            d.addItems(Line(p0,p1))
3679    
3680            scrpt=d.getScriptString()
3681            ref = \
3682    """// generated by esys.pycad
3683    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3684    Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3685    Line(3) = {1, 2};
3686    """
3687            self.failUnless(scrpt == ref )
3688    
3689       def test_generate_ReverseLineSegment(self):
3690            d=GMSHDesign(dim=2, element_size=0.01)
3691            p0=Point(0,0,0,0.1)
3692            p1=Point(1,1,1,0.2)
3693    
3694            CC0=Line(p0,p1)
3695            d.addItems(-CC0)
3696    
3697            scrpt=d.getScriptString()
3698            ref = \
3699    """// generated by esys.pycad
3700    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3701    Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3702    Line(3) = {1, 2};
3703    """
3704            self.failUnless(scrpt == ref )
3705    
3706       def test_generate_Arc(self):
3707            d=GMSHDesign(dim=2, element_size=0.01)
3708            center=Point(0,0,0,0.1)
3709            p_start=Point(1,1,1,0.2)
3710            p_end=Point(1,2,3)
3711    
3712            d.addItems(Arc(center,p_start,p_end))
3713    
3714            scrpt=d.getScriptString()
3715            ref = \
3716    """// generated by esys.pycad
3717    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3718    Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3719    Point(3) = {1.0 , 2.0, 3.0 , 0.01 };
3720    Circle(4) = {2, 1, 3};
3721    """
3722            self.failUnless(scrpt == ref )
3723    
3724       def test_generate_ReverseArc(self):
3725            d=GMSHDesign(dim=2, element_size=0.01)
3726            center=Point(0,0,0,0.1)
3727            p_start=Point(1,1,1,0.2)
3728            p_end=Point(1,2,3)
3729    
3730            CC0=Arc(center,p_start,p_end)
3731            d.addItems(-CC0)
3732    
3733            scrpt=d.getScriptString()
3734            ref = \
3735    """// generated by esys.pycad
3736    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3737    Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3738    Point(3) = {1.0 , 2.0, 3.0 , 0.01 };
3739    Circle(4) = {2, 1, 3};
3740    """
3741            self.failUnless(scrpt == ref )
3742    
3743       def test_generate_CurveLoop(self):
3744            d=GMSHDesign(dim=2, element_size=0.01)
3745            p0=Point(0,0,0,0.1)
3746            p1=Point(1,1,1,0.2)
3747            p2=Point(2,2,2,0.3)
3748            p3=Point(3,3,3,0.4)
3749            p4=Point(1,2,3)
3750    
3751            l01=Line(p0,p1)
3752            l12=Arc(p3,p1,p2)
3753            l20=Spline(p2,p4,p0)
3754    
3755            lx=Line(p2,p3)
3756            ly=Line(p3,p1)
3757    
3758            d.addItems(CurveLoop(l01,l12,l20))
3759    
3760            scrpt=d.getScriptString()
3761            ref = \
3762    """// generated by esys.pycad
3763    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3764    Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3765    Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3766    Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3767    Point(5) = {1.0 , 2.0, 3.0 , 0.01 };
3768    Line(6) = {1, 2};
3769    Circle(7) = {2, 4, 3};
3770    Spline(8) = {3, 5, 1};
3771    Line Loop(11) = {6, 7, 8};
3772    """
3773            self.failUnless(scrpt == ref )
3774    
3775          
3776       def test_generate_ReverseCurveLoop(self):
3777            d=GMSHDesign(dim=2, element_size=0.01)
3778            p0=Point(0,0,0,0.1)
3779            p1=Point(1,1,1,0.2)
3780            p2=Point(2,2,2,0.3)
3781            p3=Point(3,3,3,0.4)
3782            p4=Point(1,2,3)
3783    
3784            l01=Line(p0,p1)
3785            l12=Arc(p3,p1,p2)
3786            l20=Spline(p2,p4,p0)
3787    
3788            lx=Line(p2,p3)
3789            ly=Line(p3,p1)
3790    
3791            CC0=CurveLoop(l01,l20,l12)
3792            d.addItems(-CC0)
3793    
3794            scrpt=d.getScriptString()
3795            ref = \
3796    """// generated by esys.pycad
3797    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3798    Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3799    Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3800    Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3801    Point(5) = {1.0 , 2.0, 3.0 , 0.01 };
3802    Line(6) = {1, 2};
3803    Circle(7) = {2, 4, 3};
3804    Spline(8) = {3, 5, 1};
3805    Line Loop(11) = {6, 8, 7};
3806    """
3807            self.failUnless(scrpt == ref )
3808    
3809       def test_generate_RuledSurface(self):
3810            d=GMSHDesign(dim=2, element_size=0.01)
3811            p0=Point(0,0,0,0.1)
3812            p1=Point(1,1,1,0.2)
3813            p2=Point(2,2,2,0.3)
3814            p3=Point(3,3,3,0.4)
3815            p4=Point(1,2,3)
3816            p5=Point(10,20,3)
3817    
3818            l01=Line(p0,p1)
3819            l12_1=Arc(p3,p1,p2)
3820            l12_2_1=Spline(p1,p3,p4)
3821            l12_2_2=Spline(p4,p5,p2)
3822            l12_3=Line(p1,p2)
3823            l20=Spline(p2,p4,p0)
3824    
3825            cl1=CurveLoop(l01,l12_1,l20)
3826            cl2=CurveLoop(l01,l12_2_1,l12_2_2,l20)
3827            cl3=CurveLoop(l01,l12_3,l20)
3828    
3829            d.addItems(RuledSurface(cl1))
3830    
3831            scrpt=d.getScriptString()
3832            ref = \
3833    """// generated by esys.pycad
3834    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3835    Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3836    Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3837    Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3838    Point(5) = {1.0 , 2.0, 3.0 , 0.01 };
3839    Line(7) = {1, 2};
3840    Circle(8) = {2, 4, 3};
3841    Spline(12) = {3, 5, 1};
3842    Line Loop(13) = {7, 8, 12};
3843    Ruled Surface(16) = {13};
3844    """
3845            self.failUnless(scrpt == ref )
3846    
3847       def test_generate_ReverseRuledSurface(self):
3848            d=GMSHDesign(dim=2, element_size=0.01)
3849            p0=Point(0,0,0,0.1)
3850            p1=Point(1,1,1,0.2)
3851            p2=Point(2,2,2,0.3)
3852            p3=Point(3,3,3,0.4)
3853            p4=Point(1,2,3)
3854            p5=Point(10,20,3)
3855    
3856            l01=Line(p0,p1)
3857            l12_1=Arc(p3,p1,p2)
3858            l12_2_1=Spline(p1,p3,p4)
3859            l12_2_2=Spline(p4,p5,p2)
3860            l12_3=Line(p1,p2)
3861            l20=Spline(p2,p4,p0)
3862    
3863            cl1=CurveLoop(l01,l12_1,l20)
3864            cl2=CurveLoop(l01,l12_2_1,l12_2_2,l20)
3865            cl3=CurveLoop(l01,l12_3,l20)
3866    
3867            CC0=RuledSurface(cl1)
3868            d.addItems(-CC0)
3869    
3870            scrpt=d.getScriptString()
3871            ref = \
3872    """// generated by esys.pycad
3873    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3874    Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3875    Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3876    Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3877    Point(5) = {1.0 , 2.0, 3.0 , 0.01 };
3878    Line(7) = {1, 2};
3879    Circle(8) = {2, 4, 3};
3880    Spline(12) = {3, 5, 1};
3881    Line Loop(13) = {7, 8, 12};
3882    Ruled Surface(16) = {13};
3883    """
3884            self.failUnless(scrpt == ref )
3885    
3886       def test_generate_PlaneSurface(self):
3887            d=GMSHDesign(dim=2, element_size=0.01)
3888            p0=Point(0,0,0,0.1)
3889            p1=Point(10,0,0,0.2)
3890            p2=Point(10,10,0,0.3)
3891            p3=Point(0,10,3,0.4)
3892            p4=Point(5,5,0,0.001)
3893            p5=Point(7,5,0,0.001)
3894            p6=Point(5,7,0,0.001)
3895            p7=Point(8,8,0,0.001)
3896            p8=Point(9,9,0,0.001)
3897    
3898            l0=Line(p0,p1)
3899            l1=Line(p1,p2)
3900            l2=Line(p2,p3)
3901            l3=Line(p3,p0)
3902    
3903            l9=Line(p1,p8)
3904            l10=Line(p8,p3)
3905    
3906            l4=Line(p4,p5)
3907            l5=Line(p5,p6)
3908            l6=Line(p6,p4)
3909            l7=Line(p6,p7)
3910            l8=Line(p7,p4)
3911    
3912            a1=Arc(p4,p3,p1)
3913            a2=Arc(p7,p5,p6)
3914    
3915            cl=CurveLoop(l0,l1,l2,l3)
3916            h=CurveLoop(l4,l5,l6)
3917            cl_s=CurveLoop(l0,l9,l10,l3)
3918            h2=CurveLoop(l4,l5,l7,l8)
3919            cl_a=CurveLoop(a1,l1,l2)
3920            h_a=CurveLoop(a2,l6,l4)
3921    
3922            d.addItems(PlaneSurface(cl,holes=[h]))
3923    
3924            scrpt=d.getScriptString()
3925            ref = \
3926    """// generated by esys.pycad
3927    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3928    Point(2) = {10.0 , 0.0, 0.0 , 0.002 };
3929    Point(3) = {10.0 , 10.0, 0.0 , 0.003 };
3930    Point(4) = {0.0 , 10.0, 3.0 , 0.004 };
3931    Point(5) = {5.0 , 5.0, 0.0 , 1e-05 };
3932    Point(6) = {7.0 , 5.0, 0.0 , 1e-05 };
3933    Point(7) = {5.0 , 7.0, 0.0 , 1e-05 };
3934    Line(10) = {1, 2};
3935    Line(11) = {2, 3};
3936    Line(12) = {3, 4};
3937    Line(13) = {4, 1};
3938    Line(16) = {5, 6};
3939    Line(17) = {6, 7};
3940    Line(18) = {7, 5};
3941    Line Loop(23) = {10, 11, 12, 13};
3942    Line Loop(24) = {16, 17, 18};
3943    Plane Surface(29) = {23, 24};
3944    """
3945            self.failUnless(scrpt == ref )
3946    
3947       def test_generate_SurfaceLoop(self):
3948            d=GMSHDesign(dim=3, element_size=0.01)
3949            p0=Point( 0, 0, 0,0.1)
3950            p1=Point(10, 0, 0,0.1)
3951            p2=Point( 0,10, 0,0.1)
3952            p3=Point(10,10, 0,0.1)
3953            p4=Point( 0, 0,10,0.1)
3954            p5=Point(10, 0,10,0.1)
3955            p6=Point( 0,10,10,0.1)
3956            p7=Point(10,10,10,0.1)
3957    
3958            q0=Point( 4, 0, 4,0.1)
3959            q1=Point( 6, 0, 4,0.1)
3960            q2=Point( 4,10, 4,0.1)
3961            q3=Point( 6,10, 4,0.1)
3962            q4=Point( 4, 0, 6,0.1)
3963            q5=Point( 6, 0, 6,0.1)
3964            q6=Point( 4,10, 6,0.1)
3965            q7=Point( 6,10, 6,0.1)
3966    
3967            l01=Line(p0,p1)
3968            l15=Line(p1,p5)
3969            l54=Line(p5,p4)
3970            l04=Line(p4,p0)
3971    
3972            l13=Line(p1,p3)
3973            l37=Line(p3,p7)
3974            l75=Line(p7,p5)
3975            l67=Line(p6,p7)
3976            l26=Line(p2,p6)
3977            l32=Line(p3,p2)
3978            l20=Line(p2,p0)
3979            l46=Line(p4,p6)
3980    
3981            m01=Line(q0,q1)
3982            m15=Line(q1,q5)
3983            m54=Line(q5,q4)
3984            m40=Line(q4,q0)
3985            m23=Line(q2,q3)
3986            m37=Line(q3,q7)
3987            m76=Line(q7,q6)
3988            m62=Line(q6,q2)
3989    
3990            m02=Line(q0,q2)
3991            m13=Line(q1,q3)
3992            m46=Line(q4,q6)
3993            m57=Line(q5,q7)
3994    
3995            cl_l1=CurveLoop(l01,l15,l54,l04)
3996            cl_m1=CurveLoop(m01,m15,m54,m40)
3997            s1=PlaneSurface(cl_l1,holes=[cl_m1])
3998            s1_v=PlaneSurface(cl_l1)
3999    
4000            cl_l2=CurveLoop(-l15,l13,l37,l75)
4001            s2=PlaneSurface(cl_l2)
4002    
4003            cl_l3=CurveLoop(l32,-l37,l67,l26)
4004            cl_m3=CurveLoop(-m23,-m37,-m76,-m62)
4005            s3=PlaneSurface(cl_l3,holes=[cl_m3])
4006            s3_v=PlaneSurface(cl_l3)
4007        
4008        
4009            cl_l4=CurveLoop(l20,-l26,l46,-l04)
4010            s4=PlaneSurface(cl_l4)
4011    
4012            cl_l5=CurveLoop(l32,l20,l01,l13)
4013            s5=PlaneSurface(-cl_l5)
4014    
4015            cl_l6=CurveLoop(l67,l75,l54,l46)
4016            s6=PlaneSurface(-cl_l6)
4017    
4018            cl_m7=CurveLoop(m13,m37,-m57,-m15)
4019            s7=PlaneSurface(cl_m7)
4020            
4021            cl_m8=CurveLoop(m57,m76,-m46,-m54)
4022            s8=PlaneSurface(cl_m8)
4023    
4024            cl_m9=CurveLoop(m46,m62,-m02,-m40)
4025            s9=PlaneSurface(cl_m9)
4026    
4027            cl_m10=CurveLoop(-m01,m02,m23,-m13)
4028            s10=PlaneSurface(cl_m10)
4029    
4030            d.addItems(SurfaceLoop(s1,s2,s3,s4,s5,s6,-s7,-s8,-s9,-s10))
4031    
4032            scrpt=d.getScriptString()
4033            ref = \
4034    """// generated by esys.pycad
4035    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
4036    Point(2) = {10.0 , 0.0, 0.0 , 0.001 };
4037    Point(3) = {0.0 , 10.0, 0.0 , 0.001 };
4038    Point(4) = {10.0 , 10.0, 0.0 , 0.001 };
4039    Point(5) = {0.0 , 0.0, 10.0 , 0.001 };
4040    Point(6) = {10.0 , 0.0, 10.0 , 0.001 };
4041    Point(7) = {0.0 , 10.0, 10.0 , 0.001 };
4042    Point(8) = {10.0 , 10.0, 10.0 , 0.001 };
4043    Point(9) = {4.0 , 0.0, 4.0 , 0.001 };
4044    Point(10) = {6.0 , 0.0, 4.0 , 0.001 };
4045    Point(11) = {4.0 , 10.0, 4.0 , 0.001 };
4046    Point(12) = {6.0 , 10.0, 4.0 , 0.001 };
4047    Point(13) = {4.0 , 0.0, 6.0 , 0.001 };
4048    Point(14) = {6.0 , 0.0, 6.0 , 0.001 };
4049    Point(15) = {4.0 , 10.0, 6.0 , 0.001 };
4050    Point(16) = {6.0 , 10.0, 6.0 , 0.001 };
4051    Line(17) = {1, 2};
4052    Line(18) = {2, 6};
4053    Line(19) = {6, 5};
4054    Line(20) = {5, 1};
4055    Line(21) = {2, 4};
4056    Line(22) = {4, 8};
4057    Line(23) = {8, 6};
4058    Line(24) = {7, 8};
4059    Line(25) = {3, 7};
4060    Line(26) = {4, 3};
4061    Line(27) = {3, 1};
4062    Line(28) = {5, 7};
4063    Line(29) = {9, 10};
4064    Line(30) = {10, 14};
4065    Line(31) = {14, 13};
4066    Line(32) = {13, 9};
4067    Line(33) = {11, 12};
4068    Line(34) = {12, 16};
4069    Line(35) = {16, 15};
4070    Line(36) = {15, 11};
4071    Line(37) = {9, 11};
4072    Line(38) = {10, 12};
4073    Line(39) = {13, 15};
4074    Line(40) = {14, 16};
4075    Line Loop(41) = {17, 18, 19, 20};
4076    Line Loop(42) = {29, 30, 31, 32};
4077    Plane Surface(43) = {41, 42};
4078    Line Loop(45) = {-18, 21, 22, 23};
4079    Plane Surface(46) = {45};
4080    Line Loop(47) = {26, -22, 24, 25};
4081    Line Loop(48) = {-33, -34, -35, -36};
4082    Plane Surface(49) = {47, 48};
4083    Line Loop(51) = {27, -25, 28, -20};
4084    Plane Surface(52) = {51};
4085    Line Loop(53) = {26, 27, 17, 21};
4086    Plane Surface(54) = {-53};
4087    Line Loop(55) = {24, 23, 19, 28};
4088    Plane Surface(56) = {-55};
4089    Line Loop(57) = {38, 34, -40, -30};
4090    Plane Surface(58) = {57};
4091    Line Loop(59) = {40, 35, -39, -31};
4092    Plane Surface(60) = {59};
4093    Line Loop(61) = {39, 36, -37, -32};
4094    Plane Surface(62) = {61};
4095    Line Loop(63) = {-29, 37, 33, -38};
4096    Plane Surface(64) = {63};
4097    Surface Loop(65) = {43, 46, 49, 52, 54, 56, -58, -60, -62, -64};
4098    """
4099            self.failUnless(scrpt == ref )
4100    
4101       def test_generate_ReverseSurfaceLoop(self):
4102            d=GMSHDesign(dim=3, element_size=0.01)
4103            p0=Point( 0, 0, 0,0.1)
4104            p1=Point(10, 0, 0,0.1)
4105            p2=Point( 0,10, 0,0.1)
4106            p3=Point(10,10, 0,0.1)
4107            p4=Point( 0, 0,10,0.1)
4108            p5=Point(10, 0,10,0.1)
4109            p6=Point( 0,10,10,0.1)
4110            p7=Point(10,10,10,0.1)
4111    
4112            q0=Point( 4, 0, 4,0.1)
4113            q1=Point( 6, 0, 4,0.1)
4114            q2=Point( 4,10, 4,0.1)
4115            q3=Point( 6,10, 4,0.1)
4116            q4=Point( 4, 0, 6,0.1)
4117            q5=Point( 6, 0, 6,0.1)
4118            q6=Point( 4,10, 6,0.1)
4119            q7=Point( 6,10, 6,0.1)
4120    
4121            l01=Line(p0,p1)
4122            l15=Line(p1,p5)
4123            l54=Line(p5,p4)
4124            l04=Line(p4,p0)
4125    
4126            l13=Line(p1,p3)
4127            l37=Line(p3,p7)
4128            l75=Line(p7,p5)
4129            l67=Line(p6,p7)
4130            l26=Line(p2,p6)
4131            l32=Line(p3,p2)
4132            l20=Line(p2,p0)
4133            l46=Line(p4,p6)
4134    
4135            m01=Line(q0,q1)
4136            m15=Line(q1,q5)
4137            m54=Line(q5,q4)
4138            m40=Line(q4,q0)
4139            m23=Line(q2,q3)
4140            m37=Line(q3,q7)
4141            m76=Line(q7,q6)
4142            m62=Line(q6,q2)
4143    
4144            m02=Line(q0,q2)
4145            m13=Line(q1,q3)
4146            m46=Line(q4,q6)
4147            m57=Line(q5,q7)
4148    
4149            cl_l1=CurveLoop(l01,l15,l54,l04)
4150            cl_m1=CurveLoop(m01,m15,m54,m40)
4151            s1=PlaneSurface(cl_l1,holes=[cl_m1])
4152            s1_v=PlaneSurface(cl_l1)
4153    
4154            cl_l2=CurveLoop(-l15,l13,l37,l75)
4155            s2=PlaneSurface(cl_l2)
4156    
4157            cl_l3=CurveLoop(l32,-l37,l67,l26)
4158            cl_m3=CurveLoop(-m23,-m37,-m76,-m62)
4159            s3=PlaneSurface(cl_l3,holes=[cl_m3])
4160            s3_v=PlaneSurface(cl_l3)
4161        
4162        
4163            cl_l4=CurveLoop(l20,-l26,l46,-l04)
4164            s4=PlaneSurface(cl_l4)
4165    
4166            cl_l5=CurveLoop(l32,l20,l01,l13)
4167            s5=PlaneSurface(-cl_l5)
4168    
4169            cl_l6=CurveLoop(l67,l75,l54,l46)
4170            s6=PlaneSurface(-cl_l6)
4171    
4172            cl_m7=CurveLoop(m13,m37,-m57,-m15)
4173            s7=PlaneSurface(cl_m7)
4174            
4175            cl_m8=CurveLoop(m57,m76,-m46,-m54)
4176            s8=PlaneSurface(cl_m8)
4177    
4178            cl_m9=CurveLoop(m46,m62,-m02,-m40)
4179            s9=PlaneSurface(cl_m9)
4180    
4181            cl_m10=CurveLoop(-m01,m02,m23,-m13)
4182            s10=PlaneSurface(cl_m10)
4183    
4184            CC0=SurfaceLoop(s1,s2,s3,s4,s5,s6,-s7,-s8,-s9,-s10)
4185            s=-CC0
4186            d.addItems(-CC0)
4187    
4188            scrpt=d.getScriptString()
4189            ref = \
4190    """// generated by esys.pycad
4191    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
4192    Point(2) = {10.0 , 0.0, 0.0 , 0.001 };
4193    Point(3) = {0.0 , 10.0, 0.0 , 0.001 };
4194    Point(4) = {10.0 , 10.0, 0.0 , 0.001 };
4195    Point(5) = {0.0 , 0.0, 10.0 , 0.001 };
4196    Point(6) = {10.0 , 0.0, 10.0 , 0.001 };
4197    Point(7) = {0.0 , 10.0, 10.0 , 0.001 };
4198    Point(8) = {10.0 , 10.0, 10.0 , 0.001 };
4199    Point(9) = {4.0 , 0.0, 4.0 , 0.001 };
4200    Point(10) = {6.0 , 0.0, 4.0 , 0.001 };
4201    Point(11) = {4.0 , 10.0, 4.0 , 0.001 };
4202    Point(12) = {6.0 , 10.0, 4.0 , 0.001 };
4203    Point(13) = {4.0 , 0.0, 6.0 , 0.001 };
4204    Point(14) = {6.0 , 0.0, 6.0 , 0.001 };
4205    Point(15) = {4.0 , 10.0, 6.0 , 0.001 };
4206    Point(16) = {6.0 , 10.0, 6.0 , 0.001 };
4207    Line(17) = {1, 2};
4208    Line(18) = {2, 6};
4209    Line(19) = {6, 5};
4210    Line(20) = {5, 1};
4211    Line(21) = {2, 4};
4212    Line(22) = {4, 8};
4213    Line(23) = {8, 6};
4214    Line(24) = {7, 8};
4215    Line(25) = {3, 7};
4216    Line(26) = {4, 3};
4217    Line(27) = {3, 1};
4218    Line(28) = {5, 7};
4219    Line(29) = {9, 10};
4220    Line(30) = {10, 14};
4221    Line(31) = {14, 13};
4222    Line(32) = {13, 9};
4223    Line(33) = {11, 12};
4224    Line(34) = {12, 16};
4225    Line(35) = {16, 15};
4226    Line(36) = {15, 11};
4227    Line(37) = {9, 11};
4228    Line(38) = {10, 12};
4229    Line(39) = {13, 15};
4230    Line(40) = {14, 16};
4231    Line Loop(41) = {17, 18, 19, 20};
4232    Line Loop(42) = {29, 30, 31, 32};
4233    Plane Surface(43) = {41, 42};
4234    Line Loop(45) = {-18, 21, 22, 23};
4235    Plane Surface(46) = {45};
4236    Line Loop(47) = {26, -22, 24, 25};
4237    Line Loop(48) = {-33, -34, -35, -36};
4238    Plane Surface(49) = {47, 48};
4239    Line Loop(51) = {27, -25, 28, -20};
4240    Plane Surface(52) = {51};
4241    Line Loop(53) = {26, 27, 17, 21};
4242    Plane Surface(54) = {-53};
4243    Line Loop(55) = {24, 23, 19, 28};
4244    Plane Surface(56) = {-55};
4245    Line Loop(57) = {38, 34, -40, -30};
4246    Plane Surface(58) = {57};
4247    Line Loop(59) = {40, 35, -39, -31};
4248    Plane Surface(60) = {59};
4249    Line Loop(61) = {39, 36, -37, -32};
4250    Plane Surface(62) = {61};
4251    Line Loop(63) = {-29, 37, 33, -38};
4252    Plane Surface(64) = {63};
4253    Surface Loop(65) = {43, 46, 49, 52, 54, 56, -58, -60, -62, -64};
4254    """
4255            self.failUnless(scrpt == ref )
4256    
4257       def test_generate_Volume(self):
4258            d=GMSHDesign(dim=3, element_size=0.01)
4259            p0=Point(-2,-2,-2,0.1)
4260            p1=Point(2,-2,-2,0.1)
4261            p2=Point(-2,2,-2,0.1)
4262            p3=Point(2,2,-2,0.1)
4263            p4=Point(-2,-2,2,0.1)
4264            p5=Point(2,-2,2,0.1)
4265            p6=Point(-2,2,2,0.1)
4266            p7=Point(2,2,2,0.1)
4267            l01=Line(p0,p1)
4268            l15=Line(p1,p5)
4269            l54=Line(p5,p4)
4270            l40=Line(p4,p0)
4271            l23=Line(p2,p3)
4272            l37=Line(p3,p7)
4273            l76=Line(p7,p6)
4274            l62=Line(p6,p2)
4275            l13=Line(p1,p3)
4276            l57=Line(p5,p7)
4277            l02=Line(p0,p2)
4278            l46=Line(p4,p6)
4279            cl1=CurveLoop(l01,l15,l54,l40)
4280            s1=PlaneSurface(cl1)
4281            cl2=CurveLoop(l23,l37,l76,l62)
4282            s2=PlaneSurface(-cl2)
4283            cl3=CurveLoop(l13,l37,-l57,-l15)
4284            s3=PlaneSurface(cl3)
4285            cl4=CurveLoop(l46,l62,-l02,-l40)
4286            s4=PlaneSurface(-cl4)
4287            cl5=CurveLoop(-l01,l02,l23,-l13)
4288            s5=PlaneSurface(-cl5)
4289            cl6=CurveLoop(-l54,l57,l76,-l46)
4290            s6=PlaneSurface(-cl6)
4291            s_out=SurfaceLoop(s1,s2,s3,s4,s5,s6)
4292    
4293            p0_i=Point(-1,-1,-1,0.1)
4294            p1_i=Point(1,-1,-1,0.1)
4295            p2_i=Point(-1,1,-1,0.1)
4296            p3_i=Point(1,1,-1,0.1)
4297            p4_i=Point(-1,-1,1,0.1)
4298            p5_i=Point(1,-1,1,0.1)
4299            p6_i=Point(-1,1,1,0.1)
4300            p7_i=Point(1,1,1,0.1)
4301            l01_i=Line(p0_i,p1_i)
4302            l15_i=Line(p1_i,p5_i)
4303            l54_i=Line(p5_i,p4_i)
4304            l40_i=Line(p4_i,p0_i)
4305            l23_i=Line(p2_i,p3_i)
4306            l37_i=Line(p3_i,p7_i)
4307            l76_i=Line(p7_i,p6_i)
4308            l62_i=Line(p6_i,p2_i)
4309            l13_i=Line(p1_i,p3_i)
4310            l57_i=Line(p5_i,p7_i)
4311            l02_i=Line(p0_i,p2_i)
4312            l46_i=Line(p4_i,p6_i)
4313            cl1_i=CurveLoop(l01_i,l15_i,l54_i,l40_i)
4314            s1_i=PlaneSurface(cl1_i)
4315            cl2_i=CurveLoop(l23_i,l37_i,l76_i,l62_i)
4316            s2_i=PlaneSurface(-cl2_i)
4317            cl3_i=CurveLoop(l13_i,l37_i,-l57_i,-l15_i)
4318            s3_i=PlaneSurface(cl3_i)
4319            cl4_i=CurveLoop(l46_i,l62_i,-l02_i,-l40_i)
4320            s4_i=PlaneSurface(-cl4_i)
4321            cl5_i=CurveLoop(-l01_i,l02_i,l23_i,-l13_i)
4322            s5_i=PlaneSurface(-cl5_i)
4323            cl6_i=CurveLoop(-l54_i,l57_i,l76_i,-l46_i)
4324            s6_i=PlaneSurface(-cl6_i)
4325            s_inner=SurfaceLoop(s1_i,s2_i,s3_i,s4_i,s5_i,s6_i)
4326    
4327            d.addItems(Volume(s_out,holes=[s_inner]))
4328    
4329            scrpt=d.getScriptString();
4330            ref = \
4331    """// generated by esys.pycad
4332    Point(1) = {-2.0 , -2.0, -2.0 , 0.001 };
4333    Point(2) = {2.0 , -2.0, -2.0 , 0.001 };
4334    Point(3) = {-2.0 , 2.0, -2.0 , 0.001 };
4335    Point(4) = {2.0 , 2.0, -2.0 , 0.001 };
4336    Point(5) = {-2.0 , -2.0, 2.0 , 0.001 };
4337    Point(6) = {2.0 , -2.0, 2.0 , 0.001 };
4338    Point(7) = {-2.0 , 2.0, 2.0 , 0.001 };
4339    Point(8) = {2.0 , 2.0, 2.0 , 0.001 };
4340    Line(9) = {1, 2};
4341    Line(10) = {2, 6};
4342    Line(11) = {6, 5};
4343    Line(12) = {5, 1};
4344    Line(13) = {3, 4};
4345    Line(14) = {4, 8};
4346    Line(15) = {8, 7};
4347    Line(16) = {7, 3};
4348    Line(17) = {2, 4};
4349    Line(18) = {6, 8};
4350    Line(19) = {1, 3};
4351    Line(20) = {5, 7};
4352    Line Loop(21) = {9, 10, 11, 12};
4353    Plane Surface(22) = {21};
4354    Line Loop(23) = {13, 14, 15, 16};
4355    Plane Surface(24) = {-23};
4356    Line Loop(25) = {17, 14, -18, -10};
4357    Plane Surface(26) = {25};
4358    Line Loop(27) = {20, 16, -19, -12};
4359    Plane Surface(28) = {-27};
4360    Line Loop(29) = {-9, 19, 13, -17};
4361    Plane Surface(30) = {-29};
4362    Line Loop(31) = {-11, 18, 15, -20};
4363    Plane Surface(32) = {-31};
4364    Surface Loop(33) = {22, 24, 26, 28, 30, 32};
4365    Point(34) = {-1.0 , -1.0, -1.0 , 0.001 };
4366    Point(35) = {1.0 , -1.0, -1.0 , 0.001 };
4367    Point(36) = {-1.0 , 1.0, -1.0 , 0.001 };
4368    Point(37) = {1.0 , 1.0, -1.0 , 0.001 };
4369    Point(38) = {-1.0 , -1.0, 1.0 , 0.001 };
4370    Point(39) = {1.0 , -1.0, 1.0 , 0.001 };
4371    Point(40) = {-1.0 , 1.0, 1.0 , 0.001 };
4372    Point(41) = {1.0 , 1.0, 1.0 , 0.001 };
4373    Line(42) = {34, 35};
4374    Line(43) = {35, 39};
4375    Line(44) = {39, 38};
4376    Line(45) = {38, 34};
4377    Line(46) = {36, 37};
4378    Line(47) = {37, 41};
4379    Line(48) = {41, 40};
4380    Line(49) = {40, 36};
4381    Line(50) = {35, 37};
4382    Line(51) = {39, 41};
4383    Line(52) = {34, 36};
4384    Line(53) = {38, 40};
4385    Line Loop(54) = {42, 43, 44, 45};
4386    Plane Surface(55) = {54};
4387    Line Loop(56) = {46, 47, 48, 49};
4388    Plane Surface(57) = {-56};
4389    Line Loop(58) = {50, 47, -51, -43};
4390    Plane Surface(59) = {58};
4391    Line Loop(60) = {53, 49, -52, -45};
4392    Plane Surface(61) = {-60};
4393    Line Loop(62) = {-42, 52, 46, -50};
4394    Plane Surface(63) = {-62};
4395    Line Loop(64) = {-44, 51, 48, -53};
4396    Plane Surface(65) = {-64};
4397    Surface Loop(66) = {55, 57, 59, 61, 63, 65};
4398    Volume(67) = {33, 66};
4399    """
4400            self.failUnless(scrpt == ref )
4401    
4402       def test_generate_PropertySet0D(self):
4403           d=GMSHDesign(dim=2, element_size=0.01)
4404           p0=Point(1.,2.,3.,local_scale=9.)
4405           p1=Point(0.,0.,0.,local_scale=9.)
4406           p3=Point(8.,6,6,local_scale=9.)
4407           p4=Point(8.,6,-6,local_scale=9.)
4408                
4409           d.addItems(PropertySet("test0",p0, p1, p3, p4))
4410    
4411           scrpt=d.getScriptString()
4412           ref = \
4413    """// generated by esys.pycad
4414    Point(1) = {1.0 , 2.0, 3.0 , 0.09 };
4415    Point(2) = {0.0 , 0.0, 0.0 , 0.09 };
4416    Point(3) = {8.0 , 6.0, 6.0 , 0.09 };
4417    Point(4) = {8.0 , 6.0, -6.0 , 0.09 };
4418    Physical Point(5) = {1, 2, 3, 4};
4419    """
4420           self.failUnless(scrpt == ref )
4421          
4422       def test_generate_PropertySet1D(self):
4423           d=GMSHDesign(dim=2, element_size=0.01)
4424           p0=Point(1.,2.,3.,local_scale=9.)
4425           p1=Point(0.,0.,0.,local_scale=9.)
4426           p3=Point(8.,6,6,local_scale=9.)
4427           p4=Point(8.,6,-6,local_scale=9.)
4428          
4429           l0=Line(p0,p1)
4430           l1=Arc(p3,p1,p4)
4431           l2=Line(p4,p0)
4432    
4433           d.addItems(PropertySet("test0", l0, l1, l2))
4434    
4435           scrpt=d.getScriptString()
4436           ref = \
4437    """// generated by esys.pycad
4438    Point(1) = {1.0 , 2.0, 3.0 , 0.09 };
4439    Point(2) = {0.0 , 0.0, 0.0 , 0.09 };
4440    Point(3) = {8.0 , 6.0, 6.0 , 0.09 };
4441    Point(4) = {8.0 , 6.0, -6.0 , 0.09 };
4442    Line(5) = {1, 2};
4443    Circle(6) = {2, 3, 4};
4444    Line(7) = {4, 1};
4445    Physical Line(8) = {5, 6, 7};
4446    """
4447           self.failUnless(scrpt == ref )
4448    
4449       def test_generate_PropertySet2D(self):
4450           d=GMSHDesign(dim=2, element_size=0.01)
4451           p0=Point(0,0,0,0.1)
4452           p1=Point(10,0,0,0.2)
4453           p2=Point(10,10,0,0.3)
4454           p3=Point(0,10,3,0.4)
4455           p4=Point(5,5,0,0.001)
4456           p5=Point(7,5,0,0.001)
4457           p6=Point(5,7,0,0.001)
4458    
4459           l0=Line(p0,p1)
4460           l1=Line(p1,p2)
4461           l2=Line(p2,p3)
4462           l3=Line(p3,p0)
4463    
4464           l4=Line(p4,p5)
4465           l5=Line(p5,p6)
4466           l6=Line(p6,p4)
4467    
4468           cl=CurveLoop(l0,l1,l2,l3)
4469           h=CurveLoop(l4,l5,l6)
4470    
4471           s=PlaneSurface(cl,holes=[h])
4472    
4473           d.addItems(PropertySet("test0", s))
4474    
4475           scrpt=d.getScriptString()
4476           ref = \
4477    """// generated by esys.pycad
4478    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
4479    Point(2) = {10.0 , 0.0, 0.0 , 0.002 };
4480    Point(3) = {10.0 , 10.0, 0.0 , 0.003 };
4481    Point(4) = {0.0 , 10.0, 3.0 , 0.004 };
4482    Point(5) = {5.0 , 5.0, 0.0 , 1e-05 };
4483    Point(6) = {7.0 , 5.0, 0.0 , 1e-05 };
4484    Point(7) = {5.0 , 7.0, 0.0 , 1e-05 };
4485    Line(8) = {1, 2};
4486    Line(9) = {2, 3};
4487    Line(10) = {3, 4};
4488    Line(11) = {4, 1};
4489    Line(12) = {5, 6};
4490    Line(13) = {6, 7};
4491    Line(14) = {7, 5};
4492    Line Loop(15) = {8, 9, 10, 11};
4493    Line Loop(16) = {12, 13, 14};
4494    Plane Surface(17) = {15, 16};
4495    Physical Surface(18) = {17};
4496    """
4497           self.failUnless(scrpt == ref )
4498    
4499       def test_generate_PropertySet3D(self):
4500           d=GMSHDesign(dim=3, element_size=0.01)
4501           p0=Point(-2,-2,-2,0.1)
4502           p1=Point(2,-2,-2,0.1)
4503           p2=Point(-2,2,-2,0.1)
4504           p3=Point(2,2,-2,0.1)
4505           p4=Point(-2,-2,2,0.1)
4506           p5=Point(2,-2,2,0.1)
4507           p6=Point(-2,2,2,0.1)
4508           p7=Point(2,2,2,0.1)
4509           l01=Line(p0,p1)
4510           l15=Line(p1,p5)
4511           l54=Line(p5,p4)
4512           l40=Line(p4,p0)
4513           l23=Line(p2,p3)
4514           l37=Line(p3,p7)
4515           l76=Line(p7,p6)
4516           l62=Line(p6,p2)
4517           l13=Line(p1,p3)
4518           l57=Line(p5,p7)
4519           l02=Line(p0,p2)
4520           l46=Line(p4,p6)
4521           cl1=CurveLoop(l01,l15,l54,l40)
4522           s1=PlaneSurface(cl1)
4523           cl2=CurveLoop(l23,l37,l76,l62)
4524           s2=PlaneSurface(-cl2)
4525           cl3=CurveLoop(l13,l37,-l57,-l15)
4526           s3=PlaneSurface(cl3)
4527           cl4=CurveLoop(l46,l62,-l02,-l40)
4528           s4=PlaneSurface(-cl4)
4529           cl5=CurveLoop(-l01,l02,l23,-l13)
4530           s5=PlaneSurface(-cl5)
4531           cl6=CurveLoop(-l54,l57,l76,-l46)
4532           s6=PlaneSurface(-cl6)
4533           s_out=SurfaceLoop(s1,s2,s3,s4,s5,s6)
4534    
4535           p0_i=Point(-1,-1,-1,0.1)
4536           p1_i=Point(1,-1,-1,0.1)
4537           p2_i=Point(-1,1,-1,0.1)
4538           p3_i=Point(1,1,-1,0.1)
4539           p4_i=Point(-1,-1,1,0.1)
4540           p5_i=Point(1,-1,1,0.1)
4541           p6_i=Point(-1,1,1,0.1)
4542           p7_i=Point(1,1,1,0.1)
4543           l01_i=Line(p0_i,p1_i)
4544           l15_i=Line(p1_i,p5_i)
4545           l54_i=Line(p5_i,p4_i)
4546           l40_i=Line(p4_i,p0_i)
4547           l23_i=Line(p2_i,p3_i)
4548           l37_i=Line(p3_i,p7_i)
4549           l76_i=Line(p7_i,p6_i)
4550           l62_i=Line(p6_i,p2_i)
4551           l13_i=Line(p1_i,p3_i)
4552           l57_i=Line(p5_i,p7_i)
4553           l02_i=Line(p0_i,p2_i)
4554           l46_i=Line(p4_i,p6_i)
4555           cl1_i=CurveLoop(l01_i,l15_i,l54_i,l40_i)
4556           s1_i=PlaneSurface(cl1_i)
4557           cl2_i=CurveLoop(l23_i,l37_i,l76_i,l62_i)
4558           s2_i=PlaneSurface(-cl2_i)
4559           cl3_i=CurveLoop(l13_i,l37_i,-l57_i,-l15_i)
4560           s3_i=PlaneSurface(cl3_i)
4561           cl4_i=CurveLoop(l46_i,l62_i,-l02_i,-l40_i)
4562           s4_i=PlaneSurface(-cl4_i)
4563           cl5_i=CurveLoop(-l01_i,l02_i,l23_i,-l13_i)
4564           s5_i=PlaneSurface(-cl5_i)
4565           cl6_i=CurveLoop(-l54_i,l57_i,l76_i,-l46_i)
4566           s6_i=PlaneSurface(-cl6_i)
4567           s_inner=SurfaceLoop(s1_i,s2_i,s3_i,s4_i,s5_i,s6_i)
4568    
4569           v=Volume(s_out,holes=[s_inner])
4570           d.addItems(PropertySet("test0", v))
4571          
4572           scrpt=d.getScriptString()
4573           ref = \
4574    """// generated by esys.pycad
4575    Point(1) = {-2.0 , -2.0, -2.0 , 0.001 };
4576    Point(2) = {2.0 , -2.0, -2.0 , 0.001 };
4577    Point(3) = {-2.0 , 2.0, -2.0 , 0.001 };
4578    Point(4) = {2.0 , 2.0, -2.0 , 0.001 };
4579    Point(5) = {-2.0 , -2.0, 2.0 , 0.001 };
4580    Point(6) = {2.0 , -2.0, 2.0 , 0.001 };
4581    Point(7) = {-2.0 , 2.0, 2.0 , 0.001 };
4582    Point(8) = {2.0 , 2.0, 2.0 , 0.001 };
4583    Line(9) = {1, 2};
4584    Line(10) = {2, 6};
4585    Line(11) = {6, 5};
4586    Line(12) = {5, 1};
4587    Line(13) = {3, 4};
4588    Line(14) = {4, 8};
4589    Line(15) = {8, 7};
4590    Line(16) = {7, 3};
4591    Line(17) = {2, 4};
4592    Line(18) = {6, 8};
4593    Line(19) = {1, 3};
4594    Line(20) = {5, 7};
4595    Line Loop(21) = {9, 10, 11, 12};
4596    Plane Surface(22) = {21};
4597    Line Loop(23) = {13, 14, 15, 16};
4598    Plane Surface(24) = {-23};
4599    Line Loop(25) = {17, 14, -18, -10};
4600    Plane Surface(26) = {25};
4601    Line Loop(27) = {20, 16, -19, -12};
4602    Plane Surface(28) = {-27};
4603    Line Loop(29) = {-9, 19, 13, -17};
4604    Plane Surface(30) = {-29};
4605    Line Loop(31) = {-11, 18, 15, -20};
4606    Plane Surface(32) = {-31};
4607    Surface Loop(33) = {22, 24, 26, 28, 30, 32};
4608    Point(34) = {-1.0 , -1.0, -1.0 , 0.001 };
4609    Point(35) = {1.0 , -1.0, -1.0 , 0.001 };
4610    Point(36) = {-1.0 , 1.0, -1.0 , 0.001 };
4611    Point(37) = {1.0 , 1.0, -1.0 , 0.001 };
4612    Point(38) = {-1.0 , -1.0, 1.0 , 0.001 };
4613    Point(39) = {1.0 , -1.0, 1.0 , 0.001 };
4614    Point(40) = {-1.0 , 1.0, 1.0 , 0.001 };
4615    Point(41) = {1.0 , 1.0, 1.0 , 0.001 };
4616    Line(42) = {34, 35};
4617    Line(43) = {35, 39};
4618    Line(44) = {39, 38};
4619    Line(45) = {38, 34};
4620    Line(46) = {36, 37};
4621    Line(47) = {37, 41};
4622    Line(48) = {41, 40};
4623    Line(49) = {40, 36};
4624    Line(50) = {35, 37};
4625    Line(51) = {39, 41};
4626    Line(52) = {34, 36};
4627    Line(53) = {38, 40};
4628    Line Loop(54) = {42, 43, 44, 45};
4629    Plane Surface(55) = {54};
4630    Line Loop(56) = {46, 47, 48, 49};
4631    Plane Surface(57) = {-56};
4632    Line Loop(58) = {50, 47, -51, -43};
4633    Plane Surface(59) = {58};
4634    Line Loop(60) = {53, 49, -52, -45};
4635    Plane Surface(61) = {-60};
4636    Line Loop(62) = {-42, 52, 46, -50};
4637    Plane Surface(63) = {-62};
4638    Line Loop(64) = {-44, 51, 48, -53};
4639    Plane Surface(65) = {-64};
4640    Surface Loop(66) = {55, 57, 59, 61, 63, 65};
4641    Volume(67) = {33, 66};
4642    Physical Volume(68) = {67};
4643    """
4644           self.failUnless(scrpt == ref )
4645    
4646  if __name__ == '__main__':  if __name__ == '__main__':
4647     suite = unittest.TestSuite()     suite = unittest.TestSuite()

Legend:
Removed from v.1044  
changed lines
  Added in v.1045

  ViewVC Help
Powered by ViewVC 1.1.26