Home > other >  Python code is wrong, who is a great god can explain the no
Python code is wrong, who is a great god can explain the no

Time:11-27

Which can explain the great god, the following code if there is a mistake, thank you
 # - * - coding: utf-8 - * - 

The from odbAccess import *
The from abaqusConstants import *

The import sys # import system module
Import string # import string processing module

Print 'begin abaqus python'
Print 'this code is for obd process'

Odb=openOdb (path='random. Odb') # open the odb file
MyAssembly=odb. RootAssembly

S=sys. Argv [2]
F=open (s, 'w') # open the output file
F.w rite (' TITLE=the output RMS for radom response analysis')
F.w rite (' VARIABLES="element", "Mises" \ n ')
FrameLen=len (odb) steps [r]. 'Step - 2 frames)
Destframe=int (sys. Argv [1]) # entry need to extract the frequency of the frame number
I=destframe
L=1
While iFrame=odb. Steps [r]. 'Step - 2 frames [1]
RootMeanStress=Frame. FieldOutputs [' RS ']
RSValues=RootMeanStress. Values
Count=len (RSValues) # print count
Mises=range (0, count);
EleLab=range (0, count); # print len (EleLab), len (mises)
For the range in l (0, count) :
Val=RSValues [1].
Data=https://bbs.csdn.net/topics/val.data
DataLen=len (data)
S11=data [0]
S22=data [1]
S33=data [2]
Speed 12=data [3]
Mises2=s22 + s33 s11 + s22 s11 * * * * s33-1.0/3.0 (s11 + s22 + s33) * (s11 + s22 + s33) # RMS mises stress
Ises] [l - 1=SQRT (mises2)
EleLab] [l - 1=val. ElementLabel
# print "S:", val. ElementLabel, SQRT (mises2)
# f.w rite (" hi \ n ")
Sel=STR (val. ElementLabel)
Smi=STR (SQRT (mises2))
F.w rite (sel)
F.w rite (' \ t ')
F.w rite (' \ t ')
F.w rite (smi)
F.w rite (' \ t ')
F.w rite (' \ n ')
I=I + 1
# f.w rite (' the end of the process ')
F. lose ()
  • Related