Import nastran nodes deck in Python using numpy

前端 未结 2 1024
野趣味
野趣味 2021-01-28 15:26

If I want to import a Nastran Deck into a Python Array, in one fell swoop using numpy. How can I go about it? Where am I going wrong?

I have a file with only Grids in it

2条回答
  •  逝去的感伤
    2021-01-28 15:57

    instead of numpy, perhaps pyNastran would work? https://github.com/SteveDoyle2/pyNastran

    this examples prints nodes

    import pyNastran
    from pyNastran.bdf.bdf import BDF
    model = BDF()
    model.read_bdf('inputdeck.bdf', xref=True)
    model.nodes
    {1: GRID           1              8.      3.      0.,
     2: GRID           2              8.      9.      0.,
     3: GRID           3              8.     11.      0.,
     4: GRID           4              8.     13.      0.,
     5: GRID           5             -8.      3.      0.,
     6: GRID           6             -8.      9.      0.,
     7: GRID           7             -8.     11.      0.,
     8: GRID           8             -8.     13.      0.,
     9: GRID           9              2.      5.      0.}
    

提交回复
热议问题