- 积分
- 0
- 注册时间
- 2020-7-25
- 仿真币
-
- 最后登录
- 1970-1-1
|
请教一下各位,关于abaqus的python二次开发命令PartitionCellByPlanePointNormal,发现对某一部件执行该命令(分割部件)的for循环中,固定选取一边作为法线方向,有的时候没有报错有的时候却出现报错,每次循环都要对该边进行重新定义对象变量才保证绝对不会报错,但是循环次数太多则会有效率问题,如何解决比较好。
我发现对一个立方体的三个方向进行10等份分割,尝试运行了下面三种代码都中途中断,不知是什么原因。- m = mdb.Model(name='cube')
- s = m.ConstrainedSketch(name='square',sheetSize=100.0)
- s.Line(point1=(0.0,0.0),point2=(10.0,0.0))
- s.Line(point1=(10.0,0.0),point2=(10.0,10.0))
- s.Line(point1=(10.0,10.0),point2=(0.0,10.0))
- s.Line(point1=(0.0,10.0),point2=(0.0,0.0))
- p=m.Part(name='cube',dimensionality=THREE_D,type=DEFORMABLE_BODY)
- p.BaseSolidExtrude(sketch=s,depth=10.0)
- e1 = p.edges.findAt(((0.5,0.0,0.0),))
- e2 = p.edges.findAt(((0.0,0.5,0.0),))
- e3 = p.edges.findAt(((0.0,0.0,0.5),))
- for i in range(1,10):
- p.PartitionCellByPlanePointNormal(point=(i,0,0),normal=e1[0],cells=p.cells)
- p.PartitionCellByPlanePointNormal(point=(0,i,0),normal=e2[0],cells=p.cells)
- p.PartitionCellByPlanePointNormal(point=(0,0,i),normal=e3[0],cells=p.cells)
复制代码- m = mdb.Model(name='cube')
- s = m.ConstrainedSketch(name='square',sheetSize=100.0)
- s.Line(point1=(0.0,0.0),point2=(10.0,0.0))
- s.Line(point1=(10.0,0.0),point2=(10.0,10.0))
- s.Line(point1=(10.0,10.0),point2=(0.0,10.0))
- s.Line(point1=(0.0,10.0),point2=(0.0,0.0))
- p=m.Part(name='cube',dimensionality=THREE_D,type=DEFORMABLE_BODY)
- p.BaseSolidExtrude(sketch=s,depth=10.0)
- for i in range(1,10):
- e1 = p.edges.findAt(((0.5,0.0,0.0),))
- e2 = p.edges.findAt(((0.0,0.5,0.0),))
- e3 = p.edges.findAt(((0.0,0.0,0.5),))
- p.PartitionCellByPlanePointNormal(point=(i,0,0),normal=e1[0],cells=p.cells)
- p.PartitionCellByPlanePointNormal(point=(0,i,0),normal=e2[0],cells=p.cells)
- p.PartitionCellByPlanePointNormal(point=(0,0,i),normal=e3[0],cells=p.cells)
复制代码- m = mdb.Model(name='cube1')
- s = m.ConstrainedSketch(name='square',sheetSize=100.0)
- s.Line(point1=(0.0,0.0),point2=(10.0,0.0))
- s.Line(point1=(10.0,0.0),point2=(10.0,10.0))
- s.Line(point1=(10.0,10.0),point2=(0.0,10.0))
- s.Line(point1=(0.0,10.0),point2=(0.0,0.0))
- p=m.Part(name='cube',dimensionality=THREE_D,type=DEFORMABLE_BODY)
- p.BaseSolidExtrude(sketch=s,depth=10.0)
- for i in range(1,10):
- e1 = p.edges.findAt(((i,0.0,0.0),))
- e2 = p.edges.findAt(((0.0,i,0.0),))
- e3 = p.edges.findAt(((0.0,0.0,i),))
- c1 = p.cells.findAt(((i,0.0,0.0),))
- c2 = p.cells.findAt(((0.0,i,0.0),))
- c3 = p.cells.findAt(((0.0,0.0,i),))
- p.PartitionCellByPlanePointNormal(point=(i,0,0),normal=e1[0],cells=c1)
- p.PartitionCellByPlanePointNormal(point=(0,i,0),normal=e2[0],cells=c2)
- p.PartitionCellByPlanePointNormal(point=(0,0,i),normal=e3[0],cells=c3)
复制代码
|
|