dmig Module

digraph inheritance7e81fc2f4a { bgcolor=transparent; rankdir=LR; size=""; "pyNastran.bdf.cards.base_card.BaseCard" [URL="pyNastran.bdf.cards.base_card.html#pyNastran.bdf.cards.base_card.BaseCard",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Defines a series of base methods for every card class"]; "pyNastran.bdf.cards.dmig.DMI" [URL="#pyNastran.bdf.cards.dmig.DMI",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="+------+-------+------+------+---------+----------+-----------+-----------+------+"]; "pyNastran.bdf.cards.dmig.NastranMatrix" -> "pyNastran.bdf.cards.dmig.DMI" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.bdf.cards.dmig.DMIAX" [URL="#pyNastran.bdf.cards.dmig.DMIAX",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Direct Matrix Input for Axisymmetric Analysis"]; "pyNastran.bdf.cards.base_card.BaseCard" -> "pyNastran.bdf.cards.dmig.DMIAX" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.bdf.cards.dmig.DMIG" [URL="#pyNastran.bdf.cards.dmig.DMIG",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Defines direct input matrices related to grid, extra, and/or scalar points."]; "pyNastran.bdf.cards.dmig.NastranMatrix" -> "pyNastran.bdf.cards.dmig.DMIG" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.bdf.cards.dmig.DMIG_UACCEL" [URL="#pyNastran.bdf.cards.dmig.DMIG_UACCEL",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Direct Matrix Input of Enforced Static Acceleration"]; "pyNastran.bdf.cards.base_card.BaseCard" -> "pyNastran.bdf.cards.dmig.DMIG_UACCEL" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.bdf.cards.dmig.DMIJ" [URL="#pyNastran.bdf.cards.dmig.DMIJ",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Direct Matrix Input at js-Set of the Aerodynamic Mesh"]; "pyNastran.bdf.cards.dmig.NastranMatrix" -> "pyNastran.bdf.cards.dmig.DMIJ" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.bdf.cards.dmig.DMIJI" [URL="#pyNastran.bdf.cards.dmig.DMIJI",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Direct Matrix Input at js-Set of the Interference Body"]; "pyNastran.bdf.cards.dmig.NastranMatrix" -> "pyNastran.bdf.cards.dmig.DMIJI" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.bdf.cards.dmig.DMIK" [URL="#pyNastran.bdf.cards.dmig.DMIK",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Direct Matrix Input at ks-Set of the Aerodynamic Mesh"]; "pyNastran.bdf.cards.dmig.NastranMatrix" -> "pyNastran.bdf.cards.dmig.DMIK" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.bdf.cards.dmig.DTI" [URL="#pyNastran.bdf.cards.dmig.DTI",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="+-----+-------+-----+------+-------+--------+------+-------------+"]; "pyNastran.bdf.cards.base_card.BaseCard" -> "pyNastran.bdf.cards.dmig.DTI" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.bdf.cards.dmig.DTI_UNITS" [URL="#pyNastran.bdf.cards.dmig.DTI_UNITS",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="+-----+-------+-----+------+-------+--------+------+-------------+"]; "pyNastran.bdf.cards.base_card.BaseCard" -> "pyNastran.bdf.cards.dmig.DTI_UNITS" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.bdf.cards.dmig.NastranMatrix" [URL="#pyNastran.bdf.cards.dmig.NastranMatrix",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for the DMIG, DMIJ, DMIJI, DMIK matrices"]; "pyNastran.bdf.cards.base_card.BaseCard" -> "pyNastran.bdf.cards.dmig.NastranMatrix" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class pyNastran.bdf.cards.dmig.DMI(name: str, matrix_form: int, tin: int, tout: int, nrows: int, ncols: int, GCj, GCi, Real, Complex=None, comment='', finalize=True)[source]

Bases: NastranMatrix

1

2

3

4

5

6

7

8

9

DMI

NAME

0

FORM

TIN

TOUT

M

N

DMI

NAME

J

I1

A(I1,J)

A(I1,J)

A(I1+1,J)

A(I1+2,J)

etc.

I2

etc.

Creates a NastranMatrix

Parameters:
namestr

the name of the matrix

matrix_formint

matrix shape 4=Lower Triangular 5=Upper Triangular 6=Symmetric 8=Identity (m=nRows, n=m)

tinint

matrix input precision 1=Real, Single Precision 2=Real, Double Precision 3=Complex, Single Precision 4=Complex, Double Precision

toutint

matrix output precision 0=same as tin 1=Real, Single Precision 2=Real, Double Precision 3=Complex, Single Precision 4=Complex, Double Precision

polarint; default=0

Input format of Ai, Bi Integer=blank or 0 indicates real, imaginary format Integer > 0 indicates amplitude, phase format

ncolsint

???

GCjlist[(node, dof)]

the jnode, jDOFs

GCilist[(node, dof)]

the inode, iDOFs

Reallist[float]

The real values

Complexlist[float]; default=None

The complex values (if the matrix is complex)

commentstr; default=’’

a comment for the card

_get_complex_fields(func)[source]
_get_real_fields(func)[source]
classmethod _init_from_empty()[source]
_properties = ['shape', 'ifo', 'is_real', 'is_complex', 'is_polar', 'matrix_type', 'tin_dtype', 'tout_dtype']
_read_complex(card)[source]

reads a complex DMI column

_read_real(card)[source]

reads a real DMI column

_write_card(func)[source]

writes the card in single/double precision

classmethod add_card(card, comment='')[source]

Adds a DMI card from BDF.add_card(...)

Parameters:
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

classmethod export_to_hdf5(h5_file, model, encoding)[source]
finalize()[source]

converts the lists into numpy arrays

get_matrix(is_sparse: bool = False, apply_symmetry: bool = True) tuple[array, None, None][source]

Builds the Matrix

Parameters:
is_sparsebool; default=False

should the matrix be returned as a sparse matrix. Slower for dense matrices.

apply_symmetrybool; default=True

If the matrix is symmetric (ifo=6), returns a symmetric matrix. Supported as there are symmetric matrix routines.

Returns:
Mnumpy.ndarray or scipy.coomatrix

the matrix

rowsdict[int] = [int, int]

dictionary of keys=rowID, values=(Grid,Component) for the matrix

cols: dict[int] = [int, int]

dictionary of keys=columnID, values=(Grid,Component) for the matrix

Warning

is_sparse=True WILL fail ..

property ifo: int

#: 4-Lower Triangular; 5=Upper Triangular; 6=Symmetric; 8=Identity (m=nRows, n=m)

#: Form of the matrix: 1=Square (not symmetric); 2=Rectangular; #: 3=Diagonal (m=nRows,n=1); 4=Lower Triangular; 5=Upper Triangular; #: 6=Symmetric; 8=Identity (m=nRows, n=m) self.matrix_form = integer(card, 3, ‘matrix_form’)

property is_complex: bool

real vs. complex attribute

property is_polar: bool
Used by:
  • DMIG

  • DMIJ

  • DMIJI

  • DMIK

Not used by:
  • DMI

  • DMIAX

  • DMIG, UACCEL

  • DMIGOUT

  • DMIGROT

property is_real: bool

real vs. complex attribute

property matrix_type

gets the matrix type

1 Square matrix (not symmetric) 2 General rectangular matrix 3 Diagonal matrix (M=number of rows, N = 1) #4 Lower triangular factor #5 Upper triangular factor 6 Symmetric matrix 8 Identity matrix (M=number of rows, N = M)

raw_fields()[source]

Warning

All the writers are bad because Nastran insists on making columns a single DMI card. This makes writing a card much harder, so there are a lot of NotImplementedErrors floating about.

This is an invalid method, but is not disabled because it’s currently needed for checking results

property shape: tuple[int, int]

gets the matrix shape

type = 'DMI'
write_card(size: int = 8, is_double: bool = False) str[source]

Writes the card with the specified width and precision

Parameters:
sizeint (default=8)

size of the field; {8, 16}

is_doublebool (default=False)

is this card double precision

Returns:
msgstr

the string representation of the card

write_card_16()[source]

writes the card in single precision

write_card_8()[source]

writes the card in single precision

write_card_double()[source]

writes the card in double precision

class pyNastran.bdf.cards.dmig.DMIAX(name, matrix_form, tin, tout, ncols, GCNj, GCNi, Real, Complex=None, comment='')[source]

Bases: BaseCard

Direct Matrix Input for Axisymmetric Analysis

Defines axisymmetric (fluid or structure) related direct input matrix terms. The matrix is defined by a single header entry and one or more column entries. Only one header entry is required. A column entry is required for each column with nonzero elements.

1

2

3

4

5

6

7

8

9

DMIAX

NAME

0

IFO

TIN

TOUT

1

2

3

4

5

6

7

8

9

DMIAX

NAME

GJ

CJ

NJ

G1

C1

N1

A1

B1

G2

C2

etc.

1

2

3

4

5

6

7

8

9

DMIAX

B2PP

0

1

3

DMIAX

B2PP

32

1027

3

4.25+6

2.27+3

Creates a DMIAX card

Parameters:
namestr

the name of the matrix

matrix_formint

matrix shape 1=Square 2=General Rectangular 6=Symmetric

tinint

matrix input precision 1=Real, Single Precision 3=Complex, Single Precision

toutint

matrix output precision 1=Real, Single Precision 2=Real, Double Precision 3=Complex, Single Precision 4=Complex, Double Precision

GCNjlist[(node, dof, harmonic_number)]???

the jnode, jDOFs

GCNilist[(node, dof, harmonic_number)]???

the inode, iDOFs

Reallist[float]???

The real values

Complexlist[float]???; default=None

The complex values (if the matrix is complex)

commentstr; default=’’

a comment for the card

_write_card(func)[source]

writes the card

classmethod add_card(card, comment='')[source]

Adds a NastranMatrix (DMIAX) card from BDF.add_card(...)

Parameters:
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

classmethod export_to_hdf5(h5_file, model, encoding)[source]
finalize()[source]

converts the lists into numpy arrays

property is_complex: bool

is the matrix complex

property is_polar: bool

is the matrix polar (vs real/imag)?

property is_real: bool

is the matrix real?

matrix_form

ifo/4-Lower Triangular; 5=Upper Triangular; 6=Symmetric; 8=Identity (m=nRows, n=m)

property matrix_type: str

gets the matrix type

raw_fields()[source]
property tin_dtype: str

gets the input dtype

tout

0-Set by cell precision

property tout_dtype: str

gets the output dtype

type = 'DMIAX'
write_card(size: int = 8, is_double: bool = False) str[source]

Writes the card with the specified width and precision

Parameters:
sizeint (default=8)

size of the field; {8, 16}

is_doublebool (default=False)

is this card double precision

Returns:
msgstr

the string representation of the card

write_card_16()[source]

writes the card in small large format

write_card_8()[source]

writes the card in small field format

write_card_double()[source]

writes the card in small large format

class pyNastran.bdf.cards.dmig.DMIG(name, ifo, tin, tout, polar, ncols, GCj, GCi, Real, Complex=None, comment='', finalize=True)[source]

Bases: NastranMatrix

Defines direct input matrices related to grid, extra, and/or scalar points. The matrix is defined by a single header entry and one or more column entries. A column entry is required for each column with nonzero elements.

1

2

3

4

5

6

7

8

9

DMIG

NAME

0

IFO

TIN

TOUT

POLAR

NCOL

DMIG

NAME

GJ

CJ

G1

C1

A1

B1

G2

C2

A2

B2

Creates a DMIG card

Parameters:
namestr

the name of the matrix

ifoint

matrix shape 2/9=Rectangular 4=Lower Triangular 5=Upper Triangular 6=Symmetric 8=Identity (m=nRows, n=m)

tinint

matrix input precision 1=Real, Single Precision 2=Real, Double Precision 3=Complex, Single Precision 4=Complex, Double Precision

toutint

matrix output precision 0=same as tin 1=Real, Single Precision 2=Real, Double Precision 3=Complex, Single Precision 4=Complex, Double Precision

polarint; default=0

Input format of Ai, Bi Integer=blank or 0 indicates real, imaginary format Integer > 0 indicates amplitude, phase format

ncolsint

???

GCjlist[(node, dof)]

the [jnode, jDOFs] columns

GCilist[(node, dof)]

the [inode, iDOFs] rows

Reallist[float]

The real values

Complexlist[float]; default=None

The complex values (if the matrix is complex)

commentstr; default=’’

a comment for the card

_properties = ['is_real', 'is_complex', 'is_polar', 'matrix_type', 'shape', 'tin_dtype', 'tout_dtype']
classmethod export_to_hdf5(h5_file, model, encoding)[source]
type = 'DMIG'
class pyNastran.bdf.cards.dmig.DMIG_UACCEL(tin, ncol, load_sequences, comment='')[source]

Bases: BaseCard

Direct Matrix Input of Enforced Static Acceleration Defines rigid body accelerations in the basic coordinate system.

1

2

3

4

5

6

7

8

DMIG

UACCEL

“0”

“9”

TIN

NCOL

DMIG

UACCEL

L

G1

C1

X1

G2

C2

X2

G3

C3

X3

DMIG

UACCEL

0

9

1

4

DMIG

UACCEL

2

2

3

386.4

DMIG

UACCEL

3

2

4

3.0

DMIG

UACCEL

4

2

6

1.0

_write_card(func) str[source]

writes the card

classmethod add_card(card, comment='')[source]

Adds a DMIG,UACCEL card from BDF.add_card(...)

Parameters:
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

classmethod export_to_hdf5(h5_file, model, encoding)[source]
static finalize()[source]

a passer method

name = 'UACCEL'
raw_fields()[source]
type = 'DMIG'
write_card(size: int = 8, is_double: bool = False) str[source]

Writes the card with the specified width and precision

Parameters:
sizeint (default=8)

size of the field; {8, 16}

is_doublebool (default=False)

is this card double precision

Returns:
msgstr

the string representation of the card

write_card_16() str[source]

writes the card in small large format

write_card_8() str[source]

writes the card in small field format

class pyNastran.bdf.cards.dmig.DMIJ(name, matrix_form, tin, tout, polar, ncols, GCj, GCi, Real, Complex=None, comment='', finalize=True)[source]

Bases: NastranMatrix

Direct Matrix Input at js-Set of the Aerodynamic Mesh Defines direct input matrices related to collation degrees-of-freedom (js-set) of aerodynamic mesh points for CAERO1, CAERO3, CAERO4 and CAERO5 and for the slender body elements of CAERO2. These include W2GJ, FA2J and input pressures and downwashes associated with AEPRESS and AEDW entries. The matrix is described by a single header entry and one or more column entries. A column entry is required for each column with nonzero elements. For entering data for the interference elements of a CAERO2, use DMIJI or DMI.

Creates a DMIJ card

Parameters:
namestr

the name of the matrix

matrix_formint

matrix shape 4=Lower Triangular 5=Upper Triangular 6=Symmetric 8=Identity (m=nRows, n=m)

tinint

matrix input precision 1=Real, Single Precision 2=Real, Double Precision 3=Complex, Single Precision 4=Complex, Double Precision

toutint

matrix output precision 0=same as tin 1=Real, Single Precision 2=Real, Double Precision 3=Complex, Single Precision 4=Complex, Double Precision

polarint; default=0

Input format of Ai, Bi Integer=blank or 0 indicates real, imaginary format Integer > 0 indicates amplitude, phase format

ncolsint

???

GCjlist[(node, dof)]???

the jnode, jDOFs

GCilist[(node, dof)]???

the inode, iDOFs

Reallist[float]???

The real values

Complexlist[float]???; default=None

The complex values (if the matrix is complex)

commentstr; default=’’

a comment for the card

classmethod _init_from_empty()[source]
_properties = ['shape', 'ifo', 'is_real', 'is_complex', 'is_polar', 'matrix_type', 'tin_dtype', 'tout_dtype']
classmethod export_to_hdf5(h5_file, model, encoding)[source]
type = 'DMIJ'
class pyNastran.bdf.cards.dmig.DMIJI(name: str, ifo: int, tin: int, tout: int, polar: int, ncols: int, GCj, GCi, Real, Complex=None, comment: str = '', finalize: bool = True)[source]

Bases: NastranMatrix

Direct Matrix Input at js-Set of the Interference Body Defines direct input matrices related to collation degrees-of-freedom (js-set) of aerodynamic mesh points for the interference elements of CAERO2. These include W2GJ, FA2J and input pressures and downwashes associated with AEPRESS and AEDW entries. The matrix is described by a single header entry and one or more column entries. A column entry is required for each column with nonzero elements. For entering data for the slender elements of a CAERO2, or a CAERO1, 3, 4 or 5 use DMIJ or DMI.

Creates a DMIJI card

Parameters:
namestr

the name of the matrix

ifoint

matrix shape 4=Lower Triangular 5=Upper Triangular 6=Symmetric 8=Identity (m=nRows, n=m)

tinint

matrix input precision 1=Real, Single Precision 2=Real, Double Precision 3=Complex, Single Precision 4=Complex, Double Precision

toutint

matrix output precision 0=same as tin 1=Real, Single Precision 2=Real, Double Precision 3=Complex, Single Precision 4=Complex, Double Precision

polarint; default=0

Input format of Ai, Bi Integer=blank or 0 indicates real, imaginary format Integer > 0 indicates amplitude, phase format

ncolsint

???

GCjlist[(node, dof)]???

the jnode, jDOFs

GCilist[(node, dof)]???

the inode, iDOFs

Reallist[float]???

The real values

Complexlist[float]???; default=None

The complex values (if the matrix is complex)

commentstr; default=’’

a comment for the card

_properties = ['shape', 'ifo', 'is_real', 'is_complex', 'is_polar', 'matrix_type', 'tin_dtype', 'tout_dtype']
classmethod export_to_hdf5(h5_file, model, encoding)[source]
type = 'DMIJI'
class pyNastran.bdf.cards.dmig.DMIK(name, ifo, tin, tout, polar, ncols, GCj, GCi, Real, Complex=None, comment='', finalize=True)[source]

Bases: NastranMatrix

Direct Matrix Input at ks-Set of the Aerodynamic Mesh Defines direct input matrices related to physical (displacement) degrees-of-freedom (ks-set) of aerodynamic grid points. These include WKK, WTFACT and input forces associated with AEFORCE entries. The matrix is described by a single header entry and one or more column entries. A column entry is required for each column with nonzero elements.

1

2

3

4

5

6

7

8

9

DMIK

NAME

0

IFO

TIN

TOUT

POLAR

NCOL

DMIK

NAME

GJ

CJ

G1

C1

A1

B1

G2

C2

A2

B2

DMIK

ALPH1

0

9

2

0

1

DMIK

ALPH1

1

1

1

1

1.0

2

1

1.0

Creates a DMIK card

Parameters:
namestr

the name of the matrix

ifoint

matrix shape 4=Lower Triangular 5=Upper Triangular 6=Symmetric 8=Identity (m=nRows, n=m)

tinint

matrix input precision 1=Real, Single Precision 2=Real, Double Precision 3=Complex, Single Precision 4=Complex, Double Precision

toutint

matrix output precision 0=same as tin 1=Real, Single Precision 2=Real, Double Precision 3=Complex, Single Precision 4=Complex, Double Precision

polarint; default=0

Input format of Ai, Bi Integer=blank or 0 indicates real, imaginary format Integer > 0 indicates amplitude, phase format

ncolsint

???

GCjlist[(node, dof)]

the jnode, jDOFs

GCilist[(node, dof)]

the inode, iDOFs

Reallist[float]

The real values

Complexlist[float]; default=None

The complex values (if the matrix is complex)

commentstr; default=’’

a comment for the card

_properties = ['shape', 'ifo', 'is_real', 'is_complex', 'is_polar', 'matrix_type', 'tin_dtype', 'tout_dtype']
classmethod export_to_hdf5(h5_file, model, encoding)[source]
type = 'DMIK'
class pyNastran.bdf.cards.dmig.DTI(name: str, fields: dict[int, list], comment='')[source]

Bases: BaseCard

1

2

3

4

5

6

7

8

DTI

UNITS

“1”

MASS

FORCE

LENGTH

TIME

STRESS

MSC

1

2

3

4

5

6

7

8

DTI

UNITS

“1”

MASS

FORCE

LENGTH

TIME

TEMPERATURE

NX

Creates a DTI card

Parameters:
namestr

UNITS

fieldsdict[int, list[Any]]

the fields

commentstr; default=’’

a comment for the card

_finalize_hdf5(encoding: str) None[source]

hdf5 helper function

classmethod _init_from_empty()[source]
classmethod add_card(card, comment)[source]

Adds a DTI card from BDF.add_card(...)

Parameters:
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

classmethod export_to_hdf5(h5_file, model: BDF, encoding: str)[source]

exports the elements in a vectorized way

raw_fields()[source]
type = 'DTI'
write_card(size: int = 8, is_double: bool = False) str[source]

Writes the card with the specified width and precision

Parameters:
sizeint (default=8)

size of the field; {8, 16}

is_doublebool (default=False)

is this card double precision

Returns:
msgstr

the string representation of the card

class pyNastran.bdf.cards.dmig.DTI_UNITS(name, fields, comment='')[source]

Bases: BaseCard

1

2

3

4

5

6

7

8

DTI

UNITS

“1”

MASS

FORCE

LENGTH

TIME

STRESS

MSC

1

2

3

4

5

6

7

8

DTI

UNITS

“1”

MASS

FORCE

LENGTH

TIME

TEMPERATURE

NX

Creates a DTI,UNITS card

Parameters:
namestr

UNITS

fieldslist[varies]

the fields

commentstr; default=’’

a comment for the card

_finalize_hdf5(encoding)[source]

hdf5 helper function

classmethod _init_from_empty()[source]
classmethod add_card(card, comment)[source]

Adds a DTI card from BDF.add_card(...)

Parameters:
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

classmethod export_to_hdf5(h5_file, model, encoding)[source]

exports the elements in a vectorized way

raw_fields()[source]
type = 'DTI'
write_card(size: int = 8, is_double: bool = False) str[source]

Writes the card with the specified width and precision

Parameters:
sizeint (default=8)

size of the field; {8, 16}

is_doublebool (default=False)

is this card double precision

Returns:
msgstr

the string representation of the card

class pyNastran.bdf.cards.dmig.NastranMatrix(name: str, matrix_form: int, tin: int, tout: int, polar: int, ncols: int, GCj: list[tuple[int, int]], GCi: list[tuple[int, int]], Real: list[float], Complex=None, comment: str = '', finalize: bool = True)[source]

Bases: BaseCard

Base class for the DMIG, DMIJ, DMIJI, DMIK matrices

Creates a NastranMatrix

Parameters:
namestr

the name of the matrix

matrix_formint

matrix shape 4=Lower Triangular 5=Upper Triangular 6=Symmetric 8=Identity (m=nRows, n=m)

tinint

matrix input precision 1=Real, Single Precision 2=Real, Double Precision 3=Complex, Single Precision 4=Complex, Double Precision

toutint

matrix output precision 0=same as tin 1=Real, Single Precision 2=Real, Double Precision 3=Complex, Single Precision 4=Complex, Double Precision

polarint; default=0

Input format of Ai, Bi Integer=blank or 0 indicates real, imaginary format Integer > 0 indicates amplitude, phase format

ncolsint

???

GCjlist[(node, dof)]

the jnode, jDOFs

GCilist[(node, dof)]

the inode, iDOFs

Reallist[float]

The real values

Complexlist[float]; default=None

The complex values (if the matrix is complex)

commentstr; default=’’

a comment for the card

_finalize_hdf5(encoding)[source]

hdf5 helper function

classmethod add_card(card, comment='')[source]

Adds a NastranMatrix (DMIG, DMIJ, DMIK, DMIJI) card from BDF.add_card(...)

Parameters:
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

fill_in_default_components(model: BDF) None[source]
finalize()[source]

converts the lists into numpy arrays

get_matrix(is_sparse: bool = False, apply_symmetry: bool = True) tuple[np.ndarray | scipy.coomatrix, dict[int, tuple[int, int]], dict[int, tuple[int, int]]][source]

Builds the Matrix

Parameters:
is_sparsebool; default=False

should the matrix be returned as a sparse matrix. Slower for dense matrices.

apply_symmetrybool; default=True

If the matrix is symmetric (ifo=6), returns a symmetric matrix. Supported as there are symmetric matrix routines.

Returns:
Mnumpy.ndarray or scipy.coomatrix

the matrix

rowsdict[int] = [int, int]

dictionary of keys=rowID, values=(Grid,Component) for the matrix

cols: dict[int] = [int, int]

dictionary of keys=columnID, values=(Grid,Component) for the matrix

Warning

is_sparse=True WILL fail ..

property is_complex: bool

real vs. complex attribute

property is_polar: bool
Used by:
  • DMIG

  • DMIJ

  • DMIJI

  • DMIK

Not used by:
  • DMI

  • DMIAX

  • DMIG, UACCEL

  • DMIGOUT

  • DMIGROT

property is_real: bool

real vs. complex attribute

matrix_form

4-Lower Triangular; 5=Upper Triangular; 6=Symmetric; 8=Identity (m=nRows, n=m)

property matrix_type

gets the matrix type

polar

Input format of Ai, Bi. (Integer=blank or 0 indicates real, imaginary format; Integer > 0 indicates amplitude, phase format.)

property shape

gets the matrix shape

property tin_dtype: str

gets the input dtype

tout

0-Set by cell precision

property tout_dtype: str

gets the output dtype

write_card(size: int = 8, is_double: bool = False) str[source]

Writes the card with the specified width and precision

Parameters:
sizeint (default=8)

size of the field; {8, 16}

is_doublebool (default=False)

is this card double precision

Returns:
msgstr

the string representation of the card

pyNastran.bdf.cards.dmig._build_gc_map(GC: ndarray) dict[tuple[int, int], int][source]

helper method for gc_to_index

pyNastran.bdf.cards.dmig._determine_size_double_from_tin(tin: int, size: int, is_double: bool) tuple[int, bool][source]

we ignore the requested is_double flag because otherwise Nastran can’t read in the matrix

pyNastran.bdf.cards.dmig._export_dmiax_to_hdf5(h5_file, model, dict_obj, encoding: str) None[source]

export dmiax

pyNastran.bdf.cards.dmig._export_dmig_to_hdf5(h5_file, model: BDF, dict_obj, encoding: str) None[source]

export dmigs, dmij, dmiji, dmik, dmi

pyNastran.bdf.cards.dmig._fill_dense_column_matrix(matrix: DMIG, nrows: int, ncols: int, ndim: int, rows: dict[Any, int], cols: dict[Any, int], apply_symmetry: bool) ndarray[source]

helper method for get_matrix

pyNastran.bdf.cards.dmig._fill_dense_column_matrix_complex(matrix: DMIG, nrows: int, ncols: int, ndim: int, rows: dict[Any, int], cols: dict[Any, int], apply_symmetry: bool) ndarray[source]

helper method for _fill_dense_column_matrix

What does symmetry mean for a column matrix?!!!

pyNastran.bdf.cards.dmig._fill_dense_column_matrix_real(matrix: DMIG, nrows: int, ncols: int, ndim: int, rows: dict[Any, int], cols: dict[Any, int], apply_symmetry: bool) ndarray[source]

helper method for _fill_dense_column_matrix

What does symmetry mean for a column matrix?!!!

pyNastran.bdf.cards.dmig._fill_dense_rectangular_matrix(matrix: DMIG, nrows: int, ncols: int, ndim: int, rows: dict[Any, int], cols: dict[Any, int], apply_symmetry: bool) Any[source]

helper method for get_matrix

pyNastran.bdf.cards.dmig._fill_dense_rectangular_matrix_complex(matrix: DMIG, nrows: int, ncols: int, ndim: int, rows: dict[Any, int], cols: dict[Any, int], apply_symmetry: bool) ndarray[source]

helper method for _fill_dense_rectangular_matrix

pyNastran.bdf.cards.dmig._fill_dense_rectangular_matrix_real(matrix: DMIG, nrows: int, ncols: int, ndim: int, rows: dict[Any, int], cols: dict[Any, int], apply_symmetry: bool) ndarray[source]

helper method for _fill_dense_rectangular_matrix

pyNastran.bdf.cards.dmig._fill_sparse_matrix(matrix: DMIG, nrows: int, ncols: int, apply_symmetry: bool) coo_matrix[source]

helper method for get_matrix

pyNastran.bdf.cards.dmig._get_diagonal_symmetric(matrix: DMIG) tuple[ndarray, ndarray][source]

helper for apply_symmetry

pyNastran.bdf.cards.dmig._get_real_dtype(type_flag: int) str[source]

A complex64 array is made up of two float32 arrays.

pyNastran.bdf.cards.dmig._get_row_col_map_1d(matrix, GCi, GCj, ifo: int)[source]

helper for get_row_col_map

pyNastran.bdf.cards.dmig._get_row_col_map_2d(matrix, GCi, GCj, ifo)[source]

helper for get_row_col_map

pyNastran.bdf.cards.dmig._set_polar(polar) int[source]
pyNastran.bdf.cards.dmig.dtype_to_tin_tout_str(myarray: ndarray) str[source]
pyNastran.bdf.cards.dmig.gc_to_index(GC: ndarray) tuple[ndarray, int][source]

helper method for _fill_sparse_matrix

pyNastran.bdf.cards.dmig.get_dmi_matrix(matrix: DMI, is_sparse: bool = False, apply_symmetry: bool = True) tuple[array, None, None][source]

Builds the Matrix

Parameters:
is_sparsebool

should the matrix be returned as a sparse matrix (default=True). Slower for dense matrices.

apply_symmetry: bool

If the matrix is symmetric (matrix_form=6), returns a symmetric matrix. Supported as there are symmetric matrix routines. TODO: unused…

Returns:
Mndarray

the matrix

rowsNone

unused

colsNone

unused

Warning

is_sparse=True WILL fail ..

pyNastran.bdf.cards.dmig.get_matrix(self: DMIG, is_sparse: bool = False, apply_symmetry: bool = False) tuple[Any, dict[int, Any], dict[int, Any]][source]

Builds the Matrix

Parameters:
is_sparsebool; default=False

should the matrix be returned as a sparse matrix. Slower for dense matrices.

apply_symmetry: bool; default=False

If the matrix is symmetric (matrix_form=6), returns a symmetric matrix. Supported as there are symmetric matrix routines.

Returns:
Mndarray

the matrix

rowsdict[(nid, nid)] = float

dictionary of keys=rowID, values=(Grid,Component) for the matrix

colsdict[(int, int)] = float

dictionary of keys=columnID, values=(Grid,Component) for the matrix

pyNastran.bdf.cards.dmig.get_row_col_map(matrix: DMIG, GCi: ndarray, GCj: ndarray, ifo: int) tuple[int, int, int, ndarray, ndarray, dict[int, Any], dict[int, Any]][source]