首页 > 解决方案 > Python Abaqus:序列中的索引超出范围

问题描述

我已经为一个半球体编写了一个代码,其中有一个洞。当我在 abaqus 中运行代码时,它显示了几个与索引序列超出范围有关的警告。我已经尝试了一切,但无法找到错误。有人可以帮忙吗。

部分代码:在此处输入代码

t = 1.0; # shell thickness
Re = 40.0 # radius 
Ri = 5.0 # hole radius
o = 30; # number of points to define cap
A = 10.0; # cap apex height
d = 1.8*A # actuated distance
th = 2*math.pi;
meshsize=1.3;

  

m=mdb.models['Model-1']
s=mdb.models['Model-1'].ConstrainedSketch(name='__profile__', sheetSize=200.0)
s.ConstructionLine(point1=(0.0, -100.0), point2=(0.0, 100.0))
s.FixedConstraint(entity=s.geometry[2])
# sphere cap
n = np.linspace(start=1, stop=th, num=128, endpoint=False)
x = [Re*(math.cos(th*float(i)))+(Ri+(float(i))) for i in (n)];
y = [Re*(math.sin(th*float(i))) for i in (n)];
w = np.int_(x)
z = np.int_(y)
points=[];
l = len(n);
for i in (n):
    points.append([w[i], z[i]])
    
s.Spline(points=points)
p=m.Part(dimensionality=THREE_D, name='structure', type=DEFORMABLE_BODY)
p.BaseShellRevolve(angle=360.0, flipRevolveDirection=OFF,sketch=s)
del s

标签: pythonabaqus

解决方案


这部分代码在我的机器上运行没有错误。

为什么要使用样条曲线来近似圆弧?我建议您手动创建几何图形,然后检查生成的 abaqus.rpy 文件中的 Python 命令。


推荐阅读