phd-scripts/Biomaterials13/StudyP1/post.py

31 lines
864 B
Python
Raw Normal View History

2024-05-13 19:50:21 +00:00
# Import Neccesary Abaqus Modules
from abaqusConstants import *
from odbAccess import *
import sys
import os
resFile='E6R.dat'
outFile = open(resFile,"w")
for i in range(1,6):
jobName='E6R'+str(i)
odbfilename=jobName+'.odb'
odb=openOdb(path=odbfilename)
j=0.
for eachFrame in odb.steps["Step-5"].frames:
j=j+1
aSet=odb.rootAssembly.instances['GEOM-1'].nodeSets['BCT']
cforce=0.
for currentForce in eachFrame.fieldOutputs["RF"].getSubset(region=aSet).values:
cforce=cforce+currentForce.data[1]
bSet=odb.rootAssembly.instances['GEOM-1'].nodeSets['BC4']
disp=eachFrame.fieldOutputs["U"].getSubset(region=bSet).values[0].data[1]
if j==2:
cf2=cforce
d2=disp
elif j==4:
cf4=cforce
d4=disp
stiff=abs(cf4-cf2)/abs(d4-d2)
outFile.write("%12.6f \n " % (stiff))
break
odb.close()
outFile.close()