/[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 1108 by gross, Tue Mar 20 01:30:58 2007 UTC revision 1109 by btully, Thu Apr 19 04:21:43 2007 UTC
# Line 14  import numarray Line 14  import numarray
14  from esys.pycad import *  from esys.pycad import *
15  from esys.pycad.design import Design as Design0  from esys.pycad.design import Design as Design0
16  from esys.pycad.gmsh import Design as GMSHDesign  from esys.pycad.gmsh import Design as GMSHDesign
17    from esys.pycad.Triangle import Design as TriangleDesign
18    
19  try:  try:
20       PYCAD_TEST_DATA=os.environ['PYCAD_TEST_DATA']       PYCAD_TEST_DATA=os.environ['PYCAD_TEST_DATA']
# Line 3554  Physical Line(13) = {6, 7}; Line 3555  Physical Line(13) = {6, 7};
3555  """  """
3556         self.failUnless(scrpt == ref )         self.failUnless(scrpt == ref )
3557    
3558          
3559       def test_Triangle(self):
3560        
3561           d=TriangleDesign(dim=2, keep_files=False)
3562    
3563           script_name=d.getScriptFileName()
3564           self.failUnless(isinstance(script_name,str))
3565           self.failUnless(script_name.split(".")[-1] == "poly")
3566           script_name=PYCAD_WORKDIR+os.sep+"script.poly"
3567           d.setScriptFileName(script_name)
3568           self.failUnless(script_name == d.getScriptFileName())
3569    
3570           mesh_name=d.getMeshFileName()
3571           self.failUnless(isinstance(mesh_name,str))
3572           mesh_name=PYCAD_WORKDIR+os.sep+"mesh"
3573           d.setMeshFileName(mesh_name)
3574           self.failUnless(mesh_name == d.getMeshFileName())
3575          
3576           d.setOptions(cmdLineArgs="-Qpqa7.5")
3577           cmd=d.getCommandString()
3578           self.failUnless("triangle -Qpqa7.5 .%sscript.poly"%(os.sep) == cmd)
3579    
3580           p0=Point(0.,0.,0.)
3581           p1=Point(1.,0.,0.)
3582           p2=Point(1.,1.,0.)
3583           p3=Point(0.,1.,0.)
3584           l01=Line(p0,p1)
3585           l12=Line(p1,p2)
3586           l23=Line(p2,p3)
3587           l30=Line(p3,p0)
3588           c=CurveLoop(l01,l12,l23,l30)
3589           s=PlaneSurface(c)
3590           ps=PropertySet("XXXX",s)
3591           d.addItems(ps)
3592    
3593           scrpt=d.getScriptString()
3594           ref = \
3595    """# generated by esys.pycad
3596    # vertices #
3597    4 2 0 1
3598    1 0.0 0.0 11
3599    2 1.0 0.0 11
3600    3 1.0 1.0 11
3601    4 0.0 1.0 11
3602    # segments #
3603    4 1
3604    1 1 2 11
3605    2 2 3 11
3606    3 3 4 11
3607    4 4 1 11
3608    # holes #
3609    0
3610    """
3611           self.failUnless(scrpt == ref )
3612    
3613     def test_generate_Point(self):     def test_generate_Point(self):
3614         d=GMSHDesign(dim=2, element_size=0.01)         d=GMSHDesign(dim=2, element_size=0.01)
3615         d.addItems(Point(1.,2.,3.,local_scale=9.))         d.addItems(Point(1.,2.,3.,local_scale=9.))

Legend:
Removed from v.1108  
changed lines
  Added in v.1109

  ViewVC Help
Powered by ViewVC 1.1.26