找回密码
 注册
Simdroid-非首页
查看: 289|回复: 4

接触分析中如何用Python读取接触支反力总和CFN

[复制链接]
发表于 2006-11-21 22:44:47 | 显示全部楼层 |阅读模式 来自 陕西西安
这是帮助中的一个例子,我想把它改成能读取接触支反力总和的程序,粗体部分应该怎么写
from odbAccess import *

odb = openOdb(path='B2_half.odb')
step2 = odb.steps['Step-1']
region = step2.historyRegions['ContactPair']
u2Data = region.historyOutputs['CFN1'].data
dispFile = open('disp.dat','w')
for time, u2Disp in u2Data:
    dispFile.write('%10.4E   %10.4E\n' % (time, u2Disp))
dispFile.close()
我在inp文件中定义的接触对如下:
**
** INTERACTION PROPERTIES
**
*Surface Interaction, name=IntProp-1
1.,
*Surface Behavior, pressure-overclosure=HARD
**
** INTERACTIONS
**
** Interaction: Int-1
*Contact Pair, interaction=IntProp-1
_PickedSet13_CNS_, PART-2-1.RigidSurface_
输出为:
** HISTORY OUTPUT: H-Output-1
**
*Output, history
*Contact Output
CFN,
*El Print, freq=999999
*Node Print, freq=999999
*End Step

[ 本帖最后由 maple6 于 2006-11-21 22:46 编辑 ]
发表于 2006-11-22 00:22:29 | 显示全部楼层 来自 清华大学
Simdroid开发平台
在comregion = step2.historyRegions['ContactPair']
之前加一句
print  step2.historyRegions,

看看这个squence有多少个分量,然后再改你的python脚本

[ 本帖最后由 lxm9977 于 2006-11-22 00:24 编辑 ]

评分

1

查看全部评分

 楼主| 发表于 2006-11-22 20:54:36 | 显示全部楼层 来自 陕西西安
谢谢lxm9977 ,用你的方法已经把接触的总支反力读出来了
发表于 2006-11-23 13:16:42 | 显示全部楼层 来自 澳大利亚
maple6 可不可以贴出来完整的代码,看看
发表于 2006-11-24 19:28:34 | 显示全部楼层 来自 德国
啊?这些代码是写出来的吗?不是通过录制宏产生的?为什么不通过录制宏产生这些代码呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-5-22 05:47 , Processed in 0.041832 second(s), 18 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表