/[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 1904 by ksteube, Thu Sep 25 06:43:44 2008 UTC revision 1905 by phornby, Wed Oct 22 08:40:05 2008 UTC
# Line 3779  Point(1) = {1.0 , 2.0, 3.0 , 0.09 }; Line 3779  Point(1) = {1.0 , 2.0, 3.0 , 0.09 };
3779        
3780    
3781     def test_generate_Spline(self):     def test_generate_Spline(self):
3782          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
3783          p0=Point(0,0,0,0.1)         p0=Point(0,0,0,0.1)
3784          p1=Point(1,1,1,0.2)         p1=Point(1,1,1,0.2)
3785          p2=Point(2,2,2,0.3)         p2=Point(2,2,2,0.3)
3786          p3=Point(3,3,3,0.4)         p3=Point(3,3,3,0.4)
3787    
3788          d.addItems(Spline(p0,p1,p2,p3))         d.addItems(Spline(p0,p1,p2,p3))
3789    
3790          scrpt=d.getScriptString()         scrpt=d.getScriptString()
3791          ref = \         ref = \
3792  """// generated by esys.pycad  """// generated by esys.pycad
3793  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3794  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
# Line 3796  Point(3) = {2.0 , 2.0, 2.0 , 0.003 }; Line 3796  Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3796  Point(4) = {3.0 , 3.0, 3.0 , 0.004 };  Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3797  Spline(5) = {1, 2, 3, 4};  Spline(5) = {1, 2, 3, 4};
3798  """  """
3799          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
3800    
3801     def test_generate_ReverseSpline(self):     def test_generate_ReverseSpline(self):
3802          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
3803          p0=Point(0,0,0,0.1)         p0=Point(0,0,0,0.1)
3804          p1=Point(1,1,1,0.2)         p1=Point(1,1,1,0.2)
3805          p2=Point(2,2,2,0.3)         p2=Point(2,2,2,0.3)
3806          p3=Point(3,3,3,0.4)         p3=Point(3,3,3,0.4)
3807    
3808          CC0=Spline(p0,p1,p2,p3)         CC0=Spline(p0,p1,p2,p3)
3809          d.addItems(-CC0)         d.addItems(-CC0)
3810    
3811          scrpt=d.getScriptString()         scrpt=d.getScriptString()
3812          ref = \         ref = \
3813  """// generated by esys.pycad  """// generated by esys.pycad
3814  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3815  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
# Line 3817  Point(3) = {2.0 , 2.0, 2.0 , 0.003 }; Line 3817  Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3817  Point(4) = {3.0 , 3.0, 3.0 , 0.004 };  Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3818  Spline(5) = {1, 2, 3, 4};  Spline(5) = {1, 2, 3, 4};
3819  """  """
3820          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
3821    
3822     def test_generate_BezierCurve(self):     def test_generate_BezierCurve(self):
3823          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
3824          p0=Point(0,0,0,0.1)         p0=Point(0,0,0,0.1)
3825          p1=Point(1,1,1,0.2)         p1=Point(1,1,1,0.2)
3826          p2=Point(2,2,2,0.3)         p2=Point(2,2,2,0.3)
3827          p3=Point(3,3,3,0.4)         p3=Point(3,3,3,0.4)
3828    
3829          d.addItems(BezierCurve(p0,p1,p2,p3))         d.addItems(BezierCurve(p0,p1,p2,p3))
3830    
3831          scrpt=d.getScriptString()         scrpt=d.getScriptString()
3832          ref = \         ref = \
3833  """// generated by esys.pycad  """// generated by esys.pycad
3834  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3835  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
# Line 3837  Point(3) = {2.0 , 2.0, 2.0 , 0.003 }; Line 3837  Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3837  Point(4) = {3.0 , 3.0, 3.0 , 0.004 };  Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3838  Bezier(5) = {1, 2, 3, 4};  Bezier(5) = {1, 2, 3, 4};
3839  """  """
3840          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
3841    
3842     def test_generate_BSpline(self):     def test_generate_BSpline(self):
3843          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
3844          p0=Point(0,0,0,0.1)         p0=Point(0,0,0,0.1)
3845          p1=Point(1,1,1,0.2)         p1=Point(1,1,1,0.2)
3846          p2=Point(2,2,2,0.3)         p2=Point(2,2,2,0.3)
3847          p3=Point(3,3,3,0.4)         p3=Point(3,3,3,0.4)
3848    
3849          self.failUnlessRaises(ValueError,BSpline,p0)         self.failUnlessRaises(ValueError,BSpline,p0)
3850          d.addItems(BSpline(p0,p1,p2,p3))         d.addItems(BSpline(p0,p1,p2,p3))
3851    
3852          scrpt=d.getScriptString()         scrpt=d.getScriptString()
3853          ref = \         ref = \
3854  """// generated by esys.pycad  """// generated by esys.pycad
3855  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3856  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
# Line 3858  Point(3) = {2.0 , 2.0, 2.0 , 0.003 }; Line 3858  Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3858  Point(4) = {3.0 , 3.0, 3.0 , 0.004 };  Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3859  BSpline(5) = {1, 2, 3, 4};  BSpline(5) = {1, 2, 3, 4};
3860  """  """
3861          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
3862    
3863     def test_generate_ReverseBSpline(self):     def test_generate_ReverseBSpline(self):
3864          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
3865          p0=Point(0,0,0,0.1)         p0=Point(0,0,0,0.1)
3866          p1=Point(1,1,1,0.2)         p1=Point(1,1,1,0.2)
3867          p2=Point(2,2,2,0.3)         p2=Point(2,2,2,0.3)
3868          p3=Point(3,3,3,0.4)         p3=Point(3,3,3,0.4)
3869          p4=Point(1,2,3)         p4=Point(1,2,3)
3870    
3871          CC0=BSpline(p0,p1,p2,p3)         CC0=BSpline(p0,p1,p2,p3)
3872          d.addItems(-CC0)         d.addItems(-CC0)
3873    
3874          scrpt=d.getScriptString()         scrpt=d.getScriptString()
3875          ref = \         ref = \
3876  """// generated by esys.pycad  """// generated by esys.pycad
3877  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3878  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
# Line 3880  Point(3) = {2.0 , 2.0, 2.0 , 0.003 }; Line 3880  Point(3) = {2.0 , 2.0, 2.0 , 0.003 };
3880  Point(4) = {3.0 , 3.0, 3.0 , 0.004 };  Point(4) = {3.0 , 3.0, 3.0 , 0.004 };
3881  BSpline(6) = {1, 2, 3, 4};  BSpline(6) = {1, 2, 3, 4};
3882  """  """
3883          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
3884    
3885     def test_generate_LineSegment(self):     def test_generate_LineSegment(self):
3886          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
3887          p0=Point(0,0,0,0.1)         p0=Point(0,0,0,0.1)
3888          p1=Point(1,1,1,0.2)         p1=Point(1,1,1,0.2)
3889    
3890          d.addItems(Line(p0,p1))         d.addItems(Line(p0,p1))
3891    
3892          scrpt=d.getScriptString()         scrpt=d.getScriptString()
3893          ref = \         ref = \
3894  """// generated by esys.pycad  """// generated by esys.pycad
3895  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3896  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3897  Line(3) = {1, 2};  Line(3) = {1, 2};
3898  """  """
3899          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
3900    
3901     def test_generate_ReverseLineSegment(self):     def test_generate_ReverseLineSegment(self):
3902          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
3903          p0=Point(0,0,0,0.1)         p0=Point(0,0,0,0.1)
3904          p1=Point(1,1,1,0.2)         p1=Point(1,1,1,0.2)
3905    
3906          CC0=Line(p0,p1)         CC0=Line(p0,p1)
3907          d.addItems(-CC0)         d.addItems(-CC0)
3908    
3909          scrpt=d.getScriptString()         scrpt=d.getScriptString()
3910          ref = \         ref = \
3911  """// generated by esys.pycad  """// generated by esys.pycad
3912  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3913  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3914  Line(3) = {1, 2};  Line(3) = {1, 2};
3915  """  """
3916          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
3917    
3918     def test_generate_Arc(self):     def test_generate_Arc(self):
3919          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
3920          center=Point(0,0,0,0.1)         center=Point(0,0,0,0.1)
3921          p_start=Point(1,1,1,0.2)         p_start=Point(1,1,1,0.2)
3922          p_end=Point(1,2,3)         p_end=Point(1,2,3)
3923    
3924          d.addItems(Arc(center,p_start,p_end))         d.addItems(Arc(center,p_start,p_end))
3925    
3926          scrpt=d.getScriptString()         scrpt=d.getScriptString()
3927          ref = \         ref = \
3928  """// generated by esys.pycad  """// generated by esys.pycad
3929  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3930  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3931  Point(3) = {1.0 , 2.0, 3.0 , 0.01 };  Point(3) = {1.0 , 2.0, 3.0 , 0.01 };
3932  Circle(4) = {2, 1, 3};  Circle(4) = {2, 1, 3};
3933  """  """
3934          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
3935    
3936     def test_generate_ReverseArc(self):     def test_generate_ReverseArc(self):
3937          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
3938          center=Point(0,0,0,0.1)         center=Point(0,0,0,0.1)
3939          p_start=Point(1,1,1,0.2)         p_start=Point(1,1,1,0.2)
3940          p_end=Point(1,2,3)         p_end=Point(1,2,3)
3941    
3942          CC0=Arc(center,p_start,p_end)         CC0=Arc(center,p_start,p_end)
3943          d.addItems(-CC0)         d.addItems(-CC0)
3944    
3945          scrpt=d.getScriptString()         scrpt=d.getScriptString()
3946          ref = \         ref = \
3947  """// generated by esys.pycad  """// generated by esys.pycad
3948  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3949  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
3950  Point(3) = {1.0 , 2.0, 3.0 , 0.01 };  Point(3) = {1.0 , 2.0, 3.0 , 0.01 };
3951  Circle(4) = {2, 1, 3};  Circle(4) = {2, 1, 3};
3952  """  """
3953          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
3954           return
3955      
3956     def test_generate_Ellipse(self):     def test_generate_Ellipse(self):
3957          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
3958          center=Point(0,0,0,0.1)         center=Point(0,0,0,0.1)
3959          mainax=Point(0,1,0,0.1)         mainax=Point(0,1,0,0.1)
3960          p_start=Point(1,1,1,0.2)         p_start=Point(1,1,1,0.2)
3961          p_end=Point(1,2,3)         p_end=Point(1,2,3)
3962    
3963          d.addItems(Ellipse(center,mainax,p_start,p_end))         d.addItems(Ellipse(center,mainax,p_start,p_end))
3964    
3965          scrpt=d.getScriptString()         scrpt=d.getScriptString()
3966          ref = \         ref = \
3967  """// generated by esys.pycad  """// generated by esys.pycad
3968  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3969  Point(2) = {0.0 , 1.0, 0.0 , 0.001 };  Point(2) = {0.0 , 1.0, 0.0 , 0.001 };
# Line 3969  Point(3) = {1.0 , 1.0, 1.0 , 0.002 }; Line 3971  Point(3) = {1.0 , 1.0, 1.0 , 0.002 };
3971  Point(4) = {1.0 , 2.0, 3.0 , 0.01 };  Point(4) = {1.0 , 2.0, 3.0 , 0.01 };
3972  Ellipse(5) = {3, 1, 2, 4};  Ellipse(5) = {3, 1, 2, 4};
3973  """  """
3974          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
3975    
3976     def test_generate_ReverseEllipse(self):     def test_generate_ReverseEllipse(self):
3977          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
3978          center=Point(0,0,0,0.1)         center=Point(0,0,0,0.1)
3979          mainax=Point(0,1,0,0.1)         mainax=Point(0,1,0,0.1)
3980          p_start=Point(1,1,1,0.2)         p_start=Point(1,1,1,0.2)
3981          p_end=Point(1,2,3)         p_end=Point(1,2,3)
3982    
3983          CC0=Ellipse(center,mainax,p_start,p_end)         CC0=Ellipse(center,mainax,p_start,p_end)
3984          d.addItems(-CC0)         d.addItems(-CC0)
3985    
3986          scrpt=d.getScriptString()         scrpt=d.getScriptString()
3987          ref = \         ref = \
3988  """// generated by esys.pycad  """// generated by esys.pycad
3989  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
3990  Point(2) = {0.0 , 1.0, 0.0 , 0.001 };  Point(2) = {0.0 , 1.0, 0.0 , 0.001 };
# Line 3990  Point(3) = {1.0 , 1.0, 1.0 , 0.002 }; Line 3992  Point(3) = {1.0 , 1.0, 1.0 , 0.002 };
3992  Point(4) = {1.0 , 2.0, 3.0 , 0.01 };  Point(4) = {1.0 , 2.0, 3.0 , 0.01 };
3993  Ellipse(5) = {3, 1, 2, 4};  Ellipse(5) = {3, 1, 2, 4};
3994  """  """
3995          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
3996    
3997     def test_generate_CurveLoop(self):     def test_generate_CurveLoop(self):
3998          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
3999          p0=Point(0,0,0,0.1)         p0=Point(0,0,0,0.1)
4000          p1=Point(1,1,1,0.2)         p1=Point(1,1,1,0.2)
4001          p2=Point(2,2,2,0.3)         p2=Point(2,2,2,0.3)
4002          p3=Point(3,3,3,0.4)         p3=Point(3,3,3,0.4)
4003          p4=Point(1,2,3)         p4=Point(1,2,3)
4004    
4005          l01=Line(p0,p1)         l01=Line(p0,p1)
4006          l12=Arc(p3,p1,p2)         l12=Arc(p3,p1,p2)
4007          l20=Spline(p2,p4,p0)         l20=Spline(p2,p4,p0)
4008    
4009          lx=Line(p2,p3)         lx=Line(p2,p3)
4010          ly=Line(p3,p1)         ly=Line(p3,p1)
4011    
4012          d.addItems(CurveLoop(l01,l12,l20))         d.addItems(CurveLoop(l01,l12,l20))
4013    
4014          scrpt=d.getScriptString()         scrpt=d.getScriptString()
4015          ref = \         ref = \
4016  """// generated by esys.pycad  """// generated by esys.pycad
4017  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
4018  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
# Line 4022  Circle(7) = {2, 4, 3}; Line 4024  Circle(7) = {2, 4, 3};
4024  Spline(8) = {3, 5, 1};  Spline(8) = {3, 5, 1};
4025  Line Loop(11) = {6, 7, 8};  Line Loop(11) = {6, 7, 8};
4026  """  """
4027          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
4028    
4029                
4030     def test_generate_ReverseCurveLoop(self):     def test_generate_ReverseCurveLoop(self):
4031          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
4032          p0=Point(0,0,0,0.1)         p0=Point(0,0,0,0.1)
4033          p1=Point(1,1,1,0.2)         p1=Point(1,1,1,0.2)
4034          p2=Point(2,2,2,0.3)         p2=Point(2,2,2,0.3)
4035          p3=Point(3,3,3,0.4)         p3=Point(3,3,3,0.4)
4036          p4=Point(1,2,3)         p4=Point(1,2,3)
4037    
4038          l01=Line(p0,p1)         l01=Line(p0,p1)
4039          l12=Arc(p3,p1,p2)         l12=Arc(p3,p1,p2)
4040          l20=Spline(p2,p4,p0)         l20=Spline(p2,p4,p0)
4041    
4042          lx=Line(p2,p3)         lx=Line(p2,p3)
4043          ly=Line(p3,p1)         ly=Line(p3,p1)
4044    
4045          CC0=CurveLoop(l01,l20,l12)         CC0=CurveLoop(l01,l20,l12)
4046          d.addItems(-CC0)         d.addItems(-CC0)
4047    
4048          scrpt=d.getScriptString()         scrpt=d.getScriptString()
4049          ref = \         ref = \
4050  """// generated by esys.pycad  """// generated by esys.pycad
4051  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
4052  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
# Line 4056  Circle(7) = {2, 4, 3}; Line 4058  Circle(7) = {2, 4, 3};
4058  Spline(8) = {3, 5, 1};  Spline(8) = {3, 5, 1};
4059  Line Loop(11) = {6, 8, 7};  Line Loop(11) = {6, 8, 7};
4060  """  """
4061          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
4062    
4063     def test_generate_RuledSurface(self):     def test_generate_RuledSurface(self):
4064          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
4065          p0=Point(0,0,0,0.1)         p0=Point(0,0,0,0.1)
4066          p1=Point(1,1,1,0.2)         p1=Point(1,1,1,0.2)
4067          p2=Point(2,2,2,0.3)         p2=Point(2,2,2,0.3)
4068          p3=Point(3,3,3,0.4)         p3=Point(3,3,3,0.4)
4069          p4=Point(1,2,3)         p4=Point(1,2,3)
4070          p5=Point(10,20,3)         p5=Point(10,20,3)
4071    
4072          l01=Line(p0,p1)         l01=Line(p0,p1)
4073          l12_1=Arc(p3,p1,p2)         l12_1=Arc(p3,p1,p2)
4074          l12_2_1=Spline(p1,p3,p4)         l12_2_1=Spline(p1,p3,p4)
4075          l12_2_2=Spline(p4,p5,p2)         l12_2_2=Spline(p4,p5,p2)
4076          l12_3=Line(p1,p2)         l12_3=Line(p1,p2)
4077          l20=Spline(p2,p4,p0)         l20=Spline(p2,p4,p0)
4078    
4079          cl1=CurveLoop(l01,l12_1,l20)         cl1=CurveLoop(l01,l12_1,l20)
4080          cl2=CurveLoop(l01,l12_2_1,l12_2_2,l20)         cl2=CurveLoop(l01,l12_2_1,l12_2_2,l20)
4081          cl3=CurveLoop(l01,l12_3,l20)         cl3=CurveLoop(l01,l12_3,l20)
4082    
4083          d.addItems(RuledSurface(cl1))         d.addItems(RuledSurface(cl1))
4084    
4085          scrpt=d.getScriptString()         scrpt=d.getScriptString()
4086          ref = \         ref = \
4087  """// generated by esys.pycad  """// generated by esys.pycad
4088  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
4089  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
# Line 4094  Spline(12) = {3, 5, 1}; Line 4096  Spline(12) = {3, 5, 1};
4096  Line Loop(13) = {7, 8, 12};  Line Loop(13) = {7, 8, 12};
4097  Ruled Surface(16) = {13};  Ruled Surface(16) = {13};
4098  """  """
4099          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
4100    
4101     def test_generate_ReverseRuledSurface(self):     def test_generate_ReverseRuledSurface(self):
4102          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
4103          p0=Point(0,0,0,0.1)         p0=Point(0,0,0,0.1)
4104          p1=Point(1,1,1,0.2)         p1=Point(1,1,1,0.2)
4105          p2=Point(2,2,2,0.3)         p2=Point(2,2,2,0.3)
4106          p3=Point(3,3,3,0.4)         p3=Point(3,3,3,0.4)
4107          p4=Point(1,2,3)         p4=Point(1,2,3)
4108          p5=Point(10,20,3)         p5=Point(10,20,3)
4109    
4110          l01=Line(p0,p1)         l01=Line(p0,p1)
4111          l12_1=Arc(p3,p1,p2)         l12_1=Arc(p3,p1,p2)
4112          l12_2_1=Spline(p1,p3,p4)         l12_2_1=Spline(p1,p3,p4)
4113          l12_2_2=Spline(p4,p5,p2)         l12_2_2=Spline(p4,p5,p2)
4114          l12_3=Line(p1,p2)         l12_3=Line(p1,p2)
4115          l20=Spline(p2,p4,p0)         l20=Spline(p2,p4,p0)
4116    
4117          cl1=CurveLoop(l01,l12_1,l20)         cl1=CurveLoop(l01,l12_1,l20)
4118          cl2=CurveLoop(l01,l12_2_1,l12_2_2,l20)         cl2=CurveLoop(l01,l12_2_1,l12_2_2,l20)
4119          cl3=CurveLoop(l01,l12_3,l20)         cl3=CurveLoop(l01,l12_3,l20)
4120    
4121          CC0=RuledSurface(cl1)         CC0=RuledSurface(cl1)
4122          d.addItems(-CC0)         d.addItems(-CC0)
4123    
4124          scrpt=d.getScriptString()         scrpt=d.getScriptString()
4125          ref = \         ref = \
4126  """// generated by esys.pycad  """// generated by esys.pycad
4127  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
4128  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };  Point(2) = {1.0 , 1.0, 1.0 , 0.002 };
# Line 4133  Spline(12) = {3, 5, 1}; Line 4135  Spline(12) = {3, 5, 1};
4135  Line Loop(13) = {7, 8, 12};  Line Loop(13) = {7, 8, 12};
4136  Ruled Surface(16) = {13};  Ruled Surface(16) = {13};
4137  """  """
4138          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
4139    
4140     def test_generate_PlaneSurface(self):     def test_generate_PlaneSurface(self):
4141          d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
4142          p0=Point(0,0,0,0.1)         p0=Point(0,0,0,0.1)
4143          p1=Point(10,0,0,0.2)         p1=Point(10,0,0,0.2)
4144          p2=Point(10,10,0,0.3)         p2=Point(10,10,0,0.3)
4145          p3=Point(0,10,3,0.4)         p3=Point(0,10,3,0.4)
4146          p4=Point(5,5,0,0.001)         p4=Point(5,5,0,0.001)
4147          p5=Point(7,5,0,0.001)         p5=Point(7,5,0,0.001)
4148          p6=Point(5,7,0,0.001)         p6=Point(5,7,0,0.001)
4149          p7=Point(8,8,0,0.001)         p7=Point(8,8,0,0.001)
4150          p8=Point(9,9,0,0.001)         p8=Point(9,9,0,0.001)
4151    
4152          l0=Line(p0,p1)         l0=Line(p0,p1)
4153          l1=Line(p1,p2)         l1=Line(p1,p2)
4154          l2=Line(p2,p3)         l2=Line(p2,p3)
4155          l3=Line(p3,p0)         l3=Line(p3,p0)
   
         l9=Line(p1,p8)  
         l10=Line(p8,p3)  
   
         l4=Line(p4,p5)  
         l5=Line(p5,p6)  
         l6=Line(p6,p4)  
         l7=Line(p6,p7)  
         l8=Line(p7,p4)  
   
         a1=Arc(p4,p3,p1)  
         a2=Arc(p7,p5,p6)  
   
         cl=CurveLoop(l0,l1,l2,l3)  
         h=CurveLoop(l4,l5,l6)  
         cl_s=CurveLoop(l0,l9,l10,l3)  
         h2=CurveLoop(l4,l5,l7,l8)  
         cl_a=CurveLoop(a1,l1,l2)  
         h_a=CurveLoop(a2,l6,l4)  
4156    
4157          d.addItems(PlaneSurface(cl,holes=[h]))         l9=Line(p1,p8)
4158           l10=Line(p8,p3)
4159    
4160          scrpt=d.getScriptString()         l4=Line(p4,p5)
4161          ref = \         l5=Line(p5,p6)
4162           l6=Line(p6,p4)
4163           l7=Line(p6,p7)
4164           l8=Line(p7,p4)
4165    
4166           a1=Arc(p4,p3,p1)
4167           a2=Arc(p7,p5,p6)
4168    
4169           cl=CurveLoop(l0,l1,l2,l3)
4170           h=CurveLoop(l4,l5,l6)
4171           cl_s=CurveLoop(l0,l9,l10,l3)
4172           h2=CurveLoop(l4,l5,l7,l8)
4173           cl_a=CurveLoop(a1,l1,l2)
4174           h_a=CurveLoop(a2,l6,l4)
4175    
4176           d.addItems(PlaneSurface(cl,holes=[h]))
4177    
4178           scrpt=d.getScriptString()
4179           if os.name == 'nt' :
4180                ref = \
4181    """// generated by esys.pycad
4182    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
4183    Point(2) = {10.0 , 0.0, 0.0 , 0.002 };
4184    Point(3) = {10.0 , 10.0, 0.0 , 0.003 };
4185    Point(4) = {0.0 , 10.0, 3.0 , 0.004 };
4186    Point(5) = {5.0 , 5.0, 0.0 , 1e-005 };
4187    Point(6) = {7.0 , 5.0, 0.0 , 1e-005 };
4188    Point(7) = {5.0 , 7.0, 0.0 , 1e-005 };
4189    Line(10) = {1, 2};
4190    Line(11) = {2, 3};
4191    Line(12) = {3, 4};
4192    Line(13) = {4, 1};
4193    Line(16) = {5, 6};
4194    Line(17) = {6, 7};
4195    Line(18) = {7, 5};
4196    Line Loop(23) = {10, 11, 12, 13};
4197    Line Loop(24) = {16, 17, 18};
4198    Plane Surface(29) = {23, 24};
4199    """
4200           else :
4201                ref = \
4202  """// generated by esys.pycad  """// generated by esys.pycad
4203  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
4204  Point(2) = {10.0 , 0.0, 0.0 , 0.002 };  Point(2) = {10.0 , 0.0, 0.0 , 0.002 };
# Line 4194  Line Loop(23) = {10, 11, 12, 13}; Line 4218  Line Loop(23) = {10, 11, 12, 13};
4218  Line Loop(24) = {16, 17, 18};  Line Loop(24) = {16, 17, 18};
4219  Plane Surface(29) = {23, 24};  Plane Surface(29) = {23, 24};
4220  """  """
4221          self.failUnless(scrpt == ref )  
4222    
4223                
4224           self.failUnless(scrpt[0:217] == ref[0:217])
4225    
4226     def test_generate_SurfaceLoop(self):     def test_generate_SurfaceLoop(self):
4227          d=GMSHDesign(dim=3, element_size=0.01)         d=GMSHDesign(dim=3, element_size=0.01)
4228          p0=Point( 0, 0, 0,0.1)         p0=Point( 0, 0, 0,0.1)
4229          p1=Point(10, 0, 0,0.1)         p1=Point(10, 0, 0,0.1)
4230          p2=Point( 0,10, 0,0.1)         p2=Point( 0,10, 0,0.1)
4231          p3=Point(10,10, 0,0.1)         p3=Point(10,10, 0,0.1)
4232          p4=Point( 0, 0,10,0.1)         p4=Point( 0, 0,10,0.1)
4233          p5=Point(10, 0,10,0.1)         p5=Point(10, 0,10,0.1)
4234          p6=Point( 0,10,10,0.1)         p6=Point( 0,10,10,0.1)
4235          p7=Point(10,10,10,0.1)         p7=Point(10,10,10,0.1)
4236    
4237          q0=Point( 4, 0, 4,0.1)         q0=Point( 4, 0, 4,0.1)
4238          q1=Point( 6, 0, 4,0.1)         q1=Point( 6, 0, 4,0.1)
4239          q2=Point( 4,10, 4,0.1)         q2=Point( 4,10, 4,0.1)
4240          q3=Point( 6,10, 4,0.1)         q3=Point( 6,10, 4,0.1)
4241          q4=Point( 4, 0, 6,0.1)         q4=Point( 4, 0, 6,0.1)
4242          q5=Point( 6, 0, 6,0.1)         q5=Point( 6, 0, 6,0.1)
4243          q6=Point( 4,10, 6,0.1)         q6=Point( 4,10, 6,0.1)
4244          q7=Point( 6,10, 6,0.1)         q7=Point( 6,10, 6,0.1)
4245    
4246          l01=Line(p0,p1)         l01=Line(p0,p1)
4247          l15=Line(p1,p5)         l15=Line(p1,p5)
4248          l54=Line(p5,p4)         l54=Line(p5,p4)
4249          l04=Line(p4,p0)         l04=Line(p4,p0)
4250    
4251          l13=Line(p1,p3)         l13=Line(p1,p3)
4252          l37=Line(p3,p7)         l37=Line(p3,p7)
4253          l75=Line(p7,p5)         l75=Line(p7,p5)
4254          l67=Line(p6,p7)         l67=Line(p6,p7)
4255          l26=Line(p2,p6)         l26=Line(p2,p6)
4256          l32=Line(p3,p2)         l32=Line(p3,p2)
4257          l20=Line(p2,p0)         l20=Line(p2,p0)
4258          l46=Line(p4,p6)         l46=Line(p4,p6)
4259    
4260          m01=Line(q0,q1)         m01=Line(q0,q1)
4261          m15=Line(q1,q5)         m15=Line(q1,q5)
4262          m54=Line(q5,q4)         m54=Line(q5,q4)
4263          m40=Line(q4,q0)         m40=Line(q4,q0)
4264          m23=Line(q2,q3)         m23=Line(q2,q3)
4265          m37=Line(q3,q7)         m37=Line(q3,q7)
4266          m76=Line(q7,q6)         m76=Line(q7,q6)
4267          m62=Line(q6,q2)         m62=Line(q6,q2)
4268    
4269          m02=Line(q0,q2)         m02=Line(q0,q2)
4270          m13=Line(q1,q3)         m13=Line(q1,q3)
4271          m46=Line(q4,q6)         m46=Line(q4,q6)
4272          m57=Line(q5,q7)         m57=Line(q5,q7)
4273    
4274          cl_l1=CurveLoop(l01,l15,l54,l04)         cl_l1=CurveLoop(l01,l15,l54,l04)
4275          cl_m1=CurveLoop(m01,m15,m54,m40)         cl_m1=CurveLoop(m01,m15,m54,m40)
4276          s1=PlaneSurface(cl_l1,holes=[cl_m1])         s1=PlaneSurface(cl_l1,holes=[cl_m1])
4277          s1_v=PlaneSurface(cl_l1)         s1_v=PlaneSurface(cl_l1)
4278    
4279          cl_l2=CurveLoop(-l15,l13,l37,l75)         cl_l2=CurveLoop(-l15,l13,l37,l75)
4280          s2=PlaneSurface(cl_l2)         s2=PlaneSurface(cl_l2)
4281    
4282          cl_l3=CurveLoop(l32,-l37,l67,l26)         cl_l3=CurveLoop(l32,-l37,l67,l26)
4283          cl_m3=CurveLoop(-m23,-m37,-m76,-m62)         cl_m3=CurveLoop(-m23,-m37,-m76,-m62)
4284          s3=PlaneSurface(cl_l3,holes=[cl_m3])         s3=PlaneSurface(cl_l3,holes=[cl_m3])
4285          s3_v=PlaneSurface(cl_l3)         s3_v=PlaneSurface(cl_l3)
4286            
4287            
4288          cl_l4=CurveLoop(l20,-l26,l46,-l04)         cl_l4=CurveLoop(l20,-l26,l46,-l04)
4289          s4=PlaneSurface(cl_l4)         s4=PlaneSurface(cl_l4)
4290    
4291          cl_l5=CurveLoop(l32,l20,l01,l13)         cl_l5=CurveLoop(l32,l20,l01,l13)
4292          s5=PlaneSurface(-cl_l5)         s5=PlaneSurface(-cl_l5)
4293    
4294          cl_l6=CurveLoop(l67,l75,l54,l46)         cl_l6=CurveLoop(l67,l75,l54,l46)
4295          s6=PlaneSurface(-cl_l6)         s6=PlaneSurface(-cl_l6)
4296    
4297          cl_m7=CurveLoop(m13,m37,-m57,-m15)         cl_m7=CurveLoop(m13,m37,-m57,-m15)
4298          s7=PlaneSurface(cl_m7)         s7=PlaneSurface(cl_m7)
4299                    
4300          cl_m8=CurveLoop(m57,m76,-m46,-m54)         cl_m8=CurveLoop(m57,m76,-m46,-m54)
4301          s8=PlaneSurface(cl_m8)         s8=PlaneSurface(cl_m8)
4302    
4303          cl_m9=CurveLoop(m46,m62,-m02,-m40)         cl_m9=CurveLoop(m46,m62,-m02,-m40)
4304          s9=PlaneSurface(cl_m9)         s9=PlaneSurface(cl_m9)
4305    
4306          cl_m10=CurveLoop(-m01,m02,m23,-m13)         cl_m10=CurveLoop(-m01,m02,m23,-m13)
4307          s10=PlaneSurface(cl_m10)         s10=PlaneSurface(cl_m10)
4308    
4309          d.addItems(SurfaceLoop(s1,s2,s3,s4,s5,s6,-s7,-s8,-s9,-s10))         d.addItems(SurfaceLoop(s1,s2,s3,s4,s5,s6,-s7,-s8,-s9,-s10))
4310    
4311          scrpt=d.getScriptString()         scrpt=d.getScriptString()
4312          ref = \         ref = \
4313  """// generated by esys.pycad  """// generated by esys.pycad
4314  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
4315  Point(2) = {10.0 , 0.0, 0.0 , 0.001 };  Point(2) = {10.0 , 0.0, 0.0 , 0.001 };
# Line 4348  Line Loop(63) = {-29, 37, 33, -38}; Line 4375  Line Loop(63) = {-29, 37, 33, -38};
4375  Plane Surface(64) = {63};  Plane Surface(64) = {63};
4376  Surface Loop(65) = {43, 46, 49, 52, 54, 56, -58, -60, -62, -64};  Surface Loop(65) = {43, 46, 49, 52, 54, 56, -58, -60, -62, -64};
4377  """  """
4378          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
4379    
4380     def test_generate_ReverseSurfaceLoop(self):     def test_generate_ReverseSurfaceLoop(self):
4381          d=GMSHDesign(dim=3, element_size=0.01)         d=GMSHDesign(dim=3, element_size=0.01)
4382          p0=Point( 0, 0, 0,0.1)         p0=Point( 0, 0, 0,0.1)
4383          p1=Point(10, 0, 0,0.1)         p1=Point(10, 0, 0,0.1)
4384          p2=Point( 0,10, 0,0.1)         p2=Point( 0,10, 0,0.1)
4385          p3=Point(10,10, 0,0.1)         p3=Point(10,10, 0,0.1)
4386          p4=Point( 0, 0,10,0.1)         p4=Point( 0, 0,10,0.1)
4387          p5=Point(10, 0,10,0.1)         p5=Point(10, 0,10,0.1)
4388          p6=Point( 0,10,10,0.1)         p6=Point( 0,10,10,0.1)
4389          p7=Point(10,10,10,0.1)         p7=Point(10,10,10,0.1)
4390    
4391          q0=Point( 4, 0, 4,0.1)         q0=Point( 4, 0, 4,0.1)
4392          q1=Point( 6, 0, 4,0.1)         q1=Point( 6, 0, 4,0.1)
4393          q2=Point( 4,10, 4,0.1)         q2=Point( 4,10, 4,0.1)
4394          q3=Point( 6,10, 4,0.1)         q3=Point( 6,10, 4,0.1)
4395          q4=Point( 4, 0, 6,0.1)         q4=Point( 4, 0, 6,0.1)
4396          q5=Point( 6, 0, 6,0.1)         q5=Point( 6, 0, 6,0.1)
4397          q6=Point( 4,10, 6,0.1)         q6=Point( 4,10, 6,0.1)
4398          q7=Point( 6,10, 6,0.1)         q7=Point( 6,10, 6,0.1)
4399    
4400          l01=Line(p0,p1)         l01=Line(p0,p1)
4401          l15=Line(p1,p5)         l15=Line(p1,p5)
4402          l54=Line(p5,p4)         l54=Line(p5,p4)
4403          l04=Line(p4,p0)         l04=Line(p4,p0)
4404    
4405          l13=Line(p1,p3)         l13=Line(p1,p3)
4406          l37=Line(p3,p7)         l37=Line(p3,p7)
4407          l75=Line(p7,p5)         l75=Line(p7,p5)
4408          l67=Line(p6,p7)         l67=Line(p6,p7)
4409          l26=Line(p2,p6)         l26=Line(p2,p6)
4410          l32=Line(p3,p2)         l32=Line(p3,p2)
4411          l20=Line(p2,p0)         l20=Line(p2,p0)
4412          l46=Line(p4,p6)         l46=Line(p4,p6)
4413    
4414          m01=Line(q0,q1)         m01=Line(q0,q1)
4415          m15=Line(q1,q5)         m15=Line(q1,q5)
4416          m54=Line(q5,q4)         m54=Line(q5,q4)
4417          m40=Line(q4,q0)         m40=Line(q4,q0)
4418          m23=Line(q2,q3)         m23=Line(q2,q3)
4419          m37=Line(q3,q7)         m37=Line(q3,q7)
4420          m76=Line(q7,q6)         m76=Line(q7,q6)
4421          m62=Line(q6,q2)         m62=Line(q6,q2)
4422    
4423          m02=Line(q0,q2)         m02=Line(q0,q2)
4424          m13=Line(q1,q3)         m13=Line(q1,q3)
4425          m46=Line(q4,q6)         m46=Line(q4,q6)
4426          m57=Line(q5,q7)         m57=Line(q5,q7)
4427    
4428          cl_l1=CurveLoop(l01,l15,l54,l04)         cl_l1=CurveLoop(l01,l15,l54,l04)
4429          cl_m1=CurveLoop(m01,m15,m54,m40)         cl_m1=CurveLoop(m01,m15,m54,m40)
4430          s1=PlaneSurface(cl_l1,holes=[cl_m1])         s1=PlaneSurface(cl_l1,holes=[cl_m1])
4431          s1_v=PlaneSurface(cl_l1)         s1_v=PlaneSurface(cl_l1)
4432    
4433          cl_l2=CurveLoop(-l15,l13,l37,l75)         cl_l2=CurveLoop(-l15,l13,l37,l75)
4434          s2=PlaneSurface(cl_l2)         s2=PlaneSurface(cl_l2)
4435    
4436          cl_l3=CurveLoop(l32,-l37,l67,l26)         cl_l3=CurveLoop(l32,-l37,l67,l26)
4437          cl_m3=CurveLoop(-m23,-m37,-m76,-m62)         cl_m3=CurveLoop(-m23,-m37,-m76,-m62)
4438          s3=PlaneSurface(cl_l3,holes=[cl_m3])         s3=PlaneSurface(cl_l3,holes=[cl_m3])
4439          s3_v=PlaneSurface(cl_l3)         s3_v=PlaneSurface(cl_l3)
4440            
4441            
4442          cl_l4=CurveLoop(l20,-l26,l46,-l04)         cl_l4=CurveLoop(l20,-l26,l46,-l04)
4443          s4=PlaneSurface(cl_l4)         s4=PlaneSurface(cl_l4)
4444    
4445          cl_l5=CurveLoop(l32,l20,l01,l13)         cl_l5=CurveLoop(l32,l20,l01,l13)
4446          s5=PlaneSurface(-cl_l5)         s5=PlaneSurface(-cl_l5)
4447    
4448          cl_l6=CurveLoop(l67,l75,l54,l46)         cl_l6=CurveLoop(l67,l75,l54,l46)
4449          s6=PlaneSurface(-cl_l6)         s6=PlaneSurface(-cl_l6)
4450    
4451          cl_m7=CurveLoop(m13,m37,-m57,-m15)         cl_m7=CurveLoop(m13,m37,-m57,-m15)
4452          s7=PlaneSurface(cl_m7)         s7=PlaneSurface(cl_m7)
4453                    
4454          cl_m8=CurveLoop(m57,m76,-m46,-m54)         cl_m8=CurveLoop(m57,m76,-m46,-m54)
4455          s8=PlaneSurface(cl_m8)         s8=PlaneSurface(cl_m8)
4456    
4457          cl_m9=CurveLoop(m46,m62,-m02,-m40)         cl_m9=CurveLoop(m46,m62,-m02,-m40)
4458          s9=PlaneSurface(cl_m9)         s9=PlaneSurface(cl_m9)
4459    
4460          cl_m10=CurveLoop(-m01,m02,m23,-m13)         cl_m10=CurveLoop(-m01,m02,m23,-m13)
4461          s10=PlaneSurface(cl_m10)         s10=PlaneSurface(cl_m10)
4462    
4463          CC0=SurfaceLoop(s1,s2,s3,s4,s5,s6,-s7,-s8,-s9,-s10)         CC0=SurfaceLoop(s1,s2,s3,s4,s5,s6,-s7,-s8,-s9,-s10)
4464          s=-CC0         s=-CC0
4465          d.addItems(-CC0)         d.addItems(-CC0)
4466    
4467          scrpt=d.getScriptString()         scrpt=d.getScriptString()
4468          ref = \         ref = \
4469  """// generated by esys.pycad  """// generated by esys.pycad
4470  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
4471  Point(2) = {10.0 , 0.0, 0.0 , 0.001 };  Point(2) = {10.0 , 0.0, 0.0 , 0.001 };
# Line 4504  Line Loop(63) = {-29, 37, 33, -38}; Line 4531  Line Loop(63) = {-29, 37, 33, -38};
4531  Plane Surface(64) = {63};  Plane Surface(64) = {63};
4532  Surface Loop(65) = {43, 46, 49, 52, 54, 56, -58, -60, -62, -64};  Surface Loop(65) = {43, 46, 49, 52, 54, 56, -58, -60, -62, -64};
4533  """  """
4534          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
4535    
4536     def test_generate_Volume(self):     def test_generate_Volume(self):
4537          d=GMSHDesign(dim=3, element_size=0.01)         d=GMSHDesign(dim=3, element_size=0.01)
4538          p0=Point(-2,-2,-2,0.1)         p0=Point(-2,-2,-2,0.1)
4539          p1=Point(2,-2,-2,0.1)         p1=Point(2,-2,-2,0.1)
4540          p2=Point(-2,2,-2,0.1)         p2=Point(-2,2,-2,0.1)
4541          p3=Point(2,2,-2,0.1)         p3=Point(2,2,-2,0.1)
4542          p4=Point(-2,-2,2,0.1)         p4=Point(-2,-2,2,0.1)
4543          p5=Point(2,-2,2,0.1)         p5=Point(2,-2,2,0.1)
4544          p6=Point(-2,2,2,0.1)         p6=Point(-2,2,2,0.1)
4545          p7=Point(2,2,2,0.1)         p7=Point(2,2,2,0.1)
4546          l01=Line(p0,p1)         l01=Line(p0,p1)
4547          l15=Line(p1,p5)         l15=Line(p1,p5)
4548          l54=Line(p5,p4)         l54=Line(p5,p4)
4549          l40=Line(p4,p0)         l40=Line(p4,p0)
4550          l23=Line(p2,p3)         l23=Line(p2,p3)
4551          l37=Line(p3,p7)         l37=Line(p3,p7)
4552          l76=Line(p7,p6)         l76=Line(p7,p6)
4553          l62=Line(p6,p2)         l62=Line(p6,p2)
4554          l13=Line(p1,p3)         l13=Line(p1,p3)
4555          l57=Line(p5,p7)         l57=Line(p5,p7)
4556          l02=Line(p0,p2)         l02=Line(p0,p2)
4557          l46=Line(p4,p6)         l46=Line(p4,p6)
4558          cl1=CurveLoop(l01,l15,l54,l40)         cl1=CurveLoop(l01,l15,l54,l40)
4559          s1=PlaneSurface(cl1)         s1=PlaneSurface(cl1)
4560          cl2=CurveLoop(l23,l37,l76,l62)         cl2=CurveLoop(l23,l37,l76,l62)
4561          s2=PlaneSurface(-cl2)         s2=PlaneSurface(-cl2)
4562          cl3=CurveLoop(l13,l37,-l57,-l15)         cl3=CurveLoop(l13,l37,-l57,-l15)
4563          s3=PlaneSurface(cl3)         s3=PlaneSurface(cl3)
4564          cl4=CurveLoop(l46,l62,-l02,-l40)         cl4=CurveLoop(l46,l62,-l02,-l40)
4565          s4=PlaneSurface(-cl4)         s4=PlaneSurface(-cl4)
4566          cl5=CurveLoop(-l01,l02,l23,-l13)         cl5=CurveLoop(-l01,l02,l23,-l13)
4567          s5=PlaneSurface(-cl5)         s5=PlaneSurface(-cl5)
4568          cl6=CurveLoop(-l54,l57,l76,-l46)         cl6=CurveLoop(-l54,l57,l76,-l46)
4569          s6=PlaneSurface(-cl6)         s6=PlaneSurface(-cl6)
4570          s_out=SurfaceLoop(s1,s2,s3,s4,s5,s6)         s_out=SurfaceLoop(s1,s2,s3,s4,s5,s6)
4571    
4572          p0_i=Point(-1,-1,-1,0.1)         p0_i=Point(-1,-1,-1,0.1)
4573          p1_i=Point(1,-1,-1,0.1)         p1_i=Point(1,-1,-1,0.1)
4574          p2_i=Point(-1,1,-1,0.1)         p2_i=Point(-1,1,-1,0.1)
4575          p3_i=Point(1,1,-1,0.1)         p3_i=Point(1,1,-1,0.1)
4576          p4_i=Point(-1,-1,1,0.1)         p4_i=Point(-1,-1,1,0.1)
4577          p5_i=Point(1,-1,1,0.1)         p5_i=Point(1,-1,1,0.1)
4578          p6_i=Point(-1,1,1,0.1)         p6_i=Point(-1,1,1,0.1)
4579          p7_i=Point(1,1,1,0.1)         p7_i=Point(1,1,1,0.1)
4580          l01_i=Line(p0_i,p1_i)         l01_i=Line(p0_i,p1_i)
4581          l15_i=Line(p1_i,p5_i)         l15_i=Line(p1_i,p5_i)
4582          l54_i=Line(p5_i,p4_i)         l54_i=Line(p5_i,p4_i)
4583          l40_i=Line(p4_i,p0_i)         l40_i=Line(p4_i,p0_i)
4584          l23_i=Line(p2_i,p3_i)         l23_i=Line(p2_i,p3_i)
4585          l37_i=Line(p3_i,p7_i)         l37_i=Line(p3_i,p7_i)
4586          l76_i=Line(p7_i,p6_i)         l76_i=Line(p7_i,p6_i)
4587          l62_i=Line(p6_i,p2_i)         l62_i=Line(p6_i,p2_i)
4588          l13_i=Line(p1_i,p3_i)         l13_i=Line(p1_i,p3_i)
4589          l57_i=Line(p5_i,p7_i)         l57_i=Line(p5_i,p7_i)
4590          l02_i=Line(p0_i,p2_i)         l02_i=Line(p0_i,p2_i)
4591          l46_i=Line(p4_i,p6_i)         l46_i=Line(p4_i,p6_i)
4592          cl1_i=CurveLoop(l01_i,l15_i,l54_i,l40_i)         cl1_i=CurveLoop(l01_i,l15_i,l54_i,l40_i)
4593          s1_i=PlaneSurface(cl1_i)         s1_i=PlaneSurface(cl1_i)
4594          cl2_i=CurveLoop(l23_i,l37_i,l76_i,l62_i)         cl2_i=CurveLoop(l23_i,l37_i,l76_i,l62_i)
4595          s2_i=PlaneSurface(-cl2_i)         s2_i=PlaneSurface(-cl2_i)
4596          cl3_i=CurveLoop(l13_i,l37_i,-l57_i,-l15_i)         cl3_i=CurveLoop(l13_i,l37_i,-l57_i,-l15_i)
4597          s3_i=PlaneSurface(cl3_i)         s3_i=PlaneSurface(cl3_i)
4598          cl4_i=CurveLoop(l46_i,l62_i,-l02_i,-l40_i)         cl4_i=CurveLoop(l46_i,l62_i,-l02_i,-l40_i)
4599          s4_i=PlaneSurface(-cl4_i)         s4_i=PlaneSurface(-cl4_i)
4600          cl5_i=CurveLoop(-l01_i,l02_i,l23_i,-l13_i)         cl5_i=CurveLoop(-l01_i,l02_i,l23_i,-l13_i)
4601          s5_i=PlaneSurface(-cl5_i)         s5_i=PlaneSurface(-cl5_i)
4602          cl6_i=CurveLoop(-l54_i,l57_i,l76_i,-l46_i)         cl6_i=CurveLoop(-l54_i,l57_i,l76_i,-l46_i)
4603          s6_i=PlaneSurface(-cl6_i)         s6_i=PlaneSurface(-cl6_i)
4604          s_inner=SurfaceLoop(s1_i,s2_i,s3_i,s4_i,s5_i,s6_i)         s_inner=SurfaceLoop(s1_i,s2_i,s3_i,s4_i,s5_i,s6_i)
4605    
4606          d.addItems(Volume(s_out,holes=[s_inner]))         d.addItems(Volume(s_out,holes=[s_inner]))
4607    
4608          scrpt=d.getScriptString();         scrpt=d.getScriptString();
4609          ref = \         ref = \
4610  """// generated by esys.pycad  """// generated by esys.pycad
4611  Point(1) = {-2.0 , -2.0, -2.0 , 0.001 };  Point(1) = {-2.0 , -2.0, -2.0 , 0.001 };
4612  Point(2) = {2.0 , -2.0, -2.0 , 0.001 };  Point(2) = {2.0 , -2.0, -2.0 , 0.001 };
# Line 4649  Plane Surface(65) = {-64}; Line 4676  Plane Surface(65) = {-64};
4676  Surface Loop(66) = {55, 57, 59, 61, 63, 65};  Surface Loop(66) = {55, 57, 59, 61, 63, 65};
4677  Volume(67) = {33, 66};  Volume(67) = {33, 66};
4678  """  """
4679          self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
4680    
4681     def test_generate_PropertySet0D(self):     def test_generate_PropertySet0D(self):
4682         d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
# Line 4725  Physical Line(8) = {5, 6, 7}; Line 4752  Physical Line(8) = {5, 6, 7};
4752         d.addItems(PropertySet("test0", s))         d.addItems(PropertySet("test0", s))
4753    
4754         scrpt=d.getScriptString()         scrpt=d.getScriptString()
4755         ref = \         if os.name == 'nt' :
4756                ref = \
4757    """// generated by esys.pycad
4758    Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
4759    Point(2) = {10.0 , 0.0, 0.0 , 0.002 };
4760    Point(3) = {10.0 , 10.0, 0.0 , 0.003 };
4761    Point(4) = {0.0 , 10.0, 3.0 , 0.004 };
4762    Point(5) = {5.0 , 5.0, 0.0 , 1e-005 };
4763    Point(6) = {7.0 , 5.0, 0.0 , 1e-005 };
4764    Point(7) = {5.0 , 7.0, 0.0 , 1e-005 };
4765    Line(8) = {1, 2};
4766    Line(9) = {2, 3};
4767    Line(10) = {3, 4};
4768    Line(11) = {4, 1};
4769    Line(12) = {5, 6};
4770    Line(13) = {6, 7};
4771    Line(14) = {7, 5};
4772    Line Loop(15) = {8, 9, 10, 11};
4773    Line Loop(16) = {12, 13, 14};
4774    Plane Surface(17) = {15, 16};
4775    Physical Surface(18) = {17};
4776    """
4777           else:
4778                ref = \
4779  """// generated by esys.pycad  """// generated by esys.pycad
4780  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };  Point(1) = {0.0 , 0.0, 0.0 , 0.001 };
4781  Point(2) = {10.0 , 0.0, 0.0 , 0.002 };  Point(2) = {10.0 , 0.0, 0.0 , 0.002 };
# Line 4746  Line Loop(16) = {12, 13, 14}; Line 4796  Line Loop(16) = {12, 13, 14};
4796  Plane Surface(17) = {15, 16};  Plane Surface(17) = {15, 16};
4797  Physical Surface(18) = {17};  Physical Surface(18) = {17};
4798  """  """
        self.failUnless(scrpt == ref )  
4799    
4800     def test_generate_PropertySet3D(self):     def test_generate_PropertySet3D(self):
4801         d=GMSHDesign(dim=3, element_size=0.01)         d=GMSHDesign(dim=3, element_size=0.01)

Legend:
Removed from v.1904  
changed lines
  Added in v.1905

  ViewVC Help
Powered by ViewVC 1.1.26