get_field for CBEAM

8 views
Skip to first unread message

clarkbr...@gmail.com

unread,
Feb 12, 2021, 4:30:03 PM2/12/21
to pyNastran Discuss

Steve,
I'm still trying to figure out how stuff works. Here is an FYI. Doesn't seem right to me, but..

model.Element(3001)
Out[100]:
$inboard right upper spar 0 caps for wing
CBEAM       3001    3001    3007    3034     -1.      0.      0.

Walking through the fields:
model.Element(3001).get_field(1)
Out[105]: 3001

model.Element(3001).get_field(2)
Out[106]: 3001

model.Element(3001).get_field(3)
Out[107]: 3013

model.Element(3001).get_field(4)
Out[108]: 3034
Unit 5,6, & 7 balk like
model.Element(3001).get_field(5)
Traceback (most recent call last):

  File "C:\ProgramData\Anaconda3\lib\site-packages\pyNastran\bdf\cards\base_card.py", line 196, in get_field
    key_name = self._field_map[n]

KeyError: 5

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "<ipython-input-109-d896041b9213>", line 1, in <module>
    model.Element(3001).get_field(5)

  File "C:\ProgramData\Anaconda3\lib\site-packages\pyNastran\bdf\cards\base_card.py", line 199, in get_field
    value = self._get_field_helper(n)

  File "C:\ProgramData\Anaconda3\lib\site-packages\pyNastran\bdf\cards\base_card.py", line 170, in _get_field_helper
    raise IndexError(msg)

IndexError: CBEAM has not overwritten _get_field_helper; out of range

Turns out this is the x vector trio and the x parm/attr will get it
model.Element(3001).x
Out[111]: array([-1.,  0.,  0.])

Clark


Steven Doyle

unread,
Feb 12, 2021, 5:12:57 PM2/12/21
to pyNastran Discuss
Clark,

It looks the get_field method isn't supported for the CBEAM.

Personally, I use the g0/x method.  It's really meant for something general like OpenMDAO.

Steve

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/pynastran-discuss/0d124e12-da22-4b6c-90ec-323020aa5dc8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages