Re: Reading displacements from op2 not working as expected

Skip to first unread message

Steven Doyle

Sep 26, 2013, 10:48:55 PM9/26/13
to Ryan McClelland,
Op2.displacements is a dictionary where the key is the subcase number and the value is a DisplacmentObject (or ComplexDisplacementObject).  I'm 99% sure if you don't define a subcase section in your BDF/DAT/NAS file, the OP2 will contain a subcase number of 1.

There should be no rounding on any of the results in the OP2.  If there is any loss of precision by the BDF/F06/OP2, it's a bug.  That said, if you use

>>> print op2.displacements[1]

it returns a table that rounds the outputs, which was helpful during development.  Just ignore it.  It's going away in the next version anyways because it's a memory hog for large files.  You can use the __repr__ method to see how it's printing the data though.

On Thu, Sep 26, 2013 at 12:18 PM, <> wrote:
I think I figured it out. op2.displacements returns a dictionary with a key 1 and object class 'pyNastran.op2.tables.oug.oug_displacements.DisplacementObject'

I had to pull this object out of the dict and use it's methods.
from pyNastran.op2.op2 import OP2

op2r = OP2('485p1005.op2',make_geom=False,debug=False,log=None)

# read the OP2

# read the displacement dictionary

# take item 1 of the disps dictionary, which seems to be the displacement dict

# copy the translations into a dict xyz, node numbers are keys

# copy the rotations into a dict xyz, node numbers are keys

You received this message because you are subscribed to the Google Groups "pyNastran dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Reply all
Reply to author
0 new messages