Re: Reading displacements from op2 not working as expected

49 views
Skip to first unread message

Steven Doyle

unread,
Sep 26, 2013, 10:48:55 PM9/26/13
to Ryan McClelland, pynast...@googlegroups.com
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, <rmc...@gmail.com> 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.
eg:
----
from pyNastran.op2.op2 import OP2

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

# read the OP2
op2r.readOP2()

# read the displacement dictionary
disps=op2r.displacements

# take item 1 of the disps dictionary, which seems to be the displacement dict
disps2=disps.get(1)

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

# copy the rotations into a dict xyz, node numbers are keys
rxyz=trans.rotations
----

--
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 pynastran-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages