Reading or ignoring CBUSH elements from OP2

107 views
Skip to first unread message

Philip Moseley

unread,
May 4, 2021, 6:24:08 AM5/4/21
to pyNastran Discuss
Hello Steve,

I've got a model with CBUSH elements, i.e.:
PBUSH    28      K       500000.2500000.2500000.
                 RCV     1.      1.      1.      1.
CBUSH   19925366 28     3565342835653429                         352
         .5

I'm running with MSC 2021, and I'm unable to read the Nastran OP2 file using read_op2 with load_geometry=True. I get the following error:
failed reading b'EPT' isubtable=-5
Traceback (most recent call last):
  File "D:\DATA_SLOW\TOOLS\FATIGUE_CALCULATOR\python-3.7.7.amd64\lib\site-packages\pynastran-1.4.0+dev.76717dbf9-py3.7.egg\pyNastran\op2\tables\geom\geom2.py", line 1802, in _read_dual_card
    n, elements = msc_read(data, n0)
  File "D:\DATA_SLOW\TOOLS\FATIGUE_CALCULATOR\python-3.7.7.amd64\lib\site-packages\pynastran-1.4.0+dev.76717dbf9-py3.7.egg\pyNastran\op2\tables\geom\ept.py", line 1369, in _read_pbush_msc
    assert ndata % ntotal == 0, f'table={self.table_name} leftover = {ndata} % {ntotal} = {ndata % ntotal}'
AssertionError: table=b'EPT' leftover = 648 % 92 = 4


Digging in, I see the comments in ept.py say new CBUSH elements aren't supported:
    def _read_pbush(self, data: bytes, n: int) -> int:
        """
        The PBUSH card is different between MSC and NX Nastran.

        DMAP NX 11
        ----------
        NX has 23 fields in NX 11 (supported)
        NX has 18 fields in the pre-2001 format (supported)

        DMAP MSC 2005
        -------------
        MSC has 23 fields in 2005 (supported)
        MSC has 18 fields in the pre-2001 format (supported)

        DMAP MSC 2016
        -------------
        TODO: MSC has 24 fields in 2016.1 (not supported)
        MSC has 18 fields in the pre-2001 format (supported)
        """

FYI, MSC 2021 has 27 fields now. Is there a way to skip this geometry? Or another workaround? I don't care about the CBUSH elements, but I need the rest of the geometry.

I could send some example files from MSC 2021 if it helps.

Thanks,
Philip

steve

unread,
May 4, 2021, 11:30:57 AM5/4/21
to pyNastran Discuss
It looks like they changed it in MSC 2021.  If you have a small example, I can add support for it.

You can skip the PBUSH by deleting the map to the function (so the passer gets called):
model = OP2Geom()
del model._ept_map[(1402,14,37)]   # (1402,14,37) is the PBUSH flag in the DMAP guide
model.read_op2(op2_filename)

If that doesn't work :), try:
model = OP2Geom()
model._ept_map[(1402,14,37)] : ['PBUSH', model._read_fake]
model.read_op2(op2_filename)

Philip Moseley

unread,
May 4, 2021, 12:34:10 PM5/4/21
to pynastra...@googlegroups.com
I've attached a small CBUSH example that runs with Nastran 2021.
image.png
image.png
image.png

image.png
image.png
image.png



I quickly checked the "del model._ept_map[(1402,14,37)]", looks very interesting. First challenge is that the OP2Geom.read_op2() command doesn't cover all the same parameters as the read_op2() does (notably for me, the "exclude_results"). Seems like it would be an easy fix though, since the read_op2_geom() function does support it, just copy the same commands?

Thanks for your help!

--
You received this message because you are subscribed to a topic in the Google Groups "pyNastran Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pynastran-discuss/kFf6trWZBy0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pynastran-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pynastran-discuss/2727fedb-f823-4d79-9f00-32b341ba5335n%40googlegroups.com.
cbush_testing.zip

Steven Doyle

unread,
May 4, 2021, 12:45:45 PM5/4/21
to pyNastran Discuss
Thank you for that.  Could you also take a screenshot of the DMAP guide PBUSH page?  It should look similar to this:
image.png

Regarding the include/exclude results, you can call:
    model.include_exclude_results(exclude_results=exclude_results,
                                  include_results=include_results)


Steven Doyle

unread,
May 4, 2021, 4:08:08 PM5/4/21
to pyNastran Discuss
Oh and I guess while you're at it, can you take some pictures of the QRG and DMAP guide for the RBE3.  It changed.

Cean Wang

unread,
Aug 3, 2023, 10:50:02 PM8/3/23
to pynastra...@googlegroups.com

Where is OP2Geom() defined?

 

Sent from Mail for Windows

--
You received this message because you are subscribed to the Google Groups "pyNastran Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynastran-disc...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages