我有以下代码:
for stepi in range(0, nsteps): #number of steps (each step contains a number of frames)
stepName = odb.steps.values()[stepi].name #step name
for framei in range(0, len(odb.steps[stepName].frames)): #loop over the frames of stepi
for v in odb.steps[stepName].frames[framei].fieldOutputs['UT'].values: #for each framei get the displacement (UT) results for each node
for line in nodes: #nodes is a list with data of nodes (nodeID, x coordinate, y coordinate and z coordinate)
nodeID, x, y, z = line
if int(nodeID)==int(v.nodeLabel): #if nodeID in nodes = nodeID in results
if float(x)==float(coordXF) and float(y)==float(coordYF): #if x=predifined value X and y=predifined value Y
#Criteria 1: Find maximum displacement for x=X and y=Y
if abs(v.data[0]) >uFmax: #maximum UX
uFmax=abs(v.data[0])
tuFmax='U1'
stepuFmax=stepi
nodeuFmax=v.nodeLabel
incuFmax=framei
if abs(v.data[1]) >uFmax: #maximum UY
uFmax=abs(v.data[1])
tuFmax='U2'
stepuFmax=stepi
nodeuFmax=v.nodeLabel
incuFmax=framei
if abs(v.data[2]) >uFmax: #maximum UZ
uFmax=abs(v.data[2])
tuFmax='U3'
stepuFmax=stepi
nodeuFmax=v.nodeLabel
incuFmax=framei
#Criteria 2: Find maximum UX, UY, UZ displacement for x=X and y=Y
if abs(v.data[0]) >u1Fmax: #maximum UX
u1Fmax=abs(v.data[0])
stepu1Fmax=stepi
nodeu1Fmax=v.nodeLabel
incu1Fmax=framei
if abs(v.data[1]) >u2Fmax: #maximum UY
u2Fmax=abs(v.data[1])
stepu2Fmax=stepi
nodeu2Fmax=v.nodeLabel
incu2Fmax=framei
if abs(v.data[2]) >u3Fmax: #maximum UZ
u3Fmax=abs(v.data[2])
stepu3Fmax=stepi
nodeu3Fmax=v.nodeLabel
incu3Fmax=framei
#Criteria 3: Find maximum U displacement
if abs(v.data[0]) >umax: #maximum UX
umax=abs(v.data[0])
tu='U1'
stepumax=stepi
nodeumax=v.nodeLabel
incumax=framei
if abs(v.data[1]) >umax: #maximum UY
umax=abs(v.data[1])
tu='U2'
stepumax=stepi
nodeumax=v.nodeLabel
incumax=framei
if abs(v.data[2]) >umax: #maximum UZ
umax=abs(v.data[2])
tu='U3'
stepumax=stepi
nodeumax=v.nodeLabel
incumax=framei
#Criteria 4: Find maximum UX, UY, UZ displacement
if abs(v.data[0]) >u1max: #maximum UX
u1max=abs(v.data[0])
stepu1max=stepi
nodeu1max=v.nodeLabel
incu1max=framei
if abs(v.data[1]) >u2max: #maximum UY
u2max=abs(v.data[1])
stepu2max=stepi
nodeu2max=v.nodeLabel
incu2max=framei
if abs(v.data[2]) >u3max: #maximum UZ
u3max=abs(v.data[2])
stepu3max=stepi
nodeu3max=v.nodeLabel
incu3max=framei
此代码访问由数值分析程序创建的结果数据库文件,并在给定某些不同标准的情况下检索土木工程结构变形形状的最大位移。问题是这段代码需要大约 10 分钟才能运行。os 步数可能是nsteps
1 到 4,帧数(framei
nodes