- 积分
- 0
- 注册时间
- 2009-10-30
- 仿真币
-
- 最后登录
- 1970-1-1
|
用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
查看全部评分
-
|