python - 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
解决方案
这部分代码在我的机器上运行没有错误。
为什么要使用样条曲线来近似圆弧?我建议您手动创建几何图形,然后检查生成的 abaqus.rpy 文件中的 Python 命令。
推荐阅读
- javascript - 在 ReactJs 中使用带有 setState 的 onclick 功能时,如何传递参数?
- powershell - 传递 Cmdlet 名称和参数的 Invoke-Command 包装函数
- html - 在移动浏览器中隐藏工具栏时使高度为 100%
- docker - 直接挂载的 NFS 卷上的 persistentVolumeReclaimPolicy - kubernetes
- javascript - 开玩笑抛出错误>类型错误:无法读取属性'user_env_variable是未定义的
- python - 从网页收集并打印事件标题
- android - 带有标签和 ViewPager 的 Android AppBarLayout
- php - laravel 500 错误:此页面无法正常工作
- .net - 达到 .NET 字典的限制——究竟是什么?
- javascript - 如何遍历 javascript 属性但跳过其中的函数?