Need help writing DMIG in correct format using pyNastran

818 views
Skip to first unread message

empennage

unread,
Jul 10, 2017, 4:38:52 PM7/10/17
to pyNastran Discuss
pyNastran version: 1.0.0
python version: 2.7.11
NX Nastran v10.2
Windows 7 64-bit

I want to use pyNastran to write a DMIG stiffness matrix for NX Nastran. However, I am getting the following Fatal error message:

*** USER FATAL MESSAGE 316 (IFPDRV)
     ILLEGAL DATA ON BULK DATA ENTRY DMIG   
     User information:
     See Bulk Data entry description in Section 5 of the NX NASTRAN
     Quick Reference Guide. If you are using the large field format make
     sure the number of entries is even.
 DMIG        KAAX       1       1               1       110635.31
        


I have attached the Nastran files that replicate the fatal error message. The correctly formatted file is matrix_spring.dat with spring.pch as an include file DMIG. And, the fatal run is matrix_spring_pynastran.dat.

from pyNastran.bdf.bdf import BDF

# Create BDF object in pyNastran
model
= BDF()
model
.read_bdf('matrix_spring.dat')
dmig
= model.dmigs.copy()
export = BDF()

# Export DMIG entries
export.add_dmig('KAAX', dmig['KAAX'].ifo, dmig['KAAX'].tin, dmig['KAAX'].tout,
                dmig
['KAAX'].polar, dmig['KAAX'].ncols, dmig['KAAX'].GCj, dmig['KAAX'].GCi,
                dmig
['KAAX'].Real, Complex=None, comment='Export DMIG Matrix')

export.write_bdf('dmig.bdf')

Let me know if you need any additional information.
dmig.bdf
matrix_spring.dat
matrix_spring_pynastran.dat
read_dmig.py
spring.pch

Steven Doyle

unread,
Jul 10, 2017, 5:02:24 PM7/10/17
to pyNastran Discuss
Your data is formatted incorrectly.  Per the QRG:

The header entry containing IFO, TIN and TOUT is required. Each nonnull
column is started with a GJ, CJ pair. The entries for each row of that column
follows. Only nonzero terms need be entered. The terms may be input in
arbitrary order. A GJ, CJ pair may be entered more than once, but input of
an element of the matrix more than once will produce a fatal message.

--
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-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steven Doyle

unread,
Jul 10, 2017, 5:47:38 PM7/10/17
to pyNastran Discuss
Nevermind...I think I read the table wrong.

You requested that the data be in double precision (TIN=2), but you output the data in single precision (TIN=1).  You need to either update TIN to be 1 or change your write statement to be:

    export.write_bdf('dmig.bdf', size=16, is_double=True)

The code should probably be updated to just ignore the write_bdf flags for matrices.  Nastran is a bit complicated :)

empennage

unread,
Jul 10, 2017, 5:58:32 PM7/10/17
to pyNastran Discuss
Thanks, that worked! I'm very grateful for your quick response.
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