0

I'm trying to extract von mises values using python scripting in ABAQUS using this code below (BTW I can extracted temperature using similar code) :

import xlwt
import numpy as np
from odbAccess import *

odb = visualization.openOdb('C:/Users/'+Name+'.odb')
    frame=odb.steps['AStep'].frames[-1]

    dispNode = odb.rootAssembly.nodeSets['UPPER']

    TEMP= frame.fieldOutputs['S'].getSubset(region=dispNode).values
    COORD= frame.fieldOutputs['COORD'].getSubset(region=dispNode).values
   sortie = open('Resu_PE_maillage.txt', 'w')

    book = xlwt.Workbook()
    sh = book.add_sheet("sheet")

    col1_name = 'X Coordinate'
    col2_name = 'Y Coordinate'
    col3_name = 'Z Coordinate'
    col4_name = 'Stress'

    sh.write(0, 0, col1_name)
    sh.write(0, 1, col2_name)
    sh.write(0, 2, col3_name)
    sh.write(0, 3, col4_name)

    for NT in range(1,len(TEMP)):
        sh.row(NT).set_cell_number(0,COORD[NT].data[0])
        sh.row(NT).set_cell_number(1,COORD[NT].data[1])
        sh.row(NT).set_cell_number(2,COORD[NT].data[2])
        sh.row(NT).set_cell_number(3,TEMP[NT].data[1])

    if i<10:
        book.save('C:/Users/'+'00'+str(i)+'.xls')
    if 9<i<100:
        book.save('C:/Users/'+'0'+str(i)+'.xls')
    if 99<i<1000:
        book.save('C:/Users/'+str(i)+'.xls')

But it doesn't work for stress.

Can you tell me why??

H.H
  • 188
  • 1
  • 13
  • What does the data look like? Can you add a few rows? Otherwise, it's hard to tell what's not working. – scooter me fecit Oct 09 '16 at 18:30
  • stress is by default not available on the nodes. you can use `xyDataListFromField` (which extrapolates values and is a bit slow) see here.. http://stackoverflow.com/a/39708953/1004168 – agentp Oct 09 '16 at 23:26
  • you can alternately put `*Element Output, POSITION=NODES` in the inp file before running the analysis. Beware, that way you get separate stress value from each element that shares a node. – agentp Oct 09 '16 at 23:37
  • How can I do that? Could you write an example code?? – H.H Oct 18 '16 at 07:53

0 Answers0