##############################################################
## Report Displacement and Reaction Force
##############################################################
jobName = '''Name of Job'''
stepName = '''Name of Step'''
outputSetName = '''Name of Output Set'''
from odbAccess import*
from abaqusConstants import*
import string
import numpy as np
import os
odb = openOdb(path = jobName+'.odb')
outfile = open(jobName + '.csv', 'w')
outfile.write('Diaplacement' + ',' + 'Reaction Force' + '\n')
for fm in range(0, len(odb.steps[stepName].frames)):
timeFrame = odb.steps[stepName].frames[fm]
readNode = odb.rootAssembly.nodeSets[outputSetName.upper()]
Disp = timeFrame.fieldOutputs['U']
ReForce = timeFrame.fieldOutputs['RF']
readNodeDisp = Disp.getSubset(region=readNode)
readNodeDispValues = readNodeDisp.values
readNodeRF = ReForce.getSubset(region=readNode)
readNodeRFValues = readNodeRF.values
Displacement = np.zeros(len(odb.steps[stepName].frames))
ReactionForce = np.zeros(len(odb.steps[stepName].frames))
Displacement[fm] = readNodeDispValues[0].data[0] # 0-X Direction; 1-Y Direction; 2-Z Direction
ReactionForce[fm] = readNodeRFValues[0].data[0]
outfile.write(str(Displacement[fm]) + ',' + str(ReactionForce[fm]) + ',' + '\n')
outfile.close()
odb.close()