How to read averaged nodal stress from abaqus odb file using python script?
<p>I know how to read element or element node stress value (unaveraged) using python script.</p>

<pre><code>field = stressField.getSubset(region=topCenter,position=INTEGRATION_POINT, elementType = 'CAX4')
</code></pre>

<p>But i want averaged stress values at nodes. FYI, my odb does not contain node position data for stress (i.e., position=NODAL). </p>

<p>this is one of those things that way more cumbersome than it should be.
you need to create  xydata :</p>

<pre><code>session.xyDataListFromField(odb=odb,
        outputPosition=ELEMENT_NODAL,
        variable=(( 'S', INTEGRATION_POINT), ),
        elementSets=('PART-1-1.SETNAME', ))
</code></pre>

<p>this creates a dictionary with objects for every node of every element and every stress component (ie. huge).  Unfortunately the dictionary is keyed by cumbersome descriptor strings, eg:</p>

<pre><code> session.xyDataObjects['S:S11 PI:PART-1-1 E: 15 N:2'].data
</code></pre>

<p>gives the 11 stress component of node 2 associated with element 15.  To make use of the data in a script you need to either construct the strings, or loop over the dictionary and parse the <code>positionDescription</code> for each object.</p>

<p>Edit: if you want the nodal averages its pretty much the same. You do: </p>

<pre><code>session.xyDataListFromField(odb=odb,
        outputPosition=NODAL,
        variable=(( 'S', INTEGRATION_POINT), ),
        nodeSets=('PART-1-1.SETNAME', ))
</code></pre>

<p>and the dictionary objects are keyed like:</p>

<pre><code> session.xyDataObjects['S:S11 (Avg: 75%) PI:PART-1-1 N:2'].data
</code></pre>

<p>note you can issue multiple <code>session.xyDataListFromField</code> calls and all of the data goes into <code>xyDataObjects</code> (For example if you want stress and strain you can process both at once. )</p>

<p>For completeness, if you only want a specific component(s) you can request as:</p>

<pre><code> variable=(( 'S', INTEGRATION_POINT,((COMPONENT, 'S11'),)), )
</code></pre>

python abaqus stress odb