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

[后处理] Freebodycut 提取实体单元界面合力

[复制链接]
发表于 2012-3-24 21:42:20 | 显示全部楼层 |阅读模式 来自 欧洲
用python非常方便,成千上万的数据也就1,2分钟处理完毕。
这里首先要弄清楚step 和 frame
然后在odb数据库里摘一下就OK
一下是命令

from abaqus import *
from odbAccess import *
from abaqusConstants import *
from viewerModules import *
import os
import glob
####################################################################################################################################################################################################################################################################
#OPEN
odbName=glob.glob('*.odb')
Path=os.getcwd()
odb=openOdb(odbName[0])
#############################################################################################################################################################################################################################################
#DISPLAY OPTIONAL
session.viewports['Viewport: 1'].setValues(displayedObject=odb)
session.viewports['Viewport: 1'].odbDisplay
#############################################################################################################################################################################################################################################
# NUMBER OF STEPS
numSteps=len(odb.steps)
print odb.steps.values()
#
#
#############################################################################################################################################################################################################################################
#NUMBER OF FRAMES IN EACH STEPS
for stepName in odb.steps.keys():
      print stepName

#
numSteps=len(odb.steps.keys())
print odb.steps.values()
stepseis=odb.steps.values()[2]
print stepseis.name
numFrames=len(stepseis.frames)
print numFrames
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
hisregtions=stepseis.historyRegions
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
###############################################################################
session.viewports['Viewport: 1'].odbDisplay.freeBodyOptions.setValues(
     sizePercentageM=5, showComp1M=OFF, showComp2M=OFF, showForce=OFF,
    vectorDisplay=VECTOR_COMPONENT)
###############################################################################
###############################################################################
###############################################################################
###        FREEBODYCUT
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-1', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-1', ))
session.FreeBodyFromNodesElements(name='FreeBody-1', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-2', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-2', ))
session.FreeBodyFromNodesElements(name='FreeBody-2', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-3', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-3', ))
session.FreeBodyFromNodesElements(name='FreeBody-3', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-4', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-4', ))
session.FreeBodyFromNodesElements(name='FreeBody-4', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-5', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-5', ))
session.FreeBodyFromNodesElements(name='FreeBody-5', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-6', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-6', ))
session.FreeBodyFromNodesElements(name='FreeBody-6', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-7', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-7', ))
session.FreeBodyFromNodesElements(name='FreeBody-7', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-8', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-8', ))
session.FreeBodyFromNodesElements(name='FreeBody-8', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-9', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-9', ))
session.FreeBodyFromNodesElements(name='FreeBody-9', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-10', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-10', ))
session.FreeBodyFromNodesElements(name='FreeBody-10', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-11', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-11', ))
session.FreeBodyFromNodesElements(name='FreeBody-11', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-12', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-12', ))
session.FreeBodyFromNodesElements(name='FreeBody-12', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-13', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-13', ))
session.FreeBodyFromNodesElements(name='FreeBody-13', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-14', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-14', ))
session.FreeBodyFromNodesElements(name='FreeBody-14', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-15', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-15', ))
session.FreeBodyFromNodesElements(name='FreeBody-15', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-16', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-16', ))
session.FreeBodyFromNodesElements(name='FreeBody-16', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-17', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-17', ))
session.FreeBodyFromNodesElements(name='FreeBody-17', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-18', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-18', ))
session.FreeBodyFromNodesElements(name='FreeBody-18', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-19', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-19', ))
session.FreeBodyFromNodesElements(name='FreeBody-19', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-20', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-20', ))
session.FreeBodyFromNodesElements(name='FreeBody-20', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-21', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-21', ))
session.FreeBodyFromNodesElements(name='FreeBody-21', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-22', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-22', ))
session.FreeBodyFromNodesElements(name='FreeBody-22', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-23', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-23', ))
session.FreeBodyFromNodesElements(name='FreeBody-23', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
eLeaf = dgo.LeafFromElementSets(elementSets=('P7-E-24', ))
nLeaf = dgo.LeafFromNodeSets(nodeSets=('P7-N-24', ))
session.FreeBodyFromNodesElements(name='FreeBody-24', elements=eLeaf,
    nodes=nLeaf, summationLoc=CENTROID, componentResolution=NORMAL_TANGENTIAL)
###############################################################################
###############################################################################
###############################################################################
session.viewports['Viewport: 1'].odbDisplay.setValues(freeBodyNames=(
     'FreeBody-24', 'FreeBody-23', 'FreeBody-22', 'FreeBody-21', 'FreeBody-20',
    'FreeBody-19', 'FreeBody-18', 'FreeBody-17', 'FreeBody-16', 'FreeBody-15',
    'FreeBody-14', 'FreeBody-13', 'FreeBody-12', 'FreeBody-11', 'FreeBody-10',
    'FreeBody-9', 'FreeBody-8', 'FreeBody-7', 'FreeBody-6', 'FreeBody-5',
    'FreeBody-4', 'FreeBody-3', 'FreeBody-2', 'FreeBody-1', ), freeBody=ON)
###############################################################################
###############################################################################
###############################################################################
path=odb.name
for stepfram in stepseis.frames:
      session.viewports['Viewport: 1'].odbDisplay.setFrame(step=(numSteps-1), frame=stepfram.frameId)
      odb = session.odbs[path]
      session.writeFreeBodyReport(fileName='Bendingp7.txt', append=ON, step=(numSteps-1), frame=stepfram.frameId, odb=odb)

###############################################################################

评分

1

查看全部评分

发表于 2013-6-11 16:30:05 | 显示全部楼层 来自 黑龙江哈尔滨
Simdroid开发平台
楼主,多解释一下吧
回复 不支持

使用道具 举报

发表于 2013-6-11 16:45:20 | 显示全部楼层 来自 江苏南京
qqqqqqy 发表于 2013-6-11 16:30
楼主,多解释一下吧

我整理过读取fieldoutputs数据的帖子,historyoutputs数据的读取方法可以参考,没有整理进去,只要熟悉了odb的数据结构,读取数据很简单。
http://forum.simwe.com/thread-1075473-1-1.html
回复 不支持

使用道具 举报

发表于 2013-6-11 22:07:22 | 显示全部楼层 来自 黑龙江哈尔滨
kxh86 发表于 2013-6-11 16:45
我整理过读取fieldoutputs数据的帖子,historyoutputs数据的读取方法可以参考,没有整理进去,只要熟悉了 ...

好好看看
回复 不支持

使用道具 举报

发表于 2013-12-21 06:59:04 | 显示全部楼层 来自 山东济南
先学习学习
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-4 19:00 , Processed in 0.037255 second(s), 15 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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