--- trunk/pycad/examples/structure.py 2006/11/13 08:02:24 899 +++ trunk/pycad/examples/structure.py 2007/01/19 09:27:15 932 @@ -20,14 +20,14 @@ __date__="\$Date\$" from esys.pycad import * -from esys.pycad.shapes import Brick +from esys.pycad.gmsh import Design l=100000. # width and length m (without obsorber) h=30000. # width and length m (without obsorber) d_absorber=l*0.10 # thickness of absorbing layer b=Brick(Point(0.,0.,-h),Point(l,l,0.)) -p1=Point(l/5,l/5,-2*h/3,local_scale=0.3) +p1=Point(l/5,l/5,-2*h/3) p2=p1+[l/5,l/5,0.] p3=p2+[0,0.,h/5] p4=p3+[-l/5,-l/5,0.] @@ -36,6 +36,7 @@ l3=Line(p3,p4) l4=Line(p4,p1) c1=CurveLoop(l1,l2,l3,l4) +c1.setLocalScale(0.1) q1=Point(2*l/3,2*l/3,-2*h/3,local_scale=0.3) q2=q1+[-l/4,l/4,0.] q3=q2+[0,0.,h/3] @@ -45,8 +46,9 @@ m3=Line(q3,q4) m4=Line(q4,q1) c2=CurveLoop(m1,m2,m3,m4) -b.addSurface(Surface(c1),Surface(c2)) -dsgn=Design(scale=10000.) -dsgn.addPrimitives(Volume(b)) -f=dsgn.writeFinleyMesh("l.fly") -print f +c2.setLocalScale(0.1) +dsgn=Design(element_size=h/3) +dsgn.addItems(Volume(SurfaceLoop(*tuple(b.getSurfaces()+[PlaneSurface(c1),PlaneSurface(c2)])))) +dsgn.setScriptFileName("test.geo") +dsgn.setMeshFileName("test.msh") +print dsgn.getMeshHandler()