bdf Module

Inheritance diagram of pyNastran.bdf.bdf
Main BDF class. Defines:
  • BDF
class pyNastran.bdf.bdf.BDF(debug=True, log=None, mode='msc')[source]

Bases: pyNastran.bdf.bdf.BDF_

NASTRAN BDF Reader/Writer/Editor class.

Initializes the BDF object

Parameters:
debug : bool/None; default=True
used to set the logger if no logger is passed in

True: logs debug/info/warning/error messages False: logs info/warning/error messages None: logs warning/error messages

log : logging module object / None

if log is set, debug is ignored and uses the settings the logging object has

mode : str; default=’msc’

the type of Nastran valid_modes = {‘msc’, ‘nx’}

AEFact(self, aefact, msg='')

gets an AEFACT

AELIST(self, aid, msg='')

gets an AELIST

gets an AELINK

AEList(self, aelist, msg='')

gets an AELIST

AEParam(self, aid, msg='')

gets an AEPARM

AEStat(self, aid, msg='')

gets an AESTAT

AESurf(self, aesurf_id, msg='')

gets an AESURF

Acsid(self, msg='')

gets the aerodynamic coordinate system

Aero(self, msg='')

gets the AERO

Aeros(self, msg='')

gets the AEROS

CAero(self, eid, msg='')

gets an CAEROx

CMethod(self, sid, msg='')

gets a METHOD (EIGC)

Coord(self, cid, msg='')

gets an COORDx

DAREA(self, darea_id, msg='')

gets a DAREA

DConstr(self, oid, msg='')

gets a DCONSTR

DDVal(self, oid, msg='')

gets a DDVAL

DELAY(self, delay_id, msg='')

gets a DELAY

DEQATN(self, equation_id, msg='')

gets a DEQATN

DLoad(self, sid, consider_dload_combinations=True, msg='')

Gets a DLOAD, TLOAD1, TLOAD2, etc. associcated with the Case Control DLOAD entry

DMIG(self, dname, msg='')

gets a DMIG

DPHASE(self, dphase_id, msg='')

gets a DPHASE

DResp(self, dresp_id, msg='')

gets a DRESPx

DVcrel(self, dv_id, msg='')

gets a DVCREL1/DVCREL2

DVmrel(self, dv_id, msg='')

gets a DVMREL1/DVMREL2

DVprel(self, dv_id, msg='')

gets a DVPREL1/DVPREL2

Desvar(self, desvar_id, msg='')

gets a DESVAR

Element(self, eid, msg='')

Gets an element

Doesn’t get rigid (RROD, RBAR, RBE2, RBE3, RBAR, RBAR1, RSPLINE, RSSCON) or mass (CMASS1, CONM2)

Elements(self, eids, msg='')

Gets an series of elements

Doesn’t get rigid (RROD, RBAR, RBE2, RBE3, RBAR, RBAR1, RSPLINE, RSSCON) or mass (CMASS1, CONM2)

EmptyNode(self, nid, msg='')

Gets a GRID/SPOINT/EPOINT object, but allows for empty nodes (i.e., the CTETRA10 supports empty nodes, but the CTETRA4 does not).

Parameters:
nid : int / None

the node id 0, None : indicate blank

msg : str; default=’‘

a debugging message

EmptyNodes(self, nids, msg='')

Returns a series of node objects given a list of IDs

FLFACT(self, sid, msg='')

gets an FLFACT

Flutter(self, fid, msg='')

gets a FLUTTER

Gust(self, sid, msg='')

gets a GUST

HyperelasticMaterial(self, mid, msg='')

gets a hyperelastic material

Load(self, sid, consider_load_combinations=True, msg='')

Gets an LOAD or FORCE/PLOAD4/etc.

Parameters:
sid : int

the LOAD id

consider_load_combinations : bool; default=True

LOADs should not be considered when referenced from an LOAD card from a case control, True should be used.

msg : str

additional message to print when failing

MPC(self, mpc_id, consider_mpcadd=True, msg='')

Gets an MPCADD or MPC

Parameters:
mpc_id : int

the MPC id

consider_mpcadd : bool; default=True

MPCADDs should not be considered when referenced from an MPCADD from a case control, True should be used.

msg : str

additional message to print when failing

Mass(self, eid, msg='')

gets a mass element (CMASS1, CONM2)

Material(self, mid, msg='')

gets a structural or thermal material

Materials(self, mids, msg='')

gets one or more Materials

Method(self, sid, msg='')

gets a METHOD (EIGR, EIGRL)

NLParm(self, nid, msg='')

gets an NLPARM

NSM(self, nsm_id, consider_nsmadd=True, msg='')

Gets an LOAD or FORCE/PLOAD4/etc.

Parameters:
nsm_id : int

the LOAD id

consider_nsmadd : bool; default=True

NSMADDs should not be considered when referenced from an NSM card from a case control, True should be used.

msg : str

additional message to print when failing

Node(self, nid, msg='')

Gets a GRID/SPOINT/EPOINT object. This method does not allow for empty nodes (i.e., the CTETRA10 supports empty nodes, but the CTETRA4 does not).

Parameters:
nid : int

the node id

msg : str; default=’‘

a debugging message

Nodes(self, nids, msg='')

Returns a series of node objects given a list of IDs

PAero(self, pid, msg='')

gets a PAEROx

Phbdy(self, pid, msg='')

gets a PHBDY

Point(self, nid, msg='')

Returns a POINT card

Points(self, nids, msg='')

Returns a series of POINT objects given a list of IDs

Properties(self, pids, msg='')

gets one or more elemental property (e.g. PSOLID, PLSOLID, PCOMP, PSHELL, PSHEAR); not mass property (PMASS)

Property(self, pid, msg='')

gets an elemental property (e.g. PSOLID, PLSOLID, PCOMP, PSHELL, PSHEAR); not mass property (PMASS)

PropertyMass(self, pid, msg='')

gets a mass property (PMASS)

RandomTable(self, tid, msg='')

gets a TABRND1 / TABRNDG

RigidElement(self, eid, msg='')

gets a rigid element (RBAR, RBE2, RBE3, RBAR, RBAR1, RROD, RSPLINE, RSSCON)

SET1(self, set_id, msg='')

gets a SET1

SPC(self, spc_id, consider_spcadd=True, msg='')

Gets an SPCADD or SPC

Parameters:
spc_id : int

the SPC id

consider_spcadd : bool; default=True

SPCADDs should not be considered when referenced from an SPCADD from a case control, True should be used.

msg : str

additional message to print when failing

Set(self, sid, msg='')

gets a SET, SET1, SET2, or SET3 card

Spline(self, eid, msg='')

gets a SPLINEx

StructuralMaterial(self, mid, msg='')

gets a structural material

Table(self, tid, msg='')

gets a TABLES1, TABLEST, ???

TableD(self, tid, msg='')

gets a TABLEDx (TABLED1, TABLED2, TABLED3, TABLED4)

TableM(self, tid, msg='')

gets a TABLEx (TABLEM1, TABLEM2, TABLEM3, TABLEM4)

ThermalMaterial(self, mid, msg='')

gets a thermal material

add_accel(self, sid, N, direction, locs, vals, cid=0, comment='')

Creates an ACCEL card

Parameters:
sid : int

load id

N : (3, ) float ndarray

the acceleration vector in the cid frame

direction : str

Component direction of acceleration variation {X, Y, Z}

locs : List[float]

Location along direction DIR in coordinate system CID for specification of a load scale factor.

vals : List[float]

The load scale factor associated with location LOCi

cid : int; default=0

the coordinate system for the load

comment : str; default=’‘

a comment for the card

add_accel1(self, sid, scale, N, nodes, cid=0, comment='')

Creates an ACCEL1 card

Parameters:
sid : int

load id

scale : float

scale factor for load

N : (3, ) float ndarray

the acceleration vector in the cid frame

direction : str

Component direction of acceleration variation {X, Y, Z}

nodes : List[int]

the nodes to apply acceleration to

cid : int; default=0

the coordinate system for the load

comment : str; default=’‘

a comment for the card

add_acsrce(self, sid, excite_id, rho, b, delay=0, dphase=0, power=0, comment='')

Creates an ACSRCE card

Parameters:
sid : int

load set id number (referenced by DLOAD)

excite_id : int

Identification number of a DAREA or SLOAD entry that lists each degree of freedom to apply the excitation and the corresponding scale factor, A, for the excitation

rho : float

Density of the fluid

b : float

Bulk modulus of the fluid

delay : int; default=0

Time delay, τ.

dphase : int / float; default=0

the dphase; if it’s 0/blank there is no phase lag float : delay in units of time int : delay id

power : int; default=0

Power as a function of frequency, P(f). float : value of P(f) used over all frequencies for all

degrees of freedom in EXCITEID entry.

int : TABLEDi entry that defines P(f) for all degrees of

freedom in EXCITEID entry.

comment : str; default=’‘

a comment for the card

add_aecomp(self, name, list_type, lists, comment='')

Creates an AECOMP card

Parameters:
name : str

the name of the component

list_type : str

One of CAERO, AELIST or CMPID for aerodynamic components and SET1 for structural components. Aerodynamic components are defined on the aerodynamic ks-set mesh while the structural components are defined on the g-set mesh.

lists : List[int, int, …]; int

The identification number of either SET1, AELIST or CAEROi entries that define the set of grid points that comprise the component

comment : str; default=’‘

a comment for the card

add_aecompl(self, name, labels, comment='')

Creates an AECOMPL card

Parameters:
name : str

the name of the component

labels : List[str, str, …]; str

A string of 8 characters referring to the names of other components defined by either AECOMP or other AECOMPL entries.

comment : str; default=’‘

a comment for the card

add_aefact(self, sid, fractions, comment='')

Creates an AEFACT card, which is used by the CAEROx / PAEROx card to adjust the spacing of the sub-paneleing (and grid point paneling in the case of the CAERO3).

Parameters:
sid : int

unique id

fractions : List[float, …, float]

list of percentages

comment : str; default=’‘

a comment for the card

Creates an AELINK card, which defines an equation linking AESTAT and AESURF cards

Parameters:
aelink_id : int

unique id

label : str

name of the dependent AESURF card

independent_labels : List[str, …, str]

name for the independent variables (AESTATs)

linking_coefficents : List[float]

linking coefficients

comment : str; default=’‘

a comment for the card

add_aelist(self, sid, elements, comment='')

Creates an AELIST card, which defines the aero boxes for an AESURF/SPLINEx.

Parameters:
sid : int

unique id

elements : List[int, …, int]

list of box ids

comment : str; default=’‘

a comment for the card

add_aeparm(self, aeparm_id, label, units, comment='')

Creates an AEPARM card, which defines a new trim variable.

Parameters:
aeparm_id : int

the unique id

label : str

the variable name

units : str

unused by Nastran

comment : str; default=’‘

a comment for the card

add_aero(self, velocity, cref, rho_ref, acsid=0, sym_xz=0, sym_xy=0, comment='')

Creates an AERO card

Parameters:
velocity : float

the airspeed

cref : float

the aerodynamic chord

rho_ref : float

FLFACT density scaling factor

acsid : int; default=0

aerodyanmic coordinate system

sym_xz : int; default=0

xz symmetry flag (+1=symmetry; -1=antisymmetric)

sym_xy : int; default=0

xy symmetry flag (+1=symmetry; -1=antisymmetric)

comment : str; default=’‘

a comment for the card

add_aeros(self, cref, bref, sref, acsid=0, rcsid=0, sym_xz=0, sym_xy=0, comment='')

Creates an AEROS card

Parameters:
cref : float

the aerodynamic chord

bref : float

the wing span

sref : float

the wing area

acsid : int; default=0

aerodyanmic coordinate system

rcsid : int; default=0

coordinate system for rigid body motions

sym_xz : int; default=0

xz symmetry flag (+1=symmetry; -1=antisymmetric)

sym_xy : int; default=0

xy symmetry flag (+1=symmetry; -1=antisymmetric)

comment : str; default=’‘

a comment for the card

add_aestat(self, aestat_id, label, comment='')

Creates an AESTAT card, which is a variable to be used in a TRIM analysis

Parameters:
aestat_id : int

unique id

label : str

name for the id

comment : str; default=’‘

a comment for the card

add_aesurf(self, aesid, label, cid1, alid1, cid2=None, alid2=None, eff=1.0, ldw='LDW', crefc=1.0, crefs=1.0, pllim=-1.5707963267948966, pulim=1.5707963267948966, hmllim=None, hmulim=None, tqllim=None, tqulim=None, comment='')

Creates an AESURF card, which defines a control surface

Parameters:
aesid : int

controller number

label : str

controller name

cid1 / cid2 : int / None

coordinate system id for primary/secondary control surface

alid1 / alid2 : int / None

AELIST id for primary/secondary control surface

eff : float; default=1.0

Control surface effectiveness

ldw : str; default=’LDW’

Linear downwash flag; [‘LDW’, ‘NODLW’]

crefc : float; default=1.0

reference chord for the control surface

crefs : float; default=1.0

reference area for the control surface

pllim / pulim : float; default=-pi/2 / pi/2

Lower/Upper deflection limits for the control surface in radians

hmllim / hmulim : float; default=None

Lower/Upper hinge moment limits for the control surface in force-length units

tqllim / tqulim : int; default=None

Set identification numbers of TABLEDi entries that provide the lower/upper deflection limits for the control surface as a function of the dynamic pressure

comment : str; default=’‘

a comment for the card

add_aesurfs(self, aesid, label, list1, list2, comment='')

Creates an AESURFS card

Parameters:
aesid : int

the unique id

label : str

the AESURF name

list1 / list2 : int / None

the list (SET1) of node ids for the primary/secondary control surface(s) on the AESURF card

comment : str; default=’‘

a comment for the card

add_aset(self, ids, components, comment='')

Creates an ASET/ASET1 card, which defines the degree of freedoms that will be retained during an ASET modal reduction.

Parameters:
ids : List[int]

the GRID/SPOINT ids

components : List[str]; str

the degree of freedoms to be retained (e.g., ‘1’, ‘123’) if a list is passed in, a ASET is made if a str is passed in, a ASET1 is made

comment : str; default=’‘

a comment for the card

Notes

the length of components and ids must be the same

add_aset1(self, ids, components, comment='')
add_axic(self, nharmonics, comment='')

Creates a AXIC card

add_baror(self, pid, is_g0, g0, x, offt='GGG', comment='')
add_bconp(self, contact_id, slave, master, sfac, fric_id, ptype, cid, comment='')

Creates a BCONP card

add_bcrpara(self, crid, surf='TOP', offset=None, Type='FLEX', grid_point=0, comment='')

Creates a BCRPARA card

Parameters:
crid : int

CRID Contact region ID.

offset : float; default=None

Offset distance for the contact region (Real > 0.0). None : OFFSET value in BCTPARA entry

surf : str; default=’TOP’

SURF Indicates the contact side. See Remark 1. {‘TOP’, ‘BOT’; )

Type : str; default=’FLEX’

Indicates whether a contact region is a rigid surface if it is used as a target region. {‘RIGID’, ‘FLEX’}. This is not supported for SOL 101.

grid_point : int; default=0

Control grid point for a target contact region with TYPE=RIGID or when the rigid-target algorithm is used. The grid point may be used to control the motion of a rigid surface. (Integer > 0). This is not supported for SOL 101.

comment : str; default=’‘

a comment for the card

add_bctadd(self, csid, contact_sets, comment='')

Creates a BCTADD card

add_bctpara(self, csid, params, comment='')

Creates a BCTPARA card

add_bctset(self, csid, sids, tids, frictions, min_distances, max_distances, comment='', sol=101)

Creates a BCTSET card

add_blseg(self, line_id, nodes, comment='')

Creates a BLSEG card

add_bset(self, ids, components, comment='')

Creates an BSET/BSET1 card, which defines the degree of freedoms that will be fixed during a generalized dynamic reduction or component model synthesis calculation.

Parameters:
ids : List[int]

the GRID/SPOINT ids

components : List[str]; str

the degree of freedoms to be fixed (e.g., ‘1’, ‘123’) if a list is passed in, a ASET is made if a str is passed in, a ASET1 is made

comment : str; default=’‘

a comment for the card

Notes

the length of components and ids must be the same

add_bset1(self, ids, components, comment='')
add_bsurf(self, sid, eids, comment='')

Creates a BSURF card

add_bsurfs(self, id, eids, g1s, g2s, g3s, comment='')

Creates a BSURFS card

add_caero1(self, eid, pid, igroup, p1, x12, p4, x43, cp=0, nspan=0, lspan=0, nchord=0, lchord=0, comment='')

Defines a CAERO1 card, which defines a simplified lifting surface (e.g., wing/tail).

Parameters:
eid : int

element id

pid : int, PAERO1

int : PAERO1 ID PAERO1 : PAERO1 object (xref)

igroup : int

Group number

p1 : (1, 3) ndarray float

xyz location of point 1 (leading edge; inboard)

p4 : (1, 3) ndarray float

xyz location of point 4 (leading edge; outboard)

x12 : float

distance along the flow direction from node 1 to node 2; (typically x, root chord)

x43 : float

distance along the flow direction from node 4 to node 3; (typically x, tip chord)

cp : int, CORDx; default=0

int : coordinate system CORDx : Coordinate object (xref)

nspan : int; default=0

int > 0 : N spanwise boxes distributed evenly int = 0 : use lchord

nchord : int; default=0

int > 0 : N chordwise boxes distributed evenly int = 0 : use lchord

lspan : int, AEFACT; default=0

int > 0 : AEFACT reference for non-uniform nspan int = 0 : use nspan AEFACT : AEFACT object (xref)

lchord : int, AEFACT; default=0

int > 0 : AEFACT reference for non-uniform nchord int = 0 : use nchord AEFACT : AEFACT object (xref)

comment : str; default=’‘

a comment for the card

add_caero2(self, eid, pid, igroup, p1, x12, cp=0, nsb=0, nint=0, lsb=0, lint=0, comment='')

Defines a CAERO2 card, which defines a slender body (e.g., fuselage/wingtip tank).

Parameters:
eid : int

element id

pid : int, PAERO2

int : PAERO2 ID PAERO2 : PAERO2 object (xref)

igroup : int

Group number

p1 : (1, 3) ndarray float

xyz location of point 1 (forward position)

x12 : float

length of the CAERO2

cp : int, CORDx; default=0

int : coordinate system CORDx : Coordinate object (xref)

nsb : int; default=0

Number of slender body elements

lsb : int; default=0

AEFACT id for defining the location of the slender body elements

nint : int; default=0

Number of interference elements

lint : int; default=0

AEFACT id for defining the location of interference elements

comment : str; default=’‘

a comment for the card

add_caero3(self, eid, pid, list_w, p1, x12, p4, x43, cp=0, list_c1=None, list_c2=None, comment='')

Creates a CAERO3 card

add_caero4(self, eid, pid, p1, x12, p4, x43, cp=0, nspan=0, lspan=0, comment='')

Defines a CAERO4 card, which defines a strip theory surface.

Parameters:
eid : int

element id

pid : int, PAERO4

int : PAERO4 ID PAERO4 : PAERO4 object (xref)

p1 : (1, 3) ndarray float

xyz location of point 1 (leading edge; inboard)

p4 : (1, 3) ndarray float

xyz location of point 4 (leading edge; outboard)

x12 : float

distance along the flow direction from node 1 to node 2 (typically x, root chord)

x43 : float

distance along the flow direction from node 4 to node 3 (typically x, tip chord)

cp : int, CORDx; default=0

int : coordinate system CORDx : Coordinate object (xref)

nspan : int; default=0

int > 0 : N spanwise boxes distributed evenly int = 0 : use lchord

lspan : int, AEFACT; default=0

int > 0 : AEFACT reference for non-uniform nspan int = 0 : use nspan AEFACT : AEFACT object (xref)

comment : str; default=’‘

a comment for the card

add_caero5(self, eid, pid, p1, x12, p4, x43, cp=0, nspan=0, lspan=0, ntheory=0, nthick=0, comment='')

Creates a CAERO5 card

add_card(self, card_lines, card_name, comment='', ifile=None, is_list=True, has_none=True)

Adds a card object to the BDF object.

Parameters:
card_lines: list[str]

the list of the card fields

card_name : str

the card_name -> ‘GRID’

comment : str

an optional the comment for the card

is_list : bool, optional

False : input is a list of card fields -> [‘GRID’, 1, None, 3.0, 4.0, 5.0] True : input is list of card_lines -> [‘GRID, 1,, 3.0, 4.0, 5.0’]

has_none : bool; default=True

can there be trailing Nones in the card data (e.g. [‘GRID’, 1, 2, 3.0, 4.0, 5.0, None]) can there be trailing Nones in the card data (e.g. [‘GRID, 1, 2, 3.0, 4.0, 5.0, ‘])

Returns:
card_object : BDFCard()

the card object representation of card

Note

this is a very useful method for interfacing with the code ..

Note

the card_object is not a card-type object…so not a GRID card or CQUAD4 object. It’s a BDFCard Object. However, you know the type (assuming a GRID), so just call the mesh.Node(nid) to get the Node object that was just created.

add_card_fields(self, card_lines, card_name, comment='', has_none=True)

Adds a card object to the BDF object.

Parameters:
card_lines: list[str]

the list of the card fields input is a list of card fields -> [‘GRID’, 1, 2, 3.0, 4.0, 5.0]

card_name : str

the card_name -> ‘GRID’

comment : str

an optional the comment for the card

has_none : bool; default=True

can there be trailing Nones in the card data (e.g. [‘GRID’, 1, 2, 3.0, 4.0, 5.0, None])

Returns:
card_object : BDFCard()

the card object representation of card

add_card_ifile(self, ifile, card_lines, card_name, comment='', is_list=True, has_none=True)

Same as add_card except it has an ifile parameter

add_card_lines(self, card_lines, card_name, comment='', has_none=True)

Adds a card object to the BDF object.

Parameters:
card_lines: list[str]

the list of the card fields input is list of card_lines -> [‘GRID, 1, 2, 3.0, 4.0, 5.0’]

card_name : str

the card_name -> ‘GRID’

comment : str; default=’‘

an optional the comment for the card

has_none : bool; default=True

can there be trailing Nones in the card data (e.g. [‘GRID, 1, 2, 3.0, 4.0, 5.0, ‘])

add_cbar(self, eid, pid, nids, x, g0, offt='GGG', pa=0, pb=0, wa=None, wb=None, comment='')

Adds a CBAR card

Parameters:
pid : int

property id

mid : int

material id

nids : List[int, int]

node ids; connected grid points at ends A and B

x : List[float, float, float]

Components of orientation vector, from GA, in the displacement coordinate system at GA (default), or in the basic coordinate system

g0 : int

Alternate method to supply the orientation vector using grid point G0. Direction of is from GA to G0. is then transferred to End A

offt : str; default=’GGG’

Offset vector interpretation flag

pa / pb : int; default=0

Pin Flag at End A/B. Releases the specified DOFs

wa / wb : List[float, float, float]

Components of offset vectors from the grid points to the end points of the axis of the shear center

comment : str; default=’‘

a comment for the card

add_cbarao(self, eid, scale, x, comment='')

Creates a CBARAO card, which defines additional output locations for the CBAR card.

It also changes the OP2 element type from a CBAR-34 to a CBAR-100. However, it is ignored if there are no PLOAD1s in the model. Furthermore, the type is changed for the whole deck, regardless of whether there are PLOAD1s in the other load cases.

Parameters:
eid : int

element id

scale : str

defines what x means LE : x is in absolute coordinates along the bar FR : x is in fractional

x : List[float]

the additional output locations len(x) <= 6

comment : str; default=’‘

a comment for the card

Notes

MSC only

add_cbeam(self, eid, pid, nids, x, g0, offt='GGG', bit=None, pa=0, pb=0, wa=None, wb=None, sa=0, sb=0, comment='')

Adds a CBEAM card

Parameters:
pid : int

property id

mid : int

material id

nids : List[int, int]

node ids; connected grid points at ends A and B

x : List[float, float, float]

Components of orientation vector, from GA, in the displacement coordinate system at GA (default), or in the basic coordinate system

g0 : int

Alternate method to supply the orientation vector using grid point G0. Direction of is from GA to G0. is then transferred to End A

offt : str; default=’GGG’

Offset vector interpretation flag None : bit is active

bit : float; default=None

Built-in twist of the cross-sectional axes about the beam axis at end B relative to end A. For beam p-elements ONLY! None : offt is active

pa / pb : int; default=0

Pin Flag at End A/B. Releases the specified DOFs

wa / wb : List[float, float, float]

Components of offset vectors from the grid points to the end points of the axis of the shear center

sa / sb : int; default=0

Scalar or grid point identification numbers for the ends A and B, respectively. The degrees-of-freedom at these points are the warping variables . SA and SB cannot be specified for beam p-elements

comment : str; default=’‘

a comment for the card

Notes

offt/bit are MSC specific fields

add_cbeam3(self, eid, pid, nids, x, g0, wa, wb, wc, tw, s, comment='')

Creates a CBEAM3 card

add_cbend(self, eid, pid, nids, g0, x, geom, comment='')

Creates a CBEND card

add_cbush(self, eid, pid, nids, x, g0, cid=None, s=0.5, ocid=-1, si=None, comment='')

Creates a CBUSH card

Parameters:
eid : int

Element id

pid : int

Property id (PBUSH)

nids : List[int, int]

node ids; connected grid points at ends A and B The nodes may be coincident, but then cid is required.

x : List[float, float, float]; None
List : the directional vector used to define the stiffnesses

or damping from the PBUSH card

None : use g0

g0 : int/None
int : the directional vector used to define the stiffnesses

or damping from the PBUSH card

None : use x

cid : int; default=None

Element coordinate system identification. A 0 means the basic coordinate system. If CID is blank, then the element coordinate system is determined from GO or Xi.

s: float; default=0.5

Location of spring damper (0 <= s <= 1.0)

ocid : int; default=-1

Coordinate system identification of spring-damper offset. (Integer > -1; Default = -1, which means the offset point lies on the line between GA and GB)

si : List[float, float, float]; default=None

Components of spring-damper offset in the OCID coordinate system if OCID > 0. None : [None, None, None]

comment : str; default=’‘

a comment for the card

add_cbush1d(self, eid, pid, nids, cid=None, comment='')

Creates a CBUSH1D card

add_cbush2d(self, eid, pid, nids, cid=0, plane='XY', sptid=None, comment='')

Creates a CBUSH2D card

add_cconeax(self, eid, pid, rings, comment='')

Creates a CCONEAX card

add_cdamp1(self, eid, pid, nids, c1=0, c2=0, comment='')

Creates a CDAMP1 card

Parameters:
eid : int

element id

pid : int

property id (PDAMP)

nids : List[int, int]

node ids

c1 / c2 : int; default=0

DOF for nid1 / nid2

comment : str; default=’‘

a comment for the card

add_cdamp2(self, eid, b, nids, c1=0, c2=0, comment='')

Creates a CDAMP2 card

Parameters:
eid : int

element id

b : float

damping

nids : List[int, int]

SPOINT ids node ids

c1 / c2 : int; default=0

DOF for nid1 / nid2

comment : str; default=’‘

a comment for the card

add_cdamp3(self, eid, pid, nids, comment='')

Creates a CDAMP3 card

Parameters:
eid : int

element id

pid : int

property id (PDAMP)

nids : List[int, int]

SPOINT ids

comment : str; default=’‘

a comment for the card

add_cdamp4(self, eid, b, nids, comment='')

Creates a CDAMP4 card

Parameters:
eid : int

element id

b : float

damping

nids : List[int, int]

SPOINT ids

comment : str; default=’‘

a comment for the card

add_cdamp5(self, eid, pid, nids, comment='')

Creates a CDAMP5 card

Parameters:
eid : int

element id

pid : int

property id (PDAMP5)

nids : List[int, int]

GRID/SPOINT ids

comment : str; default=’‘

a comment for the card

add_celas1(self, eid, pid, nids, c1=0, c2=0, comment='')

Creates a CELAS1 card

Parameters:
eid : int

element id

pid : int

property id (PELAS)

nids : List[int, int]

node ids

c1 / c2 : int; default=0

DOF for nid1 / nid2

comment : str; default=’‘

a comment for the card

add_celas2(self, eid, k, nids, c1=0, c2=0, ge=0.0, s=0.0, comment='')

Creates a CELAS2 card

Parameters:
eid : int

element id

k : float

spring stiffness

nids : List[int, int]

SPOINT ids node ids

c1 / c2 : int; default=0

DOF for nid1 / nid2

ge : int; default=0.0

damping coefficient

s : float; default=0.0

stress coefficient

comment : str; default=’‘

a comment for the card

add_celas3(self, eid, pid, nids, comment='')

Creates a CELAS3 card

Parameters:
eid : int

element id

pid : int

property id (PELAS)

nids : List[int, int]

SPOINT ids

comment : str; default=’‘

a comment for the card

add_celas4(self, eid, k, nids, comment='')

Creates a CELAS4 card

Parameters:
eid : int

element id

k : float

spring stiffness

nids : List[int, int]

SPOINT ids

comment : str; default=’‘

a comment for the card

add_cfast(self, eid, pid, Type, ida, idb, gs=None, ga=None, gb=None, xs=None, ys=None, zs=None, comment='')

Creates a CFAST card

add_cfluid2(self, eid, ringfls, rho, b, harmonic)
add_cfluid3(self, eid, ringfls, rho, b, harmonic)
add_cfluid4(self, eid, ringfls, rho, b, harmonic)
add_cgap(self, eid, pid, nids, x, g0, cid=None, comment='')

Creates a CGAP card

Parameters:
eid : int

Element ID

pid : int

Property ID (PGAP)

nids : List[int, int]

node ids; connected grid points at ends A and B

x : List[float, float, float]

Components of the orientation vector, from GA, in the displacement coordinate system at GA

g0 : int

GO Alternate method to supply the orientation vector using grid point GO. Direction of is from GA to GO

cid : int; default=None

Element coordinate system identification number. CID must be specified if GA and GB are coincident (distance from GA to GB < 10^-4)

comment : str; default=’‘

a comment for the card

add_cgen(self, Type, field_eid, pid, field_id, th_geom_opt, eidl, eidh, t_abcd=None, direction='L', comment='')

Creates a CGEN card

add_chbdye(self, eid, eid2, side, iview_front=0, iview_back=0, rad_mid_front=0, rad_mid_back=0, comment='')

Creates a CHBDYE card

Parameters:
eid : int

surface element ID number for a side of an element

eid2: int

a heat conduction element identification

side: int

a consistent element side identification number (1-6)

iview_front: int; default=0

a VIEW entry identification number for the front face

iview_back: int; default=0

a VIEW entry identification number for the back face

rad_mid_front: int; default=0

RADM identification number for front face of surface element

rad_mid_back: int; default=0

RADM identification number for back face of surface element

comment : str; default=’‘

a comment for the card

add_chbdyg(self, eid, surface_type, nodes, iview_front=0, iview_back=0, rad_mid_front=0, rad_mid_back=0, comment='')

Creates a CHBDYG card

add_chbdyp(self, eid, pid, surface_type, g1, g2, g0=0, gmid=None, ce=0, iview_front=0, iview_back=0, rad_mid_front=0, rad_mid_back=0, e1=None, e2=None, e3=None, comment='')

Creates a CHBDYP card

Parameters:
eid : int

Surface element ID

pid : int

PHBDY property entry identification numbers. (Integer > 0)

surface_type : str

Surface type Must be {POINT, LINE, ELCYL, FTUBE, TUBE}

iview_front : int; default=0

A VIEW entry identification number for the front face.

iview_back : int; default=0

A VIEW entry identification number for the back face.

g1 / g2 : int

Grid point identification numbers of grids bounding the surface

g0 : int; default=0

Orientation grid point

rad_mid_front : int

RADM identification number for front face of surface element

rad_mid_back : int

RADM identification number for back face of surface element.

gmid : int

Grid point identification number of a midside node if it is used with the line type surface element.

ce : int; default=0

Coordinate system for defining orientation vector

e1 / e2 / e3 : float; default=None

Components of the orientation vector in coordinate system CE. The origin of the orientation vector is grid point G1.

comment : str; default=’‘

a comment for the card

add_chexa(self, eid, pid, nids, comment='')

Creates a CHEXA8/CHEXA20

Parameters:
eid : int

element id

pid : int

property id (PSOLID, PLSOLID)

nids : List[int]

node ids; n=8 or 20

comment : str; default=’‘

a comment for the card

add_cihex1(self, eid, pid, nids, comment='')

see CHEXA

add_cihex2(self, eid, pid, nids, comment='')

see CHEXA

add_cmass1(self, eid, pid, nids, c1=0, c2=0, comment='')

Creates a CMASS1 card

Parameters:
eid : int

element id

pid : int

property id (PMASS)

nids : List[int, int]

node ids

c1 / c2 : int; default=None

DOF for nid1 / nid2

comment : str; default=’‘

a comment for the card

add_cmass2(self, eid, mass, nids, c1, c2, comment='')

Creates a CMASS2 card

Parameters:
eid : int

element id

mass : float

mass

nids : List[int, int]

node ids

c1 / c2 : int; default=None

DOF for nid1 / nid2

comment : str; default=’‘

a comment for the card

add_cmass3(self, eid, pid, nids, comment='')

Creates a CMASS3 card

Parameters:
eid : int

element id

pid : int

property id (PMASS)

nids : List[int, int]

SPOINT ids

comment : str; default=’‘

a comment for the card

add_cmass4(self, eid, mass, nids, comment='')

Creates a CMASS4 card

Parameters:
eid : int

element id

mass : float

SPOINT mass

nids : List[int, int]

SPOINT ids

comment : str; default=’‘

a comment for the card

add_cmfree(self, eid, s, s2, y, n)
add_conm1(self, eid, nid, mass_matrix, cid=0, comment='')

Creates a CONM1 card

Parameters:
eid : int

element id

nid : int

the node to put the mass matrix

mass_matrix : (6, 6) float ndarray

the 6x6 mass matrix, M

cid : int; default=0

the coordinate system for the mass matrix

comment : str; default=’‘

a comment for the card

::
[M] = [M11 M21 M31 M41 M51 M61]

[ M22 M32 M42 M52 M62] [ M33 M43 M53 M63] [ M44 M54 M64] [ Sym M55 M65] [ M66]

add_conm2(self, eid, nid, mass, cid=0, X=None, I=None, comment='')

Creates a CONM2 card

Parameters:
eid : int

element id

nid : int

node id

mass : float

the mass of the CONM2

cid : int; default=0

coordinate frame of the offset (-1=absolute coordinates)

X : (3, ) List[float]; default=None -> [0., 0., 0.]

xyz offset vector relative to nid

I : (6, ) List[float]; default=None -> [0., 0., 0., 0., 0., 0.]

mass moment of inertia matrix about the CG I11, I21, I22, I31, I32, I33 = I

comment : str; default=’‘

a comment for the card

add_conrod(self, eid, mid, nids, A=0.0, j=0.0, c=0.0, nsm=0.0, comment='')

Creates a CONROD card

Parameters:
eid : int

element id

mid : int

material id

nids : List[int, int]

node ids

A : float; default=0.

area

j : float; default=0.

polar moment of inertia

c : float; default=0.

stress factor

nsm : float; default=0.

non-structural mass per unit length

comment : str; default=’‘

a comment for the card

add_conv(self, eid, pconid, ta, film_node=0, cntrlnd=0, comment='')

Creates a CONV card

Parameters:
eid : int

element id

pconid : int

Convection property ID

mid : int

Material ID

ta : List[int]

Ambient points used for convection 0’s are allowed for TA2 and higher

film_node : int; default=0

Point for film convection fluid property temperature

cntrlnd : int; default=0

Control point for free convection boundary condition

comment : str; default=’‘

a comment for the card

add_convm(self, eid, pconvm, ta1, film_node=0, cntmdot=0, ta2=None, mdot=1.0, comment='')

Creates a CONVM card

Parameters:
eid : int

element id (CHBDYP)

pconid : int

property ID (PCONVM)

mid : int

Material ID

ta1 : int

ambient point for convection

ta2 : int; default=None

None : ta1 ambient point for convection

film_node : int; default=0
cntmdot : int; default=0

control point used for controlling mass flow 0/blank is only allowed when mdot > 0

mdot : float; default=1.0

a multiplier for the mass flow rate in case there is no point associated with the CNTRLND field required if cntmdot = 0

comment : str; default=’‘

a comment for the card

add_cord1c(self, cid, g1, g2, g3, comment='')

Creates the CORD1C card, which defines a cylindrical coordinate system using 3 GRID points.

Parameters:
cid : int

the coordinate id

g1 : int

grid point 1

g2 : int

grid point 2

g3 : int

grid point 3

comment : str; default=’‘

a comment for the card

add_cord1r(self, cid, g1, g2, g3, comment='')

Creates the CORD1R card, which defines a rectangular coordinate system using 3 GRID points.

Parameters:
cid : int

the coordinate id

g1 : int

grid point 1

g2 : int

grid point 2

g3 : int

grid point 3

comment : str; default=’‘

a comment for the card

add_cord1s(self, cid, g1, g2, g3, comment='')

Creates the CORD1S card, which defines a spherical coordinate system using 3 GRID points.

Parameters:
cid : int

the coordinate id

g1 : int

grid point 1

g2 : int

grid point 2

g3 : int

grid point 3

comment : str; default=’‘

a comment for the card

add_cord2c(self, cid, origin, zaxis, xzplane, rid=0, comment='')

Creates the CORD2C card, which defines a cylindrical coordinate system using 3 vectors.

Parameters:
cid : int

coordinate system id

rid : int; default=0

the referenced coordinate system that defines the system the vectors

origin : List[float, float, float]

the origin of the coordinate system

zaxis : List[float, float, float]

the z-axis of the coordinate system

xzplane : List[float, float, float]

a point on the xz plane

comment : str; default=’‘

a comment for the card

add_cord2r(self, cid, origin, zaxis, xzplane, rid=0, comment='')

Creates the CORD2R card, which defines a rectangular coordinate system using 3 vectors.

Parameters:
cid : int

coordinate system id

rid : int; default=0

the referenced coordinate system that defines the system the vectors

origin : List[float, float, float]

the origin of the coordinate system

zaxis : List[float, float, float]

the z-axis of the coordinate system

xzplane : List[float, float, float]

a point on the xz plane

comment : str; default=’‘

a comment for the card

add_cord2s(self, cid, origin, zaxis, xzplane, rid=0, comment='')

Creates the CORD2C card, which defines a spherical coordinate system using 3 vectors.

Parameters:
cid : int

coordinate system id

origin : List[float, float, float]

the origin of the coordinate system

zaxis : List[float, float, float]

the z-axis of the coordinate system

xzplane : List[float, float, float]

a point on the xz plane

rid : int; default=0

the referenced coordinate system that defines the system the vectors

comment : str; default=’‘

a comment for the card

add_cpenta(self, eid, pid, nids, comment='')

Creates a CPENTA6/CPENTA15

Parameters:
eid : int

element id

pid : int

property id (PSOLID, PLSOLID)

nids : List[int]

node ids; n=6 or 15

comment : str; default=’‘

a comment for the card

add_cplstn3(self, eid, pid, nids, theta=0.0, comment='')

Creates a CPLSTN4 card

add_cplstn4(self, eid, pid, nids, theta=0.0, comment='')

Creates a CPLSTN4 card

add_cplstn6(self, eid, pid, nids, theta=0.0, comment='')

Creates a CPLSTN6 card

add_cplstn8(self, eid, pid, nids, theta=0.0, comment='')

Creates a CPLSTN8 card

add_cplsts3(self, eid, pid, nids, theta=0.0, comment='')

Creates a CPLSTS3 card

add_cpyram(self, eid, pid, nids, comment='')

Creates a CPYRAM5/CPYRAM13

Parameters:
eid : int

element id

pid : int

property id (PSOLID, PLSOLID)

nids : List[int]

node ids; n=5 or 13

comment : str; default=’‘

a comment for the card

add_cquad(self, eid, pid, nids, theta_mcid=0.0, comment='')

Creates a CQUAD card

Parameters:
eid : int

element id

pid : int

property id (PSHELL/PCOMP/PCOMPG)

nids : List[int, int, int, int, int/None, int/None,

int/None, int/None, int/None]

node ids

theta_mcid : float; default=0.0
float : material coordinate system angle (theta) is defined

relative to the element coordinate system

int : x-axis from material coordinate system angle defined by

mcid is projected onto the element

comment : str; default=’‘

a comment for the card

add_cquad4(self, eid, pid, nids, theta_mcid=0.0, zoffset=0.0, tflag=0, T1=None, T2=None, T3=None, T4=None, comment='')

Creates a CQUAD4 card

Parameters:
eid : int

element id

pid : int

property id (PSHELL/PCOMP/PCOMPG)

nids : List[int, int, int, int]

node ids

zoffset : float; default=0.0

Offset from the surface of grid points to the element reference plane. Requires MID1 and MID2.

theta_mcid : float; default=0.0
float : material coordinate system angle (theta) is defined

relative to the element coordinate system

int : x-axis from material coordinate system angle defined by

mcid is projected onto the element

tflag : int; default=0

0 : Ti are actual user specified thicknesses 1 : Ti are fractions relative to the T value of the PSHELL

T1 / T2 / T3 / T4 : float; default=None

If it is not supplied, then T1 through T4 will be set equal to the value of T on the PSHELL entry.

comment : str; default=’‘

a comment for the card

add_cquad8(self, eid, pid, nids, theta_mcid=0.0, zoffset=0.0, tflag=0, T1=None, T2=None, T3=None, T4=None, comment='')

Creates a CQUAD8 card

Parameters:
eid : int

element id

pid : int

property id (PSHELL/PCOMP/PCOMPG)

nids : List[int, int, int, int, int/None, int/None, int/None, int/None]

node ids

zoffset : float; default=0.0

Offset from the surface of grid points to the element reference plane. Requires MID1 and MID2.

theta_mcid : float; default=0.0
float : material coordinate system angle (theta) is defined

relative to the element coordinate system

int : x-axis from material coordinate system angle defined by

mcid is projected onto the element

tflag : int; default=0

0 : Ti are actual user specified thicknesses 1 : Ti are fractions relative to the T value of the PSHELL

T1 / T2 / T3 / T4 : float; default=None

If it is not supplied, then T1 through T4 will be set equal to the value of T on the PSHELL entry.

comment : str; default=’‘

a comment for the card

add_cquadr(self, eid, pid, nids, theta_mcid=0.0, zoffset=0.0, tflag=0, T1=None, T2=None, T3=None, T4=None, comment='')

Creates a CQUADR card

Parameters:
eid : int

element id

pid : int

property id (PSHELL/PCOMP/PCOMPG)

nids : List[int, int, int, int]

node ids

zoffset : float; default=0.0

Offset from the surface of grid points to the element reference plane. Requires MID1 and MID2.

theta_mcid : float; default=0.0
float : material coordinate system angle (theta) is defined

relative to the element coordinate system

int : x-axis from material coordinate system angle defined by

mcid is projected onto the element

tflag : int; default=0

0 : Ti are actual user specified thicknesses 1 : Ti are fractions relative to the T value of the PSHELL

T1 / T2 / T3 / T4 : float; default=None

If it is not supplied, then T1 through T4 will be set equal to the value of T on the PSHELL entry.

comment : str; default=’‘

a comment for the card

add_cquadx(self, eid, pid, nids, theta_mcid=0.0, comment='')

Creates a CQUADX card

add_cquadx4(self, eid, pid, nids, theta=0.0, comment='')

Creates a CQUADX4 card

add_cquadx8(self, eid, pid, nids, theta=0.0, comment='')

Creates a CQUADX8 card

add_crac2d(self, eid, pid, nids, comment='')

Creates a PRAC2D card

add_crac3d(self, eid, pid, nids, comment='')

Creates a CRAC3D card

add_creep(self, mid, T0, exp, form, tidkp, tidcp, tidcs, thresh, Type, a, b, c, d, e, f, g, comment='')

Creates a CREEP card

add_crod(self, eid, pid, nids, comment='')

Creates a CROD card

Parameters:
eid : int

element id

pid : int

property id (PROD)

nids : List[int, int]

node ids

comment : str; default=’‘

a comment for the card

add_cset(self, ids, components, comment='')

Creates an CSET/CSET1 card, which defines the degree of freedoms that will be free during a generalized dynamic reduction or component model synthesis calculation.

Parameters:
ids : List[int]

the GRID/SPOINT ids

components : List[str]; str

the degree of freedoms to be free (e.g., ‘1’, ‘123’) if a list is passed in, a CSET is made if a str is passed in, a CSET1 is made

comment : str; default=’‘

a comment for the card

Notes

the length of components and ids must be the same

add_cset1(self, ids, components, comment='')

See also

add_cset

add_cshear(self, eid, pid, nids, comment='')

Creates a CSHEAR card

Parameters:
eid : int

element id

pid : int

property id (PSHEAR)

nids : List[int, int, int, int]

node ids

comment : str; default=’‘

a comment for the card

add_csschd(self, sid, aesid, lschd, lalpha=None, lmach=None, comment='')

Creates an CSSCHD card, which defines a specified control surface deflection as a function of Mach and alpha (used in SOL 144/146).

Parameters:
sid : int

the unique id

aesid : int

the control surface (AESURF) id

lalpha : int; default=None

the angle of attack profile (AEFACT) id

lmach : int; default=None

the mach profile (AEFACT) id

lschd : int; default=None

the control surface deflection profile (AEFACT) id

comment : str; default=’‘

a comment for the card

add_csuper(self, seid, psid, nodes, comment='')
add_csupext(self, seid, nodes, comment='')
add_ctetra(self, eid, pid, nids, comment='')

Creates a CTETRA4/CTETRA10

Parameters:
eid : int

element id

pid : int

property id (PSOLID, PLSOLID)

nids : List[int]

node ids; n=4 or 10

comment : str; default=’‘

a comment for the card

add_ctrax3(self, eid, pid, nids, theta=0.0, comment='')

Creates a CTRAX3 card

add_ctrax6(self, eid, pid, nids, theta=0.0, comment='')

Creates a CTRAX6 card

add_ctria3(self, eid, pid, nids, zoffset=0.0, theta_mcid=0.0, tflag=0, T1=None, T2=None, T3=None, comment='')

Creates a CTRIA3 card

Parameters:
eid : int

element id

pid : int

property id (PSHELL/PCOMP/PCOMPG)

nids : List[int, int, int]

node ids

zoffset : float; default=0.0

Offset from the surface of grid points to the element reference plane. Requires MID1 and MID2.

theta_mcid : float; default=0.0
float : material coordinate system angle (theta) is defined

relative to the element coordinate system

int : x-axis from material coordinate system angle defined by

mcid is projected onto the element

tflag : int; default=0

0 : Ti are actual user specified thicknesses 1 : Ti are fractions relative to the T value of the PSHELL

T1 / T2 / T3 : float; default=None

If it is not supplied, then T1 through T3 will be set equal to the value of T on the PSHELL entry.

comment : str; default=’‘

a comment for the card

add_ctria6(self, eid, pid, nids, theta_mcid=0.0, zoffset=0.0, tflag=0, T1=None, T2=None, T3=None, comment='')

Creates a CTRIA6 card

Parameters:
eid : int

element id

pid : int

property id (PSHELL/PCOMP/PCOMPG)

nids : List[int, int, int, int/None, int/None, int/None]

node ids

zoffset : float; default=0.0

Offset from the surface of grid points to the element reference plane. Requires MID1 and MID2.

theta_mcid : float; default=0.0
float : material coordinate system angle (theta) is defined

relative to the element coordinate system

int : x-axis from material coordinate system angle defined by

mcid is projected onto the element

tflag : int; default=0

0 : Ti are actual user specified thicknesses 1 : Ti are fractions relative to the T value of the PSHELL

T1 / T2 / T3 : float; default=None

If it is not supplied, then T1 through T3 will be set equal to the value of T on the PSHELL entry.

comment : str; default=’‘

a comment for the card

add_ctriar(self, eid, pid, nids, theta_mcid=0.0, zoffset=0.0, tflag=0, T1=None, T2=None, T3=None, comment='')

Creates a CTRIAR card

Parameters:
eid : int

element id

pid : int

property id (PSHELL/PCOMP/PCOMPG)

nids : List[int, int, int]

node ids

zoffset : float; default=0.0

Offset from the surface of grid points to the element reference plane. Requires MID1 and MID2.

theta_mcid : float; default=0.0
float : material coordinate system angle (theta) is defined

relative to the element coordinate system

int : x-axis from material coordinate system angle defined by

mcid is projected onto the element

tflag : int; default=0

0 : Ti are actual user specified thicknesses 1 : Ti are fractions relative to the T value of the PSHELL

T1 / T2 / T3 : float; default=None

If it is not supplied, then T1 through T3 will be set equal to the value of T on the PSHELL entry.

comment : str; default=’‘

a comment for the card

add_ctriax(self, eid, pid, nids, theta_mcid=0.0, comment='')

Creates a CTRIAX card

add_ctriax6(self, eid, mid, nids, theta=0.0, comment='')

Creates a CTRIAX6 card

add_ctube(self, eid, pid, nids, comment='')

Creates a CTUBE card

Parameters:
eid : int

element id

pid : int

property id

nids : List[int, int]

node ids

comment : str; default=’‘

a comment for the card

add_cvisc(self, eid, pid, nids, comment='')

Creates a CVISC card

Parameters:
eid : int

element id

pid : int

property id (PVISC)

nids : List[int, int]

GRID ids

comment : str; default=’‘

a comment for the card

add_darea(self, sid, nid, component, scale, comment='')

Creates a DAREA card

Parameters:
sid : int

darea id

nid : int

GRID, EPOINT, SPOINT id

component : str

Component number. (0-6; 0-EPOINT/SPOINT; 1-6 GRID)

scale : float

Scale (area) factor

add_dconadd(self, oid, dconstrs, comment='')

Creates a DCONADD card

add_dconstr(self, oid, dresp_id, lid=-1e+20, uid=1e+20, lowfq=0.0, highfq=1e+20, comment='')

Creates a DCONSTR card

Parameters:
oid : int

unique optimization id

dresp_id : int

DRESP1/2 id

lid / uid=-1.e20 / 1.e20

lower/upper bound

lowfq / highfq : float; default=0. / 1.e20

lower/upper end of the frequency range

comment : str; default=’‘

a comment for the card

add_ddval(self, oid, ddvals, comment='')

Creates a DDVAL card

add_deform(self, sid, eid, deformation, comment='')

Creates an DEFORM card, which defines applied deformation on a 1D elemment. Links to the DEFORM card in the case control deck.

Parameters:
sid : int

load id

eid : int

CTUBE/CROD/CONROD/CBAR/CBEAM element id

deformation : float

the applied deformation

comment : str; default=’‘

a comment for the card

add_delay(self, sid, nodes, components, delays, comment='')

Creates a DELAY card

Parameters:
sid : int

DELAY id that is referenced by a TLOADx, RLOADx or ACSRCE card

nodes : List[int]

list of nodes that see the delay len(nodes) = 1 or 2

components : List[int]

the components corresponding to the nodes that see the delay len(nodes) = len(components)

delays : List[float]

Time delay (tau) for designated point Pi and component Ci len(nodes) = len(delays)

comment : str; default=’‘

a comment for the card

add_deqatn(self, equation_id, eqs, comment='')

Creates a DEQATN card

Parameters:
equation_id : int

the id of the equation

eqs : List[str]

the equations, which may overbound the field split them by a semicolon (;)

comment : str; default=’‘

a comment for the card

DEQATN 41 F1(A,B,C,D,R) = A+B *C-(D**3 + 10.0) + sin(PI(1) * R)
  • A**2 / (B - C); F = A + B - F1 * D
def F1(A, B, C, D, R):

F1 = A+B *C-(D**3 + 10.0) + sin(PI(1) * R) + A**2 / (B - C) F = A + B - F1 * D return F

eqs = [

‘F1(A,B,C,D,R) = A+B *C-(D**3 + 10.0) + sin(PI(1) * R) + A**2 / (B - C)’, ‘F = A + B - F1 * D’,

]
>>> deqatn = model.add_deqatn(41, eqs, comment=’‘)
add_desvar(self, desvar_id, label, xinit, xlb=-1e+20, xub=1e+20, delx=None, ddval=None, comment='')

Creates a DESVAR card

Parameters:
desvar_id : int

design variable id

label : str

name of the design variable

xinit : float

the starting point value for the variable

xlb : float; default=-1.e20

the lower bound

xub : float; default=1.e20

the lower bound

delx : float; default=1.e20

fractional change allowed for design variables during approximate optimization NX if blank : take from DOPTPRM; otherwise 1.0 MSC if blank : take from DOPTPRM; otherwise 0.5

ddval : int; default=None
int : DDVAL id

allows you to set discrete values

None : continuous

comment : str; default=’‘

a comment for the card

add_diverg(self, sid, nroots, machs, comment='')

Creates an DIVERG card, which is used in divergence analysis (SOL 144).

Parameters:
sid : int

The name

nroots : int

the number of roots

machs : List[float, …, float]

list of Mach numbers

comment : str; default=’‘

a comment for the card

Creates a DLINK card, which creates a variable that is a lienar ccombination of other design variables

Parameters:
oid : int

optimization id

dependent_desvar : int

the DESVAR to link

independent_desvars : List[int]

the DESVARs to combine

coeffs : List[int]

the linear combination coefficients

c0 : float; default=0.0

an offset

cmult : float; default=1.0

an scale factor

comment : str; default=’‘

a comment for the card

add_dload(self, sid, scale, scale_factors, load_ids, comment='')

Creates a DLOAD card

Parameters:
sid : int

Load set identification number. See Remarks 1. and 4. (Integer > 0)

scale : float

Scale factor. See Remarks 2. and 8. (Real)

Si : List[float]

Scale factors. See Remarks 2., 7. and 8. (Real)

load_ids : List[int]

Load set identification numbers of RLOAD1, RLOAD2, TLOAD1, TLOAD2, and ACSRCE entries. See Remarks 3. and 7. (Integer > 0)

comment : str; default=’‘

a comment for the card

add_dmi(self, name, form, tin, tout, nrows, ncols, GCj, GCi, Real, Complex=None, comment='')

Creates a DMI card

add_dmig(self, name, ifo, tin, tout, polar, ncols, GCj, GCi, Real, Complex=None, comment='')

Creates a DMIG card

Parameters:
name : str

the name of the matrix

ifo : int

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

tin : int

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

tout : int

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

polar : int; default=0

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

ncols : int

???

GCj : List[(node, dof)]

the [jnode, jDOFs]

GCi : List[(node, dof)]

the inode, iDOFs

Real : List[float]

The real values

Complex : List[float]; default=None

The complex values (if the matrix is complex)

comment : str; default=’‘

a comment for the card

add_dmig_uaccel(self, tin, ncol, load_sequences, comment='')

Creates a DMIG,UACCEL card

add_dmij(self, name, form, tin, tout, nrows, ncols, GCj, GCi, Real, Complex=None, comment='')

Creates a DMIJ card

add_dmiji(self, name, ifo, tin, tout, nrows, ncols, GCj, GCi, Real, Complex=None, comment='')
DMIJI | NAME | 0 | IFO | TIN | TOUT POLAR | | NCOL |
add_dmik(self, name, ifo, tin, tout, polar, ncols, GCj, GCi, Real, Complex=None, comment='')

Creates a DMIK card

Parameters:
name : str

the name of the matrix

ifo : int

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

tin : int

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

tout : int

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

polar : int; default=0

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

ncols : int

???

GCj : List[(node, dof)]

the jnode, jDOFs

GCi : List[(node, dof)]

the inode, iDOFs

Real : List[float]

The real values

Complex : List[float]; default=None

The complex values (if the matrix is complex)

comment : str; default=’‘

a comment for the card

add_doptprm(self, params, comment='')

Creates a DOPTPRM card

add_dphase(self, sid, nodes, components, phase_leads, comment='')

Creates a DPHASE card

Parameters:
sid : int

DPHASE id that is referenced by a RLOADx or ACSRCE card

nodes : List[int]

list of nodes that see the delay len(nodes) = 1 or 2

components : List[int]

the components corresponding to the nodes that see the delay len(nodes) = len(components)

phase_leads : List[float]

Phase lead θ in degrees. len(nodes) = len(delays)

comment : str; default=’‘

a comment for the card

add_dresp1(self, dresp_id, label, response_type, property_type, region, atta, attb, atti, validate=True, comment='')

Creates a DRESP1 card.

A DRESP1 is used to define a “simple” output result that may be optimized on. A simple result is a result like stress, strain, force, displacement, eigenvalue, etc. for a node/element that may be found in a non-optimization case.

Parameters:
dresp_id : int

response id

lable : str

Name of the response

response_type : str

Response type

property_type : str

Element flag (PTYPE = ‘ELEM’), or property entry name, or panel flag for ERP responses (PTYPE = ‘PANEL’ - See Remark 34), or RANDPS ID. Blank for grid point responses. ‘ELEM’ or property name used only with element type responses (stress, strain, force, etc.) to identify the relevant element IDs, or the property type and relevant property IDs.

Must be {ELEM, PBAR, PSHELL, PCOMP, PANEL, etc.) PTYPE = RANDPS ID when RTYPE=PSDDISP, PSDVELO, or PSDACCL.

region : str

Region identifier for constraint screening

atta : int / float / str / blank

Response attribute

attb : int / float / str / blank

Response attribute

atti : List[int / float / str]

the response values to pull from List[int]:

list of grid ids list of property ids

List[str]

‘ALL’

comment : str; default=’‘

a comment for the card

validate : bool; default=True

should the card be validated when it’s created

Examples

Stress/PSHELL

>>> dresp_id = 103
>>> label = 'resp1'
>>> response_type = 'STRESS'
>>> property_type = 'PSHELL'
>>> pid = 3
>>> atta = 9 # von mises upper surface stress
>>> region = None
>>> attb = None
>>> atti = [pid]
>>> DRESP1(dresp_id, label, response_type, property_type, region, atta, attb, atti)

Stress/PCOMP

>>> dresp_id = 104
>>> label = 'resp2'
>>> response_type = 'STRESS'
>>> property_type = 'PCOMP'
>>> pid = 3
>>> layer = 4
>>> atta = 9 # von mises upper surface stress
>>> region = None
>>> attb = layer
>>> atti = [pid]
>>> DRESP1(dresp_id, label, response_type, property_type, region, atta, attb, atti)
add_dresp2(self, dresp_id, label, dequation, region, params, method='MIN', c1=1.0, c2=0.005, c3=10.0, validate=True, comment='')

Creates a DRESP2 card.

A DRESP2 is used to define a “complex” output result that may be optimized on. A complex result is a result that uses:

  • simple (DRESP1) results
  • complex (DRESP2) results
  • default values (DTABLE)
  • DVCRELx values
  • DVMRELx values
  • DVPRELx values
  • DESVAR values

Then, an equation (DEQATN) is used to formulate an output response.

Parameters:
dresp_id : int

response id

label : str

Name of the response

dequation : int

DEQATN id

region : str

Region identifier for constraint screening

params : dict[(index, card_type)] = values

the storage table for the response function index : int

a counter

card_type : str

the type of card to pull from DESVAR, DVPREL1, DRESP2, etc.

values : List[int]

the values for this response

method : str; default=MIN

flag used for FUNC=BETA/MATCH FUNC = BETA

valid options are {MIN, MAX}

FUNC = MATCH

valid options are {LS, BETA}

c1 / c2 / c3 : float; default=1. / 0.005 / 10.0

constants for FUNC=BETA or FUNC=MATCH

comment : str; default=’‘

a comment for the card

validate : bool; default=False

should the card be validated when it’s created

params = {

(0, ‘DRESP1’) = [10, 20], (1, ‘DESVAR’) = [30], (2, ‘DRESP1’) = [40],

}
add_dresp3(self, dresp_id, label, group, Type, region, params, validate=True, comment='')

Creates a DRESP3 card

add_dscreen(self, rtype, trs=-0.5, nstr=20, comment='')

Creates a DSCREEN object

Parameters:
rtype : str

Response type for which the screening criteria apply

trs : float

Truncation threshold

nstr : int

Maximum number of constraints to be retained per region per load case

comment : str; default=’‘

a comment for the card

add_dtable(self, default_values, comment='')

Creates a DTABLE card

Parameters:
default_values : dict
key : str

the parameter name

value : float

the value

comment : str; default=’‘

a comment for the card

add_dti(self, name, fields, comment='')

Creates a DTI card

add_dvcrel1(self, oid, Type, eid, cp_name, dvids, coeffs, cp_min=None, cp_max=1e+20, c0=0.0, validate=True, comment='')

Creates a DVCREL1 card

Parameters:
oid : int

optimization id

prop_type : str

property card name (e.g., PSHELL)

EID : int

element id

cp_name : str/int

optimization parameter as an element connectivity name (e.g., X1)

dvids : List[int]

DESVAR ids

coeffs : List[float]

scale factors for DESVAR ids

cp_min : float; default=None

minimum value

cp_max : float; default=1e20

maximum value

c0 : float; default=0.

offset factor for the variable

validate : bool; default=False

should the variable be validated

comment : str; default=’‘

a comment for the card

add_dvcrel2(self, oid, Type, eid, cp_name, deqation, dvids, labels, cp_min=None, cp_max=1e+20, validate=True, comment='')

Creates a DVCREL2 card

add_dvgrid(self, dvid, nid, dxyz, cid=0, coeff=1.0, comment='')

Creates a DVGRID card

Parameters:
dvid : int

DESVAR id

nid : int

GRID/POINT id

dxyz : (3, ) float ndarray

the amount to move the grid point

cid : int; default=0

Coordinate system for dxyz

coeff : float; default=1.0

the dxyz scale factor

comment : str; default=’‘

a comment for the card

add_dvmrel1(self, oid, mat_type, mid, mp_name, dvids, coeffs, mp_min=None, mp_max=1e+20, c0=0.0, validate=True, comment='')

Creates a DVMREL1 card

Parameters:
oid : int

optimization id

prop_type : str

material card name (e.g., MAT1)

mid : int

material id

mp_name : str

optimization parameter as a pname (material name; E)

dvids : List[int]

DESVAR ids

coeffs : List[float]

scale factors for DESVAR ids

mp_min : float; default=None

minimum material property value

mp_max : float; default=1e20

maximum material property value

c0 : float; default=0.

offset factor for the variable

validate : bool; default=False

should the variable be validated

comment : str; default=’‘

a comment for the card

add_dvmrel2(self, oid, mat_type, mid, mp_name, deqation, dvids, labels, mp_min=None, mp_max=1e+20, validate=True, comment='')

Creates a DVMREL2 card

Parameters:
oid : int

optimization id

mat_type : str

material card name (e.g., MAT1)

mid : int

material id

mp_name : str

optimization parameter as a pname (material name; E)

deqation : int

DEQATN id

dvids : List[int]; default=None

DESVAR ids

labels : List[str]; default=None

DTABLE names

mp_min : float; default=None

minimum material property value

mp_max : float; default=1e20

maximum material property value

validate : bool; default=False

should the variable be validated

comment : str; default=’‘

a comment for the card

Notes

either dvids or labels is required

add_dvprel1(self, oid, prop_type, pid, pname_fid, dvids, coeffs, p_min=None, p_max=1e+20, c0=0.0, validate=True, comment='')

Creates a DVPREL1 card

Parameters:
oid : int

optimization id

prop_type : str

property card name (e.g., PSHELL)

pid : int

property id

pname_fid : str/int

optimization parameter as a pname (property name; T) or field number (fid)

dvids : List[int]

DESVAR ids

coeffs : List[float]

scale factors for DESVAR ids

p_min : float; default=None

minimum property value

p_max : float; default=1e20

maximum property value

c0 : float; default=0.

offset factor for the variable

validate : bool; default=False

should the variable be validated

comment : str; default=’‘

a comment for the card

add_dvprel2(self, oid, prop_type, pid, pname_fid, deqation, dvids=None, labels=None, p_min=None, p_max=1e+20, validate=True, comment='')

Creates a DVPREL2 card

Parameters:
oid : int

optimization id

prop_type : str

property card name (e.g., PSHELL)

pid : int

property id

pname_fid : str/int

optimization parameter as a pname (property name; T) or field number (fid)

deqation : int

DEQATN id

dvids : List[int]; default=None

DESVAR ids

labels : List[str]; default=None

DTABLE names

p_min : float; default=None

minimum property value

p_max : float; default=1e20

maximum property value

validate : bool; default=False

should the variable be validated

comment : str; default=’‘

a comment for the card

Notes

either dvids or labels is required

add_eigb(self, sid, method, L1, L2, nep, ndp, ndn, norm, G, C, comment='')

Creates an EIGB card

add_eigc(self, sid, method, grid, component, epsilon, neigenvalues, norm='MAX', mblkszs=None, iblkszs=None, ksteps=None, NJIs=None, alphaAjs=None, omegaAjs=None, alphaBjs=None, omegaBjs=None, LJs=None, NEJs=None, NDJs=None, shift_r1=None, shift_i1=None, isrr_flag=None, nd1=None, comment='')

Creates an EIGC card

add_eigp(self, sid, alpha1, omega1, m1, alpha2, omega2, m2, comment='')

Creates an EIGP card

add_eigr(self, sid, method='LAN', f1=None, f2=None, ne=None, nd=None, norm='MASS', G=None, C=None, comment='')

Adds a EIGR card

Parameters:
sid : int

method id

method : str; default=’LAN’

eigenvalue method recommended: {LAN, AHOU} obsolete : {INV, SINV, GIV, MGIV, HOU, MHOU, AGIV}

f1 / f2 : float; default=None

lower/upper bound eigenvalue

f2 : float; default=None

upper bound eigenvalue

ne : int; default=None

estimate of number of roots (used for INV)

nd : int; default=None

desired number of roots

msglvl : int; default=0

debug level; 0-4

maxset : int; default=None

Number of vectors in block or set

shfscl : float; default=None

estimate of first flexible mode natural frequency

norm : str; default=None

{MAX, MASS, AF, POINT} default=MASS (NX)

G : int; default=None

node id for normalization; only for POINT

C : int; default=None

component for normalization (1-6); only for POINT

comment : str; default=’‘

a comment for the card

add_eigrl(self, sid, v1=None, v2=None, nd=None, msglvl=0, maxset=None, shfscl=None, norm=None, options=None, values=None, comment='')

Adds an EIGRL card

Parameters:
sid : int

method id

v1 : float; default=None

lower bound eigenvalue

v2 : float; default=None

upper bound eigenvalue

nd : int

number of roots

msglvl : int; default=0

debug level; 0-4

maxset : int; default=None

Number of vectors in block or set

shfscl : float; default=None

estimate of first flexible mode natural frequency

norm : str; default=None

{MAX, MASS}

options : ???; default=None -> []

???

values : ???; default=None -> []

???

comment : str; default=’‘

a comment for the card

add_epoint(self, ids, comment='')

Creates the EPOINTs card that contains many EPOINTs

Parameters:
ids : List[int]

EPOINT ids

comment : str; default=’‘

a comment for the card

add_flfact(self, sid, factors, comment='')

Creates an FLFACT card, which defines factors used for flutter analysis. These factors define either:

  • density
  • mach
  • velocity
  • reduced frequency

depending on the FLUTTER method chosen (e.g., PK, PKNL, PKNLS)

Parameters:
sid : int

the id of a density, reduced_frequency, mach, or velocity table the FLUTTER card defines the meaning

factors : varies
values : List[float, …, float]

list of factors

List[f1, THRU, fnf, nf, fmid]
f1 : float

first value

THRU : str

the word THRU

fnf : float

second value

nf : int

number of values

fmid : float; default=(f1 + fnf) / 2.

the mid point to bias the array

TODO: does f1 need be be greater than f2/fnf???

comment : str; default=’‘

a comment for the card

add_flutter(self, sid, method, density, mach, reduced_freq_velocity, imethod='L', nvalue=None, omax=None, epsilon=0.001, comment='')

Creates a FLUTTER card, which is required for a flutter (SOL 145) analysis.

Parameters:
sid : int

flutter id

method : str
valid methods = [K, KE,

PKS, PKNLS, PKNL, PKE]

density : int

defines a series of air densities in units of mass/volume PARAM,WTMASS does not affect this AERO affects this references an FLFACT id

mach : int

defines a series of the mach numbers references an FLFACT id

reduced_freq_velocity : int
Defines a series of either:
  1. reduced frequencies - K, KE
  2. velocities - PK, PKNL, PKS, PKNLS

depending on the method chosen. references an FLFACT id

imethod : str; default=’L’

Choice of interpolation method for aerodynamic matrix interpolation. imethods :

  1. L - linear
  2. S - surface
  3. TCUB - termwise cubic
nvalue : int

Number of eigenvalues beginning with the first eigenvalue for output and plots

omax : float

For the PKS and PKNLS methods, OMAX specifies the maximum frequency, in Hz., to be used in he flutter sweep. MSC only.

epsilon : float; default=1.0e-3

Convergence parameter for k. Used in the PK and PKNL methods only

comment : str; default=’‘

a comment for the card

add_force(self, sid, node, mag, xyz, cid=0, comment='')

Creates a FORCE card

Parameters:
sid : int

load id

node : int

the node to apply the load to

mag : float

the load’s magnitude

xyz : (3, ) float ndarray

the load direction in the cid frame

cid : int; default=0

the coordinate system for the load

comment : str; default=’‘

a comment for the card

add_force1(self, sid, node, mag, g1, g2, comment='')

Creates a FORCE1 card

Parameters:
sid : int

load id

node : int

the node to apply the load to

mag : float

the load’s magnitude

n1 / n2 : int / int

defines the load direction n = n2 - n1

comment : str; default=’‘

a comment for the card

add_force2(self, sid, node, mag, g1, g2, g3, g4, comment='')

Creates a FORCE2 card

Parameters:
sid : int

load id

node : int

the node to apply the load to

mag : float

the load’s magnitude

g1 / g2 / g3 / g4 : int / int / int / int

defines the load direction n = (g2 - g1) x (g4 - g3)

comment : str; default=’‘

a comment for the card

add_freq(self, sid, freqs, comment='')

Creates a FREQ card

Parameters:
sid : int

set id referenced by case control FREQUENCY

freqs : List[float]

the frequencies for a FREQx object

comment : str; default=’‘

a comment for the card

add_freq1(self, sid, f1, df, ndf=1, comment='')

Creates a FREQ1 card

Parameters:
sid : int

set id referenced by case control FREQUENCY

f1 : float

first frequency

df : float

frequency increment

ndf : int; default=1

number of frequency increments

comment : str; default=’‘

a comment for the card

add_freq2(self, sid, f1, f2, nf=1, comment='')

Creates a FREQ2 card

Parameters:
sid : int

set id referenced by case control FREQUENCY

f1 : float

first frequency

f2 : float

last frequency

nf : int; default=1

number of logorithmic intervals

comment : str; default=’‘

a comment for the card

add_freq3(self, sid, f1, f2=None, Type='LINEAR', nef=10, cluster=1.0, comment='')

Creates a FREQ3 card

add_freq4(self, sid, f1=0.0, f2=1e+20, fspread=0.1, nfm=3, comment='')

Creates a FREQ4 card

Parameters:
sid : int

set id referenced by case control FREQUENCY

f1 : float; default=0.0

Lower bound of frequency range in cycles per unit time.

f2 : float; default=1E20

Upper bound of frequency range in cycles per unit time.

nfm : int; default=3

Number of evenly spaced frequencies per ‘spread’ mode.

comment : str; default=’‘

a comment for the card

add_freq5(self, sid, fractions, f1=0.0, f2=1e+20, comment='')

Creates a FREQ5 card

Parameters:
sid : int

set id referenced by case control FREQUENCY

f1 : float; default=0.0

Lower bound of frequency range in cycles per unit time.

f2 : float; default=1e20

Upper bound of frequency range in cycles per unit time.

fractions : List[float]

Fractions of the natural frequencies in the range F1 to F2.

comment : str; default=’‘

a comment for the card

Notes

FREQ5 is only valid in modal frequency-response solutions (SOLs 111, 146, and 200) and is ignored in direct frequency response solutions.

add_genel_flexibility(self, eid, ul, ud, z, s=None)

creates a GENEL card using the flexiblity approach

add_genel_stiffness(self, eid, ul, ud, k, s=None)

creates a GENEL card using the stiffness approach

add_gmload(self, sid, normal, entity, entity_id, method, load_magnitudes, cid=0, comment='')

Creates a GMLOAD object

add_gmspc(self, conid, component, entity, entity_id, comment='')

Creates a GMSPC card

add_grav(self, sid, scale, N, cid=0, mb=0, comment='')

Creates an GRAV card

Parameters:
sid : int

load id

scale : float

scale factor for load

N : (3, ) float ndarray

the acceleration vector in the cid frame

cid : int; default=0

the coordinate system for the load

mb : int; default=0

???

comment : str; default=’‘

a comment for the card

add_grdset(self, cp, cd, ps, seid, comment='')

Creates the GRDSET card

Parameters:
cp : int; default=0

the xyz coordinate frame

cd : int; default=0

the analysis coordinate frame

ps : str; default=’‘

Additional SPCs in the analysis coordinate frame (e.g. ‘123’). This corresponds to DOF set SG.

seid : int; default=0

superelement id TODO: how is this used by Nastran???

comment : str; default=’‘

a comment for the card

add_grid(self, nid, xyz, cp=0, cd=0, ps='', seid=0, comment='')

Creates the GRID card

Parameters:
nid : int

node id

cp : int; default=0

the xyz coordinate frame

xyz : (3, ) float ndarray; default=None -> [0., 0., 0.]

the xyz/r-theta-z/rho-theta-phi values

cd : int; default=0

the analysis coordinate frame

ps : str; default=’‘

Additional SPCs in the analysis coordinate frame (e.g. ‘123’). This corresponds to DOF set SG.

seid : int; default=0

superelement id TODO: how is this used by Nastran???

comment : str; default=’‘

a comment for the card

add_gust(self, sid, dload, wg, x0, V=None, comment='')

Creates a GUST card, which defines a stationary vertical gust for use in aeroelastic response analysis.

Parameters:
sid : int

gust load id

dload : int

TLOADx or RLOADx entry that defines the time/frequency dependence

wg : float

Scale factor (gust velocity/forward velocity) for gust velocity

x0 : float

Streamwise location in the aerodynamic coordinate system of the gust reference point.

V : float; default=None
float : velocity of the vehicle (must be the same as the

velocity on the AERO card)

None : ???

comment : str; default=’‘

a comment for the card

add_load(self, sid, scale, scale_factors, load_ids, comment='')

Creates a LOAD card

Parameters:
sid : int

load id

scale : float

overall scale factor

scale_factors : List[float]

individual scale factors (corresponds to load_ids)

load_ids : List[int]

individual load_ids (corresponds to scale_factors)

comment : str; default=’‘

a comment for the card

add_loadcyn(self, sid, scale, segment_id, scales, load_ids, segment_type=None, comment='')

Creates a LOADCYN card

add_lseq(self, sid, excite_id, lid, tid=None, comment='')

Creates a LSEQ card

Parameters:
sid : int

loadset id; LOADSET points to this

excite_id : int

set id assigned to this static load vector

lid : int

load set id of a set of static load entries; LOAD in the Case Control

tid : int; default=None

temperature set id of a set of thermal load entries; TEMP(LOAD) in the Case Control

comment : str; default=’‘

a comment for the card

add_mat1(self, mid, E, G, nu, rho=0.0, a=0.0, tref=0.0, ge=0.0, St=0.0, Sc=0.0, Ss=0.0, mcsid=0, comment='')

Creates a MAT1 card

Parameters:
mid : int

material id

E : float / None

Young’s modulus

G : float / None

Shear modulus

nu : float / None

Poisson’s ratio

rho : float; default=0.

density

a : float; default=0.

coefficient of thermal expansion

tref : float; default=0.

reference temperature

ge : float; default=0.

damping coefficient

St / Sc / Ss : float; default=0.

tensile / compression / shear allowable

mcsid : int; default=0

material coordinate system id used by PARAM,CURV

comment : str; default=’‘

a comment for the card

If E, G, or nu is None (only 1), it will be calculated
add_mat10(self, mid, bulk, rho, c, ge=0.0, gamma=None, table_bulk=None, table_rho=None, table_ge=None, table_gamma=None, comment='')

Creates a MAT10 card

Parameters:
mid : int

material id

bulk : float; default=None

Bulk modulus

rho : float; default=None

Density

c : float; default=None

Speed of sound

ge : float; default=0.

Damping

gamma : float; default=None

NX : ratio of imaginary bulk modulus to real bulk modulus; default=0.0 MSC : normalized admittance coefficient for porous material

table_bulk : int; default=None

TABLEDx entry defining bulk modulus vs. frequency None for MSC Nastran

table_rho : int; default=None

TABLEDx entry defining rho vs. frequency None for MSC Nastran

table_ge : int; default=None

TABLEDx entry defining ge vs. frequency None for MSC Nastran

table_gamma : int; default=None

TABLEDx entry defining gamma vs. frequency None for MSC Nastran

comment : str; default=’‘

a comment for the card

add_mat11(self, mid, e1, e2, e3, nu12, nu13, nu23, g12, g13, g23, rho=0.0, a1=0.0, a2=0.0, a3=0.0, tref=0.0, ge=0.0, comment='')

Creates a MAT11 card

add_mat2(self, mid, G11, G12, G13, G22, G23, G33, rho=0.0, a1=None, a2=None, a3=None, tref=0.0, ge=0.0, St=None, Sc=None, Ss=None, mcsid=None, comment='')

Creates an MAT2 card

add_mat3(self, mid, ex, eth, ez, nuxth, nuthz, nuzx, rho=0.0, gzx=None, ax=0.0, ath=0.0, az=0.0, tref=0.0, ge=0.0, comment='')

Creates a MAT3 card

add_mat3d(self, mid, e1, e2, e3, nu12, nu13, nu23, g12, g13, g23, rho=0.0, comment='')

This is a VABS specific card that is almost identical to the MAT11.

add_mat4(self, mid, k, cp=0.0, rho=1.0, H=None, mu=None, hgen=1.0, ref_enthalpy=None, tch=None, tdelta=None, qlat=None, comment='')

Creates a MAT4 card

add_mat5(self, mid, kxx=0.0, kxy=0.0, kxz=0.0, kyy=0.0, kyz=0.0, kzz=0.0, cp=0.0, rho=1.0, hgen=1.0, comment='')

Creates a MAT5 card

add_mat8(self, mid, e11, e22, nu12, g12=0.0, g1z=100000000.0, g2z=100000000.0, rho=0.0, a1=0.0, a2=0.0, tref=0.0, Xt=0.0, Xc=None, Yt=0.0, Yc=None, S=0.0, ge=0.0, F12=0.0, strn=0.0, comment='')

Creates a MAT8 card

add_mat9(self, mid, G11=0.0, G12=0.0, G13=0.0, G14=0.0, G15=0.0, G16=0.0, G22=0.0, G23=0.0, G24=0.0, G25=0.0, G26=0.0, G33=0.0, G34=0.0, G35=0.0, G36=0.0, G44=0.0, G45=0.0, G46=0.0, G55=0.0, G56=0.0, G66=0.0, rho=0.0, A=None, tref=0.0, ge=0.0, comment='')

Creates a MAT9 card

add_matg(self, mid, idmem, behav, tabld, tablu, yprs, epl, gpl, gap=0.0, tab_yprs=None, tab_epl=None, tab_gpl=None, tab_gap=None, comment='')

Creates a MATG card

add_mathe(self, mid, model, bulk, rho, texp, mus, alphas, betas, mooney, sussbat, aboyce, comment='')

Creates a MATHE card

add_mathp(self, mid, a10=0.0, a01=0.0, d1=None, rho=0.0, av=0.0, tref=0.0, ge=0.0, na=1, nd=1, a20=0.0, a11=0.0, a02=0.0, d2=0.0, a30=0.0, a21=0.0, a12=0.0, a03=0.0, d3=0.0, a40=0.0, a31=0.0, a22=0.0, a13=0.0, a04=0.0, d4=0.0, a50=0.0, a41=0.0, a32=0.0, a23=0.0, a14=0.0, a05=0.0, d5=0.0, tab1=None, tab2=None, tab3=None, tab4=None, tabd=None, comment='')

Creates a MATHP card

add_mats1(self, mid, tid, Type, h, hr, yf, limit1, limit2, comment='')

Creates a MATS1 card

add_matt1(self, mid, e_table=None, g_table=None, nu_table=None, rho_table=None, a_table=None, ge_table=None, st_table=None, sc_table=None, ss_table=None, comment='')

Creates a MATT1 card

add_matt2(self, mid, g11_table=None, g12_table=None, g13_table=None, g22_table=None, g23_table=None, g33_table=None, rho_table=None, a1_table=None, a2_table=None, a3_table=None, ge_table=None, st_table=None, sc_table=None, ss_table=None, comment='')

Creates a MATT2 card

add_matt3(self, mid, ex_table=None, eth_table=None, ez_table=None, nuth_table=None, nuxz_table=None, rho_table=None, gzx_table=None, ax_table=None, ath_table=None, az_table=None, ge_table=None, comment='')

Creates a MATT3 card

add_matt4(self, mid, k_table=None, cp_table=None, h_table=None, mu_table=None, hgen_table=None, comment='')

Creates a MATT4 card

add_matt5(self, mid, kxx_table=None, kxy_table=None, kxz_table=None, kyy_table=None, kyz_table=None, kzz_table=None, cp_table=None, hgen_table=None, comment='')

Creates a MATT5 card

add_matt8(self, mid, e1_table=None, e2_table=None, nu12_table=None, g12_table=None, g1z_table=None, g2z_table=None, rho_table=None, a1_table=None, a2_table=None, xt_table=None, xc_table=None, yt_table=None, yc_table=None, s_table=None, ge_table=None, f12_table=None, comment='')

Creates a MATT8 card

add_matt9(self, mid, g11_table=None, g12_table=None, g13_table=None, g14_table=None, g15_table=None, g16_table=None, g22_table=None, g23_table=None, g24_table=None, g25_table=None, g26_table=None, g33_table=None, g34_table=None, g35_table=None, g36_table=None, g44_table=None, g45_table=None, g46_table=None, g55_table=None, g56_table=None, g66_table=None, rho_table=None, a1_table=None, a2_table=None, a3_table=None, a4_table=None, a5_table=None, a6_table=None, ge_table=None, comment='')
add_mkaero1(self, machs, reduced_freqs, comment='')

Creates an MKAERO1 card, which defines a set of mach and reduced frequencies.

Parameters:
machs : List[float]

series of Mach numbers

reduced_freqs : List[float]

series of reduced frequencies

comment : str; default=’‘

a comment for the card

add_mkaero2(self, machs, reduced_freqs, comment='')

Creates an MKAERO2 card, which defines a set of mach and reduced frequency pairs.

Parameters:
machs : List[float]

series of Mach numbers

reduced_freqs : List[float]

series of reduced frequencies

comment : str; default=’‘

a comment for the card

add_moment(self, sid, node, mag, xyz, cid=0, comment='')

Creates a MOMENT card

Parameters:
sid : int

load id

node : int

the node to apply the load to

mag : float

the load’s magnitude

cid : int; default=0

the coordinate system for the load

xyz : (3, ) float ndarray; default

the load direction in the cid frame

comment : str; default=’‘

a comment for the card

add_moment1(self, sid, node, mag, g1, g2, comment='')

Creates a MOMENT1 card

Parameters:
sid : int

load id

node : int

the node to apply the load to

mag : float

the load’s magnitude

n1 / n2 : int / int

defines the load direction n = n2 - n1

comment : str; default=’‘

a comment for the card

add_moment2(self, sid, node, mag, g1, g2, g3, g4, comment='')

Creates a MOMENT2 card

Parameters:
sid : int

load id

node : int

the node to apply the load to

mag : float

the load’s magnitude

g1 / g2 / g3 / g4 : int / int / int / int

defines the load direction n = (g2 - g1) x (g4 - g3)

comment : str; default=’‘

a comment for the card

add_monpnt1(self, name, label, axes, aecomp_name, xyz, cp=0, cd=None, comment='')

Creates a MONPNT1 card

Parameters:
name : str

Character string of up to 8 characters identifying the monitor point

label : str

A string comprising no more than 56 characters that identifies and labels the monitor point.

axes : str

components {1,2,3,4,5,6}

aecomp_name : str

name of the AECOMP/AECOMPL entry

xyz : List[float, float, float]; default=None

The coordinates in the CP coordinate system about which the loads are to be monitored. None : [0., 0., 0.]

cp : int, CORDx; default=0

int : coordinate system

cd : int; default=None -> cp

the coordinate system for load outputs

comment : str; default=’‘

a comment for the card

Notes

CD - MSC specific field

add_monpnt2(self, name, label, table, Type, nddl_item, eid, comment='')

Creates a MONPNT2 card

add_monpnt3(self, name, label, axes, grid_set, elem_set, xyz, cp=0, cd=None, xflag=None, comment='')

Creates a MONPNT3 card

add_mpc(self, conid, nodes, components, coefficients, comment='')

Creates an MPC card

Parameters:
conid : int

Case Control MPC id

nodes : List[int]

GRID/SPOINT ids

components : List[str]

the degree of freedoms to constrain (e.g., ‘1’, ‘123’)

coefficients : List[float]

the scaling coefficients

add_mpcadd(self, conid, sets, comment='')

Creates an MPCADD card

add_nlparm(self, nlparm_id, ninc=None, dt=0.0, kmethod='AUTO', kstep=5, max_iter=25, conv='PW', int_out='NO', eps_u=0.01, eps_p=0.01, eps_w=0.01, max_div=3, max_qn=None, max_ls=4, fstress=0.2, ls_tol=0.5, max_bisect=5, max_r=20.0, rtol_b=20.0, comment='')

Creates an NLPARM card

add_nlpci(self, nlpci_id, Type='CRIS', minalr=0.25, maxalr=4.0, scale=0.0, desiter=12, mxinc=20, comment='')

Creates an NLPCI card

add_nsm(self, sid, nsm_type, pid_eid, value, comment='')

Creates an NSM card

Parameters:
sid : int

Case control NSM id

nsm_type : str

Type of card the NSM is applied to valid_properties = {

PSHELL, PCOMP, PBAR, PBARL, PBEAM, PBEAML, PBCOMP, PROD, CONROD, PBEND, PSHEAR, PTUBE, PCONEAX, PRAC2D, ELEMENT

}

pid_eid : List[int]; int

property id or element id depending on nsm_type

value : List[float]; float

the non-structural pass per unit length/area same length as pid_eid

comment : str; default=’‘

a comment for the card

add_nsm1(self, sid, nsm_type, value, ids, comment='')

Creates an NSM1 card

Parameters:
sid : int

Case control NSM id

nsm_type : str

Type of card the NSM is applied to valid_properties = {

PSHELL, PCOMP, PBAR, PBARL, PBEAM, PBEAML, PBCOMP, PROD, CONROD, PBEND, PSHEAR, PTUBE, PCONEAX, PRAC2D, ELEMENT

}

value : float

the non-structural pass per unit length/area

ids : List[int]

property ids or element ids depending on nsm_type

comment : str; default=’‘

a comment for the card

add_nsmadd(self, sid, sets, comment='')

Creates an NSMADD card, which sum NSM sets

Parameters:
sid : int

the NSM Case Control value

sets : List[int]

the NSM, NSM1, NSML, NSML1 values

comment : str; default=’‘

a comment for the card

add_nsml(self, sid, nsm_type, pid_eid, value, comment='')

Creates an NSML card, which defines lumped non-structural mass

Parameters:
sid : int

Case control NSM id

nsm_type : str

Type of card the NSM is applied to valid_properties = {

PSHELL, PCOMP, PBAR, PBARL, PBEAM, PBEAML, PBCOMP, PROD, CONROD, PBEND, PSHEAR, PTUBE, PCONEAX, PRAC2D, ELEMENT

}

pid_eid : List[int]; int

property id or element id depending on nsm_type

value : List[float]; float

the non-structural pass per unit length/area same length as pid_eid

comment : str; default=’‘

a comment for the card

add_nsml1(self, sid, nsm_type, value, ids, comment='')

Creates an NSML1 card, which defines lumped non-structural mass

Parameters:
sid : int

Case control NSM id

nsm_type : str

Type of card the NSM is applied to valid_properties = {

PSHELL, PCOMP, PBAR, PBARL, PBEAM, PBEAML, PBCOMP, PROD, CONROD, PBEND, PSHEAR, PTUBE, PCONEAX, PRAC2D, ELEMENT

}

value : float

the non-structural pass per unit length/area

ids : List[int]

property ids or element ids depending on nsm_type

comment : str; default=’‘

a comment for the card

add_nxstrat(self, sid, params, comment='')

Creates an NXSTRAT card

add_omit1(self, ids, components, comment='')

Creates an OMIT1 card, which defines the degree of freedoms that will be excluded (o-set) from the analysis set (a-set).

Parameters:
ids : List[int]

the GRID/SPOINT ids

components : str

the degree of freedoms to be omitted (e.g., ‘1’, ‘123’)

comment : str; default=’‘

a comment for the card

add_paero1(self, pid, caero_body_ids=None, comment='')

Creates a PAERO1 card, which defines associated bodies for the panels in the Doublet-Lattice method.

Parameters:
pid : int

PAERO1 id

caero_body_ids : List[int]; default=None

CAERO2 ids that are within the same IGID group

comment : str; default=’‘

a comment for the card

add_paero2(self, pid, orient, width, AR, thi, thn, lrsb=None, lrib=None, lth=None, comment='')

Creates a PAERO2 card, which defines additional cross-sectional properties for the CAERO2 geometry.

Parameters:
pid : int

PAERO1 id

orient : str

Orientation flag. Type of motion allowed for bodies. Refers to the aerodynamic coordinate system of ACSID. See AERO entry. valid_orientations = {Z, Y, ZY}

width : float

Reference half-width of body and the width of the constant width interference tube

AR : float

Aspect ratio of the interference tube (height/width)

thi / thn : List[int]

The first (thi) and last (thn) interference element of a body to use the theta1/theta2 array

lrsb : int; default=None
int : AEFACT id containing a list of slender body half-widths

at the end points of the slender body elements

None : use width

lrib : int; default=None
int : AEFACT id containing a list of interference body

half-widths at the end points of the interference elements

None : use width

lth : List[int, int]; default=None

AEFACT ids for defining theta arrays for interference calculations for theta1/theta2; length=2

comment : str; default=’‘

a comment for the card

add_paero3(self, pid, nbox, ncontrol_surfaces, x, y, comment='')

Creates a PAERO3 card, which defines the number of Mach boxes in the flow direction and the location of cranks and control surfaces of a Mach box lifting surface.

Parameters:
pid : int

PAERO1 id

nbox : int

Number of Mach boxes in the flow direction; 0 < nbox < 50

ncontrol_surfaces : int

Number of control surfaces. (0, 1, or 2)

x / y : List[float, None]

float : locations of points 5 through 12, which are in the aerodynamic coordinate system, to define the cranks and control surface geometry.

comment : str; default=’‘

a comment for the card

add_paero4(self, pid, docs, caocs, gapocs, cla=0, lcla=0, circ=0, lcirc=0, comment='')

Creates a PAERO4 card

add_paero5(self, pid, caoci, nalpha=0, lalpha=0, nxis=0, lxis=0, ntaus=0, ltaus=0, comment='')

Creates a PAERO5 card

add_param(self, key, values, comment='')

Creates a PARAM card

Parameters:
key : str

the name of the PARAM

values : int/float/str/List

varies depending on the type of PARAM

comment : str; default=’‘

a comment for the card

add_pbar(self, pid, mid, A=0.0, i1=0.0, i2=0.0, i12=0.0, j=0.0, nsm=0.0, c1=0.0, c2=0.0, d1=0.0, d2=0.0, e1=0.0, e2=0.0, f1=0.0, f2=0.0, k1=100000000.0, k2=100000000.0, comment='')

Creates a PBAR card

Parameters:
pid : int

property id

mid : int

material id

area : float

area

i1, i2, i12, j : float

moments of inertia

nsm : float; default=0.

nonstructural mass per unit length

c1/c2, d1/d2, e1/e2, f1/f2 : float

the y/z locations of the stress recovery points c1 - point C.y c2 - point C.z

k1 / k2 : float; default=1.e8

Shear stiffness factor K in K*A*G for plane 1/2.

comment : str; default=’‘

a comment for the card

add_pbarl(self, pid, mid, Type, dim, group='MSCBML0', nsm=0.0, comment='')

Creates a PBARL card, which defines A, I1, I2, I12, and J using dimensions rather than explicit values.

Parameters:
pid : int

property id

mid : int

material id

Type : str

type of the bar valid_types = {

ROD, TUBE, I, CHAN, T, BOX, BAR, CROSS, H, T1, I1, CHAN1, Z, CHAN2, T2, BOX1, HEXA, HAT, HAT1, DBOX

}

dim : List[float]

dimensions for cross-section corresponding to Type; the length varies

group : str default=’MSCBML0’

this parameter can lead to a very broken deck with a very bad error message; don’t touch it!

nsm : float; default=0.

non-structural mass

comment : str; default=’‘

a comment for the card

The shear center and neutral axis do not coincide when:
  • Type = I and dim2 != dim3
  • Type = CHAN, CHAN1, CHAN2
  • Type = T
  • Type = T1, T2
  • Type = BOX1
  • Type = HAT, HAT1
  • Type = DBOX
add_pbcomp(self, pid, mid, y, z, c, mids, area=0.0, i1=0.0, i2=0.0, i12=0.0, j=0.0, nsm=0.0, k1=1.0, k2=1.0, m1=0.0, m2=0.0, n1=0.0, n2=0.0, symopt=0, comment='')

Creates a PBCOMP card

Parameters:
pid : int

Property ID

mid : int

Material ID

mids : List[int]

Material ID for the i-th integration point

y / z : List[float]

The (y,z) coordinates of the lumped areas in the element coordinate system

c : List[float]; default=0.0

Fraction of the total area for the i-th lumped area default not supported…

area : float

Area of beam cross section

i1 / i2 : float; default=0.0

Area moment of inertia about plane 1/2 about the neutral axis

i12 : float; default=0.0

area product of inertia

j : float; default=0.0

Torsional moment of interia

nsm : float; default=0.0

Nonstructural mass per unit length

k1 / k2 : float; default=1.0

Shear stiffness factor K in K*A*G for plane 1/2

m1 / m2 : float; default=0.0

The (y,z) coordinates of center of gravity of nonstructural mass

n1 / n2 : float; default=0.0

The (y,z) coordinates of neutral axis

symopt : int; default=0

Symmetry option to input lumped areas for the beam cross section 0 < Integer < 5

comment : str; default=’‘

a comment for the card

add_pbeam(self, pid, mid, xxb, so, area, i1, i2, i12, j, nsm=None, c1=None, c2=None, d1=None, d2=None, e1=None, e2=None, f1=None, f2=None, k1=1.0, k2=1.0, s1=0.0, s2=0.0, nsia=0.0, nsib=None, cwa=0.0, cwb=None, m1a=0.0, m2a=0.0, m1b=None, m2b=None, n1a=0.0, n2a=0.0, n1b=None, n2b=None, comment='')

Todo

fix 0th entry of self.so, self.xxb

Creates a PBEAM card

Parameters:
pid : int

property id

mid : int

material id

xxb : List[float]

The percentage locations along the beam [0., …, 1.]

so : List[str]

YES, YESA, NO

area : List[float]

area

i1, i2, i12, j : List[float]

moments of inertia

nsm : List[float]; default=None -> [0.]*nxxb

nonstructural mass per unit length

c1/c2, d1/d2, e1/e2, f1/f2 : List[float]; default=None -> [0.]*nxxb

the y/z locations of the stress recovery points c1 - point C.y c2 - point C.z

k1 / k2 : float; default=1.

Shear stiffness factor K in K*A*G for plane 1/2.

s1 / s2 : float; default=0.

Shear relief coefficient due to taper for plane 1/2.

nsia / nsia : float; default=0. / nsia

non structural mass moment of inertia per unit length about nsm center of gravity at Point A/B.

cwa / cwb : float; default=0. / cwa

warping coefficient for end A/B.

m1a / m2a : float; default=0. / 0.

y/z coordinate of center of gravity of nonstructural mass for end A.

m1b / m2b : float; default=m1a / m2a

y/z coordinate of center of gravity of nonstructural mass for end B.

n1a / n2a : float; default=0. / 0.

y/z coordinate of neutral axis for end A.

n1b / n2b : float; default=n1a / n2a

y/z coordinate of neutral axis for end B.

comment : str; default=’‘

a comment for the card

add_pbeam3(self, pid, mid, A, iz, iy, iyz=0.0, j=None, nsm=0.0, cy=0.0, cz=0.0, dy=0.0, dz=0.0, ey=0.0, ez=0.0, fy=0.0, fz=0.0, comment='')

Creates a PBEAM3 card

add_pbeaml(self, pid, mid, beam_type, xxb, dims, so=None, nsm=None, group='MSCBML0', comment='')

Creates a PBEAML card

Parameters:
pid : int

property id

mid : int

material id

beam_type : str

the section profile

xxb : List[float]

The percentage locations along the beam [0., …, 1.]

dims : List[dim]
dim : List[float]

The dimensions for each section

so : List[str]; default=None

YES, YESA, NO None : [0.] * len(xxb)

nsm : List[float]; default=None

nonstructural mass per unit length None : [0.] * len(xxb)

group : str; default=’MSCBML0’

this parameter can lead to a very broken deck with a very bad error message; don’t touch it!

comment : str; default=’‘

a comment for the card

add_pbend(self, pid, mid, beam_type, A, i1, i2, j, c1, c2, d1, d2, e1, e2, f1, f2, k1, k2, nsm, rc, zc, delta_n, fsi, rm, t, p, rb, theta_b, comment='')

Creates a PBEND card

add_pbmsect(self, pid, mid, form, options, comment='')

Creates a PBMSECT card

add_pbrsect(self, pid, mid, form, options, comment='')

Creates a PBRSECT card

add_pbush(self, pid, k, b, ge, rcv=None, mass=None, comment='')

Creates a PBUSH card, which defines a property for a CBUSH

Parameters:
pid : int

property id

k : List[float]

Nominal stiffness values in directions 1 through 6. len(k) = 6

b : List[float]

Nominal damping coefficients in direction 1 through 6 in units of force per unit velocity len(b) = 6

ge : List[float]

Nominal structural damping constant in directions 1 through 6. len(ge) = 6

rcv : List[float]; default=None -> (None, None, None, None)

[sa, st, ea, et] = rcv length(rcv) = 4

mass : float; default=None

lumped mass of the CBUSH This is an MSC only parameter.

comment : str; default=’‘

a comment for the card

add_pbush1d(self, pid, k=0.0, c=0.0, m=0.0, sa=0.0, se=0.0, optional_vars=None, comment='')

Creates a PBUSH1D card

add_pbusht(self, pid, k_tables, b_tables, ge_tables, kn_tables, comment='')

Creates a PBUSHT card

add_pcomp(self, pid, mids, thicknesses, thetas=None, souts=None, nsm=0.0, sb=0.0, ft=None, tref=0.0, ge=0.0, lam=None, z0=None, comment='')

Creates a PCOMP card

Parameters:
pid : int

property id

mids : List[int, …, int]

material ids for each ply

thicknesses : List[float, …, float]

thicknesses for each ply

thetas : List[float, …, float]; default=None

ply angle None : [0.] * nplies

souts : List[str, …, str]; default=None

should the stress? be printed; {YES, NO} None : [NO] * nplies

nsm : float; default=0.

nonstructural mass per unit area

sb : float; default=0.

Allowable shear stress of the bonding material. Used by the failure theory

ft : str; default=None

failure theory; {HILL, HOFF, TSAI, STRN, None}

tref : float; default=0.

reference temperature

ge : float; default=0.

structural damping

lam : str; default=None

symmetric flag; {SYM, MEM, BEND, SMEAR, SMCORE, None} None : not symmmetric

z0 : float; default=None

Distance from the reference plane to the bottom surface None : -1/2 * total_thickness

comment : str; default=’‘

a comment for the card

add_pcompg(self, pid, global_ply_ids, mids, thicknesses, thetas=None, souts=None, nsm=0.0, sb=0.0, ft=None, tref=0.0, ge=0.0, lam=None, z0=None, comment='')

Creates a PCOMPG card

Parameters:
pid : int

property id

global_ply_ids : List[int]

the ply id

mids : List[int, …, int]

material ids for each ply

thicknesses : List[float, …, float]

thicknesses for each ply

thetas : List[float, …, float]; default=None

ply angle None : [0.] * nplies

souts : List[str, …, str]; default=None

should the stress? be printed; {YES, NO} None : [NO] * nplies

nsm : float; default=0.

nonstructural mass per unit area

sb : float; default=0.

Allowable shear stress of the bonding material. Used by the failure theory

ft : str; default=None

failure theory; {HILL, HOFF, TSAI, STRN, None}

tref : float; default=0.

reference temperature

ge : float; default=0.

structural damping

lam : str; default=None

symmetric flag; {SYM, MEM, BEND, SMEAR, SMCORE, None} None : not symmmetric

z0 : float; default=None

Distance from the reference plane to the bottom surface None : -1/2 * total_thickness

comment : str; default=’‘

a comment for the card

add_pcomps(self, pid, global_ply_ids, mids, thicknesses, thetas, cordm=0, psdir=13, sb=None, nb=None, tref=0.0, ge=0.0, failure_theories=None, interlaminar_failure_theories=None, souts=None, comment='')

Creates a PCOMPS card

add_pconeax(self, pid, mid1, t1=None, mid2=0, i=None, mid3=None, t2=None, nsm=None, z1=None, z2=None, phi=None, comment='')

Creates a PCONEAX card

add_pconv(self, pconid, mid=None, form=0, expf=0.0, ftype=0, tid=None, chlen=None, gidin=None, ce=0, e1=None, e2=None, e3=None, comment='')

Creates a PCONV card

Parameters:
pconid : int

Convection property ID

mid : int; default=None

Material ID

form : int; default=0

Type of formula used for free convection Must be {0, 1, 10, 11, 20, or 21}

expf : float; default=0.0

Free convection exponent as implemented within the context of the particular form that is chosen

ftype : int; default=0

Formula type for various configurations of free convection

tid : int; default=None

Identification number of a TABLEHT entry that specifies the two variable tabular function of the free convection heat transfer coefficient

chlen : float; default=None

Characteristic length

gidin : int; default=None

Grid ID of the referenced inlet point

ce : int; default=0

Coordinate system for defining orientation vector.

e1 / e2 / e3 : List[float]; default=None

Components of the orientation vector in coordinate system CE. The origin of the orientation vector is grid point G1

comment : str; default=’‘

a comment for the card

add_pconvm(self, pconid, mid, coef, form=0, flag=0, expr=0.0, exppi=0.0, exppo=0.0, comment='')

Creates a PCONVM card

Parameters:
pconid : int

Convection property ID

mid: int

Material ID

coef: float

Constant coefficient used for forced convection

form: int; default=0

Type of formula used for free convection Must be {0, 1, 10, 11, 20, or 21}

flag: int; default=0

Flag for mass flow convection

expr: float; default=0.0

Reynolds number convection exponent

exppi: float; default=0.0

Prandtl number convection exponent for heat transfer into the working fluid

exppo: float; default=0.0

Prandtl number convection exponent for heat transfer out of the working fluid

comment : str; default=’‘

a comment for the card

add_pdamp(self, pid, b, comment='')

Creates a PDAMP card

add_pdamp5(self, pid, mid, b, comment='')

Creates a PDAMP5 card

add_pdampt(self, pid, tbid, comment='')

Creates a PDAMPT card

add_pelas(self, pid, k, ge=0.0, s=0.0, comment='')

Creates a PELAS card

Parameters:
pid : int

property id

k : float

spring stiffness

ge : int; default=0.0

damping coefficient

s : float; default=0.0

stress coefficient

comment : str; default=’‘

a comment for the card

add_pelast(self, pid, tkid=0, tgeid=0, tknid=0, comment='')

Creates a PELAST card

Parameters:
pid : int

property id

tkid : float

TABLEDx that defines k vs. frequency

tgeid : int; default=0

TABLEDx that defines ge vs. frequency

s : float; default=0.

TABLEDx that defines force vs. displacement

comment : str; default=’‘

a comment for the card

add_pfast(self, pid, d, kt1, kt2, kt3, mcid=-1, mflag=0, kr1=0.0, kr2=0.0, kr3=0.0, mass=0.0, ge=0.0, comment='')

Creates a PAST card

Parameters:
pid : int

property id

d : int

diameter of the fastener

kt1, kt2, kt3 : float

stiffness values in directions 1-3

mcid : int; default=01

specifies the element stiffness coordinate system

mflag : int; default=0

0-absolute; 1-relative

kr1, kr2, kr3 : float; default=0.0

rotational stiffness values in directions 1-3

mass : float; default=0.0

lumped mass of the fastener

ge : float; default=0.0

structural damping

comment : str; default=’‘

a comment for the card

add_pgap(self, pid, u0=0.0, f0=0.0, ka=100000000.0, kb=None, mu1=0.0, kt=None, mu2=None, tmax=0.0, mar=100.0, trmin=0.001, comment='')

Defines the properties of the gap element (CGAP entry).

Parameters:
pid : int

property id for a CGAP

u0 : float; default=0.

Initial gap opening

f0 : float; default=0.

Preload

ka : float; default=1.e8

Axial stiffness for the closed gap

kb : float; default=None -> 1e-14 * ka

Axial stiffness for the open gap

mu1 : float; default=0.

Coefficient of static friction for the adaptive gap element or coefficient of friction in the y transverse direction for the nonadaptive gap element

kt : float; default=None -> mu1*ka

Transverse stiffness when the gap is closed

mu2 : float; default=None -> mu1

Coefficient of kinetic friction for the adaptive gap element or coefficient of friction in the z transverse direction for the nonadaptive gap element

tmax : float; default=0.

Maximum allowable penetration used in the adjustment of penalty values. The positive value activates the penalty value adjustment

mar : float; default=100.

Maximum allowable adjustment ratio for adaptive penalty values KA and KT

trmin : float; default=0.001

Fraction of TMAX defining the lower bound for the allowable penetration

comment : str; default=’‘

a comment for the card

add_phbdy(self, pid, af=None, d1=None, d2=None, comment='')

Creates a PHBDY card

Parameters:
eid : int

element id

pid : int

property id

af : int

Area factor of the surface used only for CHBDYP element Must be {POINT, LINE, TUBE, ELCYL} TUBE : constant thickness of hollow tube

d1, d2 : float; default=None

Diameters associated with the surface Used with CHBDYP [ELCYL, TUBE, FTUBE] surface elements

comment : str; default=’‘

a comment for the card

add_pihex(self, pid, mid, cordm=0, integ=None, stress=None, isop=None, fctn='SMECH', comment='')

See also

PSOLID

add_pload(self, sid, pressure, nodes, comment='')

Creates a PLOAD card, which defines a uniform pressure load on a shell/solid face or arbitrarily defined quad/tri face

Parameters:
sid : int

load id

pressure : float

the pressure to apply

nodes : List[int]

The nodes that are used to define the normal are defined using the same method as the CTRIA3/CQUAD4 normal. n = 3 or 4

comment : str; default=’‘

a comment for the card

add_pload1(self, sid, eid, load_type, scale, x1, p1, x2=None, p2=None, comment='')

Creates a PLOAD1 card, which may be applied to a CBAR/CBEAM

Parameters:
sid : int

load id

eid : int

element to apply the load to

load_type : str

type of load that’s applied valid_types = {FX, FY, FZ, FXE, FYE, FZE,

MX, MY, MZ, MXE, MYE, MZE}

scale : str

Determines scale factor for X1, X2. {LE, FR, LEPR, FRPR}

x1 / x2 : float / float

the starting/end position for the load application the default for x2 is x1

p1 / p2 : float / float

the magnitude of the load at x1 and x2 the default for p2 is p1

comment : str; default=’‘

a comment for the card

Point Load : x1 == x2
Distributed Load : x1 != x2
add_pload2(self, sid, pressure, eids, comment='')

Creates a PLOAD2 card, which defines an applied load normal to the quad/tri face

Parameters:
sid : int

load id

pressure : float

the pressure to apply to the elements

eids : List[int]

the elements to apply pressure to n < 6 or a continouus monotonic list of elements (e.g., [1, 2, …, 1000])

comment : str; default=’‘

a comment for the card

add_pload4(self, sid, eids, pressures, g1=None, g34=None, cid=0, nvector=None, surf_or_line='SURF', line_load_dir='NORM', comment='')

Creates a PLOAD4 card

Parameters:
sid : int

the load id

eids : List[int, …]

shells : the range of element ids; must be sequential solids : must be length 1

pressures : List[float, float, float, float]

tri : must be length 4 (the last value should be the same as the 0th value) quad : must be length 4

g1 : int/None

only used for solid elements

g34 : int / None

only used for solid elements

cid : int; default=0

the coordinate system for ???

nvector : (3, ) float ndarray

blank : load acts normal to the face the local pressure vector

surf_or_line : str; default=’SURF’

SURF : surface load LINE : line load (only defined for QUADR, TRIAR) not supported

line_load_dir : str; default=’NORM’

direction of the line load (see surf_or_line); {X, Y, Z, TANG, NORM} not supported

comment : str; default=’‘

a comment for the card

TODO: fix the way “pressures” works
add_ploadx1(self, sid, eid, pa, nids, pb=None, theta=0.0, comment='')

Creates a PLOADX1 card, which defines surface traction for axisymmetric elements.

Parameters:
sid : int

load id

eid : int

element id (CQUADX, CTRIAX, or CTRIAX6)

nids : List[int, int]

Corner grid points. GA and GB are any two adjacent corner grid points of the element

pa / pb : float / None

Surface traction at grid point GA or GB pb : default is None -> pa

theta : float; default=0.0

Angle between surface traction and inward normal to the line segment.

comment : str; default=’‘

a comment for the card

add_plotel(self, eid, nodes, comment='')

Adds a PLOTEL card

Parameters:
eid : int

Element ID

nodes : List[int, int]

Unique GRID point IDs

comment : str; default=’‘

a comment for the card

add_plplane(self, pid, mid, cid=0, stress_strain_output_location='GRID', comment='')

Creates a PLPLANE card

add_plsolid(self, pid, mid, stress_strain='GRID', ge=0.0, comment='')

Creates a PLSOLID card

Parameters:
pid : int

property id

mid : int

material id

stress_strain : str

Location of stress and strain output valid types = {GRID, GAUSS}

ge : float; default=0.

damping coefficient

comment : str; default=’‘

a comment for the card

add_pmass(self, pid, mass, comment='')

Creates an PMASS card, which defines a mass applied to a single DOF

Parameters:
pid : int

Property id used by a CMASS1/CMASS3 card

mass : float

the mass to apply

comment : str; default=’‘

a comment for the card

add_point(self, nid, xyz, cp=0, comment='')

Creates the POINT card

Parameters:
nid : int

node id

xyz : (3, ) float ndarray; default=None -> [0., 0., 0.]

the xyz/r-theta-z/rho-theta-phi values

cp : int; default=0

coordinate system for the xyz location

comment : str; default=’‘

a comment for the card

add_pointax(self, nid, ringax, phi, comment='')

Creates a POINTAX card

add_pplane(self, pid, mid, t=0.0, nsm=0.0, formulation_option=0, comment='')

Creates a PPLANE card

add_prac2d(self, pid, mid, thick, iplane, nsm=0.0, gamma=0.5, phi=180.0, comment='')

Creates a PRAC2D card

add_prac3d(self, pid, mid, gamma=0.5, phi=180.0, comment='')

Creates a PRAC3D card

add_presax(self, sid, pressure, rid1, rid2, phi1=0.0, phi2=360.0, comment='')

Creates a PRESAX card

add_prod(self, pid, mid, A, j=0.0, c=0.0, nsm=0.0, comment='')

Creates a PROD card

Parameters:
pid : int

property id

mid : int

material id

A : float

area

J : float; default=0.

polar moment of inertia

c : float; default=0.

stress factor

nsm : float; default=0.

nonstructural mass per unit length

comment : str; default=’‘

a comment for the card

add_pshear(self, pid, mid, t, nsm=0.0, f1=0.0, f2=0.0, comment='')

Creates a PSHEAR card

Parameters:
pid : int

property id

mid : int

material id

t : float

shear panel thickness

nsm : float; default=0.

nonstructural mass per unit length

f1 : float; default=0.0

Effectiveness factor for extensional stiffness along edges 1-2 and 3-4

f2 : float; default=0.0

Effectiveness factor for extensional stiffness along edges 2-3 and 1-4

comment : str; default=’‘

a comment for the card

add_pshell(self, pid, mid1=None, t=None, mid2=None, twelveIt3=1.0, mid3=None, tst=0.833333, nsm=0.0, z1=None, z2=None, mid4=None, comment='')

Creates a PSHELL card

Parameters:
pid : int

property id

mid1 : int; default=None

defines membrane material defines element density (unless blank)

mid2 : int; default=None

defines bending material defines element density if mid1=None

mid3 : int; default=None

defines transverse shear material

mid4 : int; default=None

defines membrane-bending coupling material

twelveIt3 : float; default=1.0

Bending moment of inertia ratio, 12I/T^3. Ratio of the actual bending moment inertia of the shell, I, to the bending moment of inertia of a homogeneous shell, T^3/12. The default value is for a homogeneous shell.

nsm : float; default=0.0

non-structural mass per unit area

z1 / z2 : float; default=None

fiber distance location 1/2 for stress/strain calculations z1 default : -t/2 if thickness is defined z2 default : t/2 if thickness is defined

comment : str; default=’‘

a comment for the card

add_psolid(self, pid, mid, cordm=0, integ=None, stress=None, isop=None, fctn='SMECH', comment='')

Creates a PSOLID card

Parameters:
pid : int

property id

mid : int

material id

cordm : int; default=0

material coordinate system

integ : int; default=None

None-varies depending on element type 0, ‘BUBBLE’ 1, ‘GAUSS’ 2, ‘TWO’ 3, ‘THREE’ REDUCED FULL

stress : int/str; default=None

None/GRID, 1-GAUSS

isop : int/str; default=None

0-REDUCED 1-FULL

fctn : str; default=’SMECH’

PFLUID/SMECH

comment : str; default=’‘

a comment for the card

add_ptube(self, pid, mid, OD1, t=None, nsm=0.0, OD2=None, comment='')

Adds a PTUBE card

Parameters:
pid : int

property id

mid : int

material id

OD1 : float

outer diameter at End A

t : float; default=None -> OD1/2.

thickness

nsm : float; default=0.

non-structural mass per unit length

OD2 : float; default=None -> OD1

outer diameter at End B

comment : str; default=’‘

a comment for the card

add_pvisc(self, pid, ce, cr, comment='')

Creates a PVISC card

Parameters:
pid : int

property id for a CVISC

ce : float

Viscous damping values for extension in units of force per unit velocity

cr : float

Viscous damping values for rotation in units of moment per unit velocity.

comment : str; default=’‘

a comment for the card

add_qbdy1(self, sid, qflux, eids, comment='')

Creates a QBDY1 card

add_qbdy2(self, sid, eid, qfluxs, comment='')

Creates a QBDY1 card

add_qbdy3(self, sid, Q0, cntrlnd, eids, comment='')

Creates a QBDY3 card

Parameters:
sid : int

Load set identification number. (Integer > 0)

q0 : float; default=None

Magnitude of thermal flux vector into face

control_id : int; default=0

Control point

eids : List[int] or THRU

Element identification number of a CHBDYE, CHBDYG, or CHBDYP entry

comment : str; default=’‘

a comment for the card

add_qhbdy(self, sid, flag, q0, grids, af=None, comment='')

Creates a QHBDY card

Parameters:
sid : int

load id

flag : str

valid_flags = {POINT, LINE, REV, AREA3, AREA4, AREA6, AREA8}

q0 : float

Magnitude of thermal flux into face. Q0 is positive for heat into the surface

af : float; default=None

Area factor depends on type

grids : List[int]

Grid point identification of connected grid points

comment : str; default=’‘

a comment for the card

add_qset(self, ids, components, comment='')

Creates a QSET/QSET1 card, which defines generalized degrees of freedom (q-set) to be used for dynamic reduction or component mode synthesis.

Parameters:
ids : List[int]

the GRID/SPOINT ids

components : List[str]; str

the degree of freedoms to be created (e.g., ‘1’, ‘123’) if a list is passed in, a QSET is made if a str is passed in, a QSET1 is made

comment : str; default=’‘

a comment for the card

add_qset1(self, ids, components, comment='')

See also

add_qset

add_qvect(self, sid, q0, eids, t_source=None, ce=0, vector_tableds=None, control_id=0, comment='')

Creates a QVECT card

Parameters:
sid : int

Load set identification number. (Integer > 0)

q0 : float; default=None

Magnitude of thermal flux vector into face

t_source : float; default=None

Temperature of the radiant source

ce : int; default=0

Coordinate system identification number for thermal vector flux

vector_tableds : List[int/float, int/float, int/float]
vector : float; default=0.0

directional cosines in coordinate system CE) of the thermal vector flux

tabled : int

TABLEDi entry identification numbers defining the components as a function of time

control_id : int; default=0

Control point

eids : List[int] or THRU

Element identification number of a CHBDYE, CHBDYG, or CHBDYP entry

comment : str; default=’‘

a comment for the card

add_qvol(self, sid, qvol, control_point, elements, comment='')

Creates a QVOL card

add_radbc(self, nodamb, famb, cntrlnd, eids, comment='')

Creates a RADBC card

add_radm(self, radmid, absorb, emissivity, comment='')

Creates a RADM card

add_randps(self, sid, j, k, x=0.0, y=0.0, tid=0, comment='')

Creates a RANDPS card

Parameters:
sid : int

random analysis set id defined by RANDOM in the case control deck

j : int

Subcase id of the excited load set

k : int

Subcase id of the applied load set k > j

x / y : float; default=0.0

Components of the complex number

tid : int; default=0

TABRNDi id that defines G(F)

comment : str; default=’‘

a comment for the card

add_randt1(self, sid, n, t0, tmax, comment='')

Creates a RANDT1 card

Parameters:
sid : int

random analysis set id defined by RANDOM in the case control deck

n : int

???

t0 : int

???

tmax : float

???

comment : str; default=’‘

a comment for the card

add_rbar(self, eid, nids, cna, cnb, cma, cmb, alpha=0.0, comment='')

Creates a RBAR element

Parameters:
eid : int

element id

nids : List[int, int]

node ids; connected grid points at ends A and B

cna / cnb : str

independent DOFs in ‘123456’

cma / cmb : str

dependent DOFs in ‘123456’

alpha : float; default=0.0

coefficient of thermal expansion

comment : str; default=’‘

a comment for the card

add_rbar1(self, eid, nids, cb, alpha=0.0, comment='')

Creates an RBAR1 element

add_rbe1(self, eid, Gni, Cni, Gmi, Cmi, alpha=0.0, comment='')

Creates an RBE1 element

Parameters:
eid : int

element id

Gni : List[int]

independent node ids

Cni : List[str]

the independent components (e.g., ‘123456’)

Gmi : List[int]

dependent node ids

Cmi : List[str]

the dependent components (e.g., ‘123456’)

alpha : float; default=0.

thermal expansion coefficient

comment : str; default=’‘

a comment for the card

add_rbe2(self, eid, gn, cm, Gmi, alpha=0.0, comment='')

Creates an RBE2 element

Parameters:
eid : int

element id

gn : int

Identification number of grid point to which all six independent degrees-of-freedom for the element are assigned.

cm : str

Component numbers of the dependent degrees-of-freedom in the global coordinate system at grid points GMi.

Gmi : List[int]

dependent nodes

alpha : float; default=0.0

???

add_rbe3(self, eid, refgrid, refc, weights, comps, Gijs, Gmi=None, Cmi=None, alpha=0.0, comment='')

Creates an RBE3 element

Parameters:
eid : int

element id

refgrid : int

dependent node

refc - str

dependent components for refgrid???

GiJs : List[int, …, int]

independent nodes

comps : List[str, …, str]

independent components

weights : List[float, …, float]

independent weights for the importance of the DOF

Gmi : List[int, …, int]; default=None -> []

dependent nodes / UM Set

Cmi : List[str, …, str]; default=None -> []

dependent components / UM Set

alpha : float; default=0.0

thermal expansion coefficient

comment : str; default=’‘

a comment for the card

add_rforce(self, sid, nid, scale, r123, cid=0, method=1, racc=0.0, mb=0, idrf=0, comment='')

Creates an RFORCE card

add_rforce1(self, sid, nid, scale, group_id, cid=0, r123=None, racc=0.0, mb=0, method=2, comment='')

Creates an RFORCE1 card

Parameters:
sid : int

load set id

nid : int

grid point through which the rotation vector acts

scale : float

scale factor of the angular velocity in revolutions/time

r123 : List[float, float, float] / (3, ) float ndarray

rectangular components of the rotation vector R that passes through point G

racc : int; default=0.0

???

mb : int; default=0

Indicates whether the CID coordinate system is defined in the main Bulk Data Section (MB = -1) or the partitioned superelement Bulk Data Section (MB = 0). Coordinate systems referenced in the main Bulk Data Section are considered stationary with respect to the assembly basic coordinate system.

group_id : int

Group identification number. The GROUP entry referenced in the GROUPID field selects the grid points to which the load is applied.

cid : int; default=0

Coordinate system defining the components of the rotation vector.

method : int; default=2

Method used to compute centrifugal forces due to angular velocity.

comment : str; default=’‘

a comment for the card

add_rgyro(self, sid, asynci, refrot, unit, speed_low, speed_high, speed, comment='')

Creates an RGYRO card

add_ringax(self, nid, R, z, ps=None, comment='')

Creates a RINGAX card

add_rload1(self, sid, excite_id, delay=0, dphase=0, tc=0, td=0, Type='LOAD', comment='')

Creates an RLOAD1 card, which defienes a frequency-dependent load based on TABLEDs.

Parameters:
sid : int

load id

excite_id : int

node id where the load is applied

delay : int/float; default=None

the delay; if it’s 0/blank there is no delay float : delay in units of time int : delay id

dphase : int/float; default=None

the dphase; if it’s 0/blank there is no phase lag float : delay in units of time int : delay id

tc : int/float; default=0

TABLEDi id that defines C(f) for all degrees of freedom in EXCITEID entry

td : int/float; default=0

TABLEDi id that defines D(f) for all degrees of freedom in EXCITEID entry

Type : int/str; default=’LOAD’

the type of load 0/LOAD 1/DISP 2/VELO 3/ACCE 4, 5, 6, 7, 12, 13 - MSC only

comment : str; default=’‘

a comment for the card

add_rload2(self, sid, excite_id, delay=0, dphase=0, tb=0, tp=0, Type='LOAD', comment='')

Creates a nRLOAD2 card, which defienes a frequency-dependent load based on TABLEDs.

Parameters:
sid : int

load id

excite_id : int

node id where the load is applied

delay : int/float; default=None

the delay; if it’s 0/blank there is no delay float : delay in units of time int : delay id

dphase : int/float; default=None

the dphase; if it’s 0/blank there is no phase lag float : delay in units of time int : delay id

tb : int/float; default=0

TABLEDi id that defines B(f) for all degrees of freedom in EXCITEID entry

tc : int/float; default=0

TABLEDi id that defines C(f) for all degrees of freedom in EXCITEID entry

td : int/float; default=0

TABLEDi id that defines D(f) for all degrees of freedom in EXCITEID entry

tp : int/float; default=0

TABLEDi id that defines phi(f) for all degrees of freedom in EXCITEID entry

Type : int/str; default=’LOAD’

the type of load 0/LOAD 1/DISP 2/VELO 3/ACCE 4, 5, 6, 7, 12, 13 - MSC only

comment : str; default=’‘

a comment for the card

add_rotord(self, sid, rstart, rstep, numstep, rids, rsets, rspeeds, rcords, w3s, w4s, rforces, brgsets, refsys='ROT', cmout=0.0, runit='RPM', funit='RPM', zstein='NO', orbeps=1e-06, roprt=0, sync=1, etype=1, eorder=1.0, threshold=0.02, maxiter=10, comment='')

Creates a ROTORD card

add_rotorg(self, sid, nids, comment='')

Creates a ROTORG card

add_rrod(self, eid, nids, cma='', cmb='', alpha=0.0, comment='')

Creates a RROD element

Parameters:
eid : int

element id

nids : List[int, int]

node ids; connected grid points at ends A and B

cma / cmb : str; default=’‘

dependent DOFs

alpha : float; default=0.0

coefficient of thermal expansion

comment : str; default=’‘

a comment for the card

add_rspint(self, rid, grida, gridb, gr, unit, table_id, comment='')

Creates an RSPINT card

add_rspline(self, eid, independent_nid, dependent_nids, dependent_components, diameter_ratio=0.1, comment='')

Creates an RSPLINE card, which uses multipoint constraints for the interpolation of displacements at grid points

Parameters:
eid : int

element id

independent_nid : int

the independent node id

dependent_nids : List[int]

the dependent node ids

dependent_components : List[str]

Components to be constrained

diameter_ratio : float; default=0.1

Ratio of the diameter of the elastic tube to the sum of the lengths of all segments

comment : str; default=’‘

a comment for the card

add_rsscon(self, eid, rigid_type, shell_eid=None, solid_eid=None, a_solid_grids=None, b_solid_grids=None, shell_grids=None, comment='')

Creates an RSSCON card, which defines multipoint constraints to model clamped connections of shell-to-solid elements.

Parameters:
eid : int

element id

rigid_type : str

GRID/ELEM

shell/solid_eid : int; default=None

the shell/solid element id (if rigid_type=ELEM)

shell/solid_grids : List[int, int]; default=None

the shell/solid node ids (if rigid_type=GRID)

comment : str; default=’‘

a comment for the card

add_sebndry(self, seid_a, seid_b, ids, comment='')
add_sebset(self, seid, ids, components, comment='')

Creates an SEBSET/SEBSET1 card

add_sebset1(self, seid, ids, components, comment='')

See also

add_secset

add_sebulk(self, seid, superelement_type, rseid, method='AUTO', tol=1e-05, loc='YES', unitno=None, comment='')
add_seconct(self, seid_a, seid_b, tol, loc, nodes_a, nodes_b, comment='')
add_secset(self, seid, ids, components, comment='')

Creates an SECSET/SECSET1 card

add_secset1(self, seid, ids, components, comment='')

See also

add_secset

add_seelt(self, seid, ids, comment='')
add_seexcld(self, seid_a, seid_b, nodes, comment='')
add_selabel(self, seid, label, comment='')
add_seload(self, lid_s0, seid, lid_se, comment='')
add_seloc(self, seid, nodes_seid, nodes0, comment='')

Creates an SELOC card, which transforms the superelement SEID from PA to PB. Basically, define two CORD1Rs.

Parameters:
seid : int

the superelement to transform

nodes_seid : List[int, int, int]

the nodes in the superelement than define the resulting coordinate system

nodes0 : List[int, int, int]

the nodes in the superelement than define the starting coordinate system

comment : str; default=’‘

a comment for the card

add_sempln(self, seid, p1, p2, p3, comment='')
add_senqset(self, set_id, n, comment='')
add_seqgp(self, nids, seqids, comment='')

Creates the SEQGP card

Parameters:
nids : int

the node ids

seqid : int/float

the superelement id

comment : str; default=’‘

a comment for the card

add_seqset(self, seid, ids, components, comment='')

Creates an SEQSET card

add_seqset1(self, seid, ids, components, comment='')

See also

add_secset

add_seset(self, seid, ids, comment='')

Creates an SEUSET card

add_sesup(self, nodes, Cs, comment='')

Creates an SESUP card

add_set1(self, sid, ids, is_skin=False, comment='')

Creates a SET1 card, which defines a list of structural grid points or element identification numbers.

Parameters:
sid : int

set id

ids : List[int, str]

AECOMP, SPLINEx, PANEL : all grid points must exist XYOUTPUT : missing grid points are ignored The only valid string is THRU ids = [1, 3, 5, THRU, 10]

is_skin : bool; default=False

if is_skin is used; ids must be empty

comment : str; default=’‘

a comment for the card

add_set3(self, sid, desc, ids, comment='')

Creates a SET3 card

add_setree(self, seid, seids, comment='')
add_sload(self, sid, nids, mags, comment='')

Creates an SLOAD (GRID/SPOINT load)

Parameters:
sid : int

load id

nids : int; List[int]

the GRID/SPOINT ids

mags : float; List[float]

the load magnitude

comment : str; default=’‘

a comment for the card

add_snorm(self, nid, normal, cid=0, comment='')
add_spc(self, conid, nodes, components, enforced, comment='')

Creates an SPC card, which defines the degree of freedoms to be constrained

Parameters:
conid : int

constraint id

nodes : List[int]

GRID/SPOINT ids

components : List[str]

the degree of freedoms to constrain (e.g., ‘1’, ‘123’)

enforced : List[float]

the constrained value for the given node (typically 0.0)

comment : str; default=’‘

a comment for the card

Notes

len(nodes) == len(components) == len(enforced)

Warning

non-zero enforced deflection requires an SPCD as well

add_spc1(self, conid, components, nodes, comment='')

Creates an SPC1 card, which defines the degree of freedoms to be constrained to a value of 0.0

Parameters:
conid : int

constraint id

components : str

the degree of freedoms to constrain (e.g., ‘1’, ‘123’)

nodes : List[int]

GRID/SPOINT ids

comment : str; default=’‘

a comment for the card

add_spcadd(self, conid, sets, comment='')

Creates a SPCADD card

add_spcax(self, conid, ringax, hid, component, enforced, comment='')

Creates an SPCAX card

add_spcd(self, sid, nodes, components, enforced, comment='')

Creates an SPCD card, which defines the degree of freedoms to be set during enforced motion

Parameters:
conid : int

constraint id

nodes : List[int]

GRID/SPOINT ids

components : List[str]

the degree of freedoms to constrain (e.g., ‘1’, ‘123’)

enforced : List[float]

the constrained value for the given node (typically 0.0)

comment : str; default=’‘

a comment for the card

Notes

len(nodes) == len(components) == len(enforced)

Warning

Non-zero enforced deflection requires an SPC/SPC1 as well. Yes, you really want to constrain the deflection to 0.0 with an SPC1 card and then reset the deflection using an SPCD card.

add_spline1(self, eid, caero, box1, box2, setg, dz=0.0, method='IPS', usage='BOTH', nelements=10, melements=10, comment='')

Creates a SPLINE1, which defines a surface spline.

Parameters:
eid : int

spline id

caero : int

CAEROx id that defines the plane of the spline

box1 / box2 : int

First/last box id that is used by the spline

setg : int

SETx id that defines the list of GRID points that are used by the surface spline

dz : float; default=0.0

linear attachment flexibility dz = 0.; spline passes through all grid points

method : str; default=IPS

method for spline fit valid_methods = {IPS, TPS, FPS} IPS : Harder-Desmarais Infinite Plate Spline TPS : Thin Plate Spline FPS : Finite Plate Spline

usage : str; default=BOTH

Spline usage flag to determine whether this spline applies to the force transformation, displacement transformation, or both valid_usage = {FORCE, DISP, BOTH}

nelements : int; default=10

The number of FE elements along the local spline x-axis if using the FPS option

melements : int; default=10

The number of FE elements along the local spline y-axis if using the FPS option

comment : str; default=’‘

a comment for the card

add_spline2(self, eid, caero, id1, id2, setg, dz=0.0, dtor=1.0, cid=0, dthx=0.0, dthy=0.0, usage='BOTH', comment='')

Creates a SPLINE2 card, which defines a beam spline.

Parameters:
eid : int

spline id

caero : int

CAEROx id that defines the plane of the spline

id1 / id2 : int

First/last box/body id that is used by the spline

setg : int

SETx id that defines the list of GRID points that are used by the beam spline

dz : float; default=0.0

linear attachment flexibility dz = 0.; spline passes through all grid points

dtor : float; default=1.0

Torsional flexibility ratio (EI/GJ). Use 1.0 for bodies (CAERO2).

cid : int; default=0

Rectangular coordinate system for which the y-axis defines the axis of the spline. Not used for bodies, CAERO2

dthx : float; default=None

Rotational attachment flexibility. DTHX : Used for rotation about the spline’s x-axis (in-plane

bending rotations). It is not used for bodies (CAERO2).

DTHY : Used for rotation about the spline’s y-axis (torsion).

It is used for slope of bodies.

usage : str; default=BOTH

Spline usage flag to determine whether this spline applies to the force transformation, displacement transformation, or both valid_usage = {FORCE, DISP, BOTH}

comment : str; default=’‘

a comment for the card

add_spline3(self, eid, caero, box_id, components, nodes, displacement_components, coeffs, usage='BOTH', comment='')

Creates a SPLINE3 card, which is useful for control surface constraints.

Parameters:
eid : int

spline id

caero : int

CAEROx id that defines the plane of the spline

box_id : int

Identification number of the aerodynamic box number.

components : int

The component of motion to be interpolated. 3, 5 (CAERO1) 2, 3, 5, 6 (CAERO2) 3 (CAERO3) 3, 5, 6 (CAERO4) 3, 5, 6 (CAERO5) 1, 2, 3, 5, 6 (3D Geometry) 2-lateral displacement 3-transverse displacement 5-pitch angle 6-relative control angle for CAERO4/5; yaw angle for CAERO2

nodes : List[int]

Grid point identification number of the independent grid point.

displacement_components

Component numbers in the displacement coordinate system. 1-6 (GRIDs) 0 (SPOINTs)

coeffs

Coefficient of the constraint relationship.

usage : str; default=BOTH

Spline usage flag to determine whether this spline applies to the force transformation, displacement transformation, or both valid_usage = {FORCE, DISP, BOTH}

comment : str; default=’‘

a comment for the card

add_spline4(self, eid, caero, aelist, setg, dz, method, usage, nelements, melements, comment='')

Creates a SPLINE4 card, which defines a curved Infinite Plate, Thin Plate, or Finite Plate Spline.

Parameters:
eid : int

spline id

caero : int

CAEROx id that defines the plane of the spline

box1 / box2 : int

First/last box id that is used by the spline

setg : int

SETx id that defines the list of GRID points that are used by the surface spline

dz : float; default=0.0

linear attachment flexibility dz = 0.; spline passes through all grid points

method : str; default=IPS

method for spline fit valid_methods = {IPS, TPS, FPS} IPS : Harder-Desmarais Infinite Plate Spline TPS : Thin Plate Spline FPS : Finite Plate Spline

usage : str; default=BOTH

Spline usage flag to determine whether this spline applies to the force transformation, displacement transformation, or both valid_usage = {FORCE, DISP, BOTH}

nelements : int; default=10

The number of FE elements along the local spline x-axis if using the FPS option

melements : int; default=10

The number of FE elements along the local spline y-axis if using the FPS option

comment : str; default=’‘

a comment for the card

add_spline5(self, eid, caero, aelist, setg, thx, thy, dz=0.0, dtor=1.0, cid=0, usage='BOTH', method='BEAM', ftype='WF2', rcore=None, comment='')

Creates a SPLINE5 card

add_spoint(self, ids, comment='')

Creates the SPOINTs card that contains many SPOINTs

Parameters:
ids : List[int]

SPOINT ids

comment : str; default=’‘

a comment for the card

add_suport(self, nodes, Cs, comment='')

Creates a SUPORT card, which defines free-body reaction points. This is always active.

Parameters:
nodes : List[int]

the nodes to release

Cs : List[str]

compoents to support at each node

comment : str; default=’‘

a comment for the card

add_suport1(self, conid, nodes, Cs, comment='')

Creates a SUPORT card, which defines free-body reaction points.

Parameters:
conid : int

Case Control SUPORT id

nodes : List[int]

the nodes to release

Cs : List[str]

compoents to support at each node

comment : str; default=’‘

a comment for the card

add_tabdmp1(self, tid, x, y, Type='G', comment='')

Creates a TABDMP1 card

add_tabled1(self, tid, x, y, xaxis='LINEAR', yaxis='LINEAR', extrap=0, comment='')

Creates a TABLED1, which is a dynamic load card that is applied by the DAREA card

Parameters:
tid : int

table id

x : List[float]

nvalues

y : List[float]

nvalues

xaxis : str

LINEAR, LOG

yaxis : str

LINEAR, LOG

extrap : int; default=0
Extrapolation method:

0 : linear 1 : constant

Note

this is NX specific

comment : str; default=’‘

a comment for the card

add_tabled2(self, tid, x1, x, y, comment='')

Creates a TABLED2 card

add_tabled3(self, tid, x1, x2, x, y, comment='')

Creates a TABLED3 card

add_tabled4(self, tid, x1, x2, x3, x4, a, comment='')

Creates a TABLED4 card

add_tableh1(self, tid, x, y, comment='')
add_tablem1(self, tid, x, y, xaxis='LINEAR', yaxis='LINEAR', comment='')

Creates a TABLEM1 card

add_tablem2(self, tid, x1, x, y, extrap=0, comment='')

Creates a TABLEM2 card

add_tablem3(self, tid, x1, x2, x, y, extrap=0, comment='')

Creates a TABLEM3 card

add_tablem4(self, tid, x1, x2, x3, x4, a, comment='')

Creates a TABLEM4 card

add_tables1(self, tid, x, y, Type=1, comment='')

Adds a TABLES1 card, which defines a stress dependent material

Parameters:
tid : int

Table ID

Type : int; default=1

Type of stress-strain curve (1 or 2) 1 - Cauchy (true) stress vs. total true strain 2 - Cauchy (true) stress vs. plastic true strain (MSC only)

x, y : List[float]

table values

comment : str; default=’‘

a comment for the card

add_tablest(self, tid, x, y, comment='')

Creates an TABLEST card

add_tabrnd1(self, tid, x, y, xaxis='LINEAR', yaxis='LINEAR', comment='')

Creates an TABRND1 card

add_tabrndg(self, tid, Type, LU, WG, comment='')

Creates a TABRNDG card

Parameters:
tid : int

table id

Type : int

PSD type 1 : von Karman 2 : Dryden

LU : float

Scale of turbulence divided by velocity (units of time)

WG : float

Root-mean-square gust velocity

comment : str; default=’‘

a comment for the card

add_temp(self, sid, temperatures, comment='')

Creates a TEMP card

Parameters:
sid : int

Load set identification number

temperatures : dict[nid]
nid : int

node id

temperature : float

the nodal temperature

comment : str; default=’‘

a comment for the card

add_tempax(self, sid, ring, phi, temperature, comment='')

Creates a TEMPAX card

add_tempd(self, sid, temperature, comment='')

Creates a TEMPD card

Parameters:
sid : int

Load set identification number. (Integer > 0)

temperature : float

default temperature

comment : str; default=’‘

a comment for the card

add_tf(self, sid, nid0, c, b0, b1, b2, nids, components, a, comment='')

Creates a TF card

add_tic(self, sid, nodes, components, u0=0.0, v0=0.0, comment='')

Creates a TIC card

Parameters:
sid : int

Case Control IC id

nodes : int / List[int]

the nodes to which apply the initial conditions

components : int / List[int]

the DOFs to which apply the initial conditions

u0 : float / List[float]

Initial displacement.

v0 : float / List[float]

Initial velocity.

comment : str; default=’‘

a comment for the card

add_tload1(self, sid, excite_id, tid, delay=0, Type='LOAD', us0=0.0, vs0=0.0, comment='')

Creates a TLOAD1 card, which defienes a load based on a table

Parameters:
sid : int

load id

excite_id : int

node id where the load is applied

tid : int

TABLEDi id that defines F(t) for all degrees of freedom in EXCITEID entry float : MSC not supported

delay : int/float; default=0

the delay; if it’s 0/blank there is no delay float : delay in units of time int : delay id

Type : int/str; default=’LOAD’

the type of load 0/LOAD 1/DISP 2/VELO 3/ACCE 4, 5, 6, 7, 12, 13 - MSC only

us0 : float; default=0.

Factor for initial displacements of the enforced degrees-of-freedom MSC only

vs0 : float; default=0.

Factor for initial velocities of the enforced degrees-of-freedom MSC only

comment : str; default=’‘

a comment for the card

add_tload2(self, sid, excite_id, delay=0, Type='LOAD', T1=0.0, T2=None, frequency=0.0, phase=0.0, c=0.0, b=0.0, us0=0.0, vs0=0.0, comment='')

Creates a TLOAD2 card, which defines a exponential time load

Parameters:
sid : int

load id

excite_id : int

node id where the load is applied

delay : int/float; default=None

the delay; if it’s 0/blank there is no delay float : delay in units of time int : delay id

Type : int/str; default=’LOAD’

the type of load 0/LOAD 1/DISP 2/VELO 3/ACCE 4, 5, 6, 7, 12, 13 - MSC only

T1 : float; default=0.

time constant (t1 > 0.0) times below this are ignored

T2 : float; default=None

time constant (t2 > t1) times above this are ignored

frequency : float; default=0.

Frequency in cycles per unit time.

phase : float; default=0.

Phase angle in degrees.

c : float; default=0.

Exponential coefficient.

b : float; default=0.

Growth coefficient.

us0 : float; default=0.

Factor for initial displacements of the enforced degrees-of-freedom MSC only

vs0 : float; default=0.

Factor for initial velocities of the enforced degrees-of-freedom MSC only

comment : str; default=’‘

a comment for the card

add_trim(self, sid, mach, q, labels, uxs, aeqr=1.0, trim_type=1, comment='')

Creates a TRIM/TRIM2 card for a static aero (144) analysis.

Parameters:
sid : int

the trim id; referenced by the Case Control TRIM field

mach : float

the mach number

q : float

dynamic pressure

labels : List[str]

names of the fixed variables

uxs : List[float]

values corresponding to labels

aeqr : float

0.0 : rigid trim analysis 1.0 : elastic trim analysis (default)

trim_type : int

1 : creates a TRIM 2 : creates a TRIM2

comment : str; default=’‘

a comment for the card

add_tstep(self, sid, N, DT, NO, comment='')

Creates a TSTEP card

add_tstep1(self, sid, tend, ninc, nout, comment='')

Creates a TSTEP1 card

add_tstepnl(self, sid, ndt, dt, no, method='ADAPT', kstep=None, max_iter=10, conv='PW', eps_u=0.01, eps_p=0.001, eps_w=1e-06, max_div=2, max_qn=10, max_ls=2, fstress=0.2, max_bisect=5, adjust=5, mstep=None, rb=0.6, max_r=32.0, utol=0.1, rtol_b=20.0, min_iter=None, comment='')

Creates a TSTEPNL card

add_uset(self, name, ids, components, comment='')

Creates a USET card, which defines a degrees-of-freedom set.

Parameters:
name : str

SNAME Set name. (One to four characters or the word ‘ZERO’ followed by the set name.)

ids : List[int]

the GRID/SPOINT ids

components : List[str]

the degree of freedoms (e.g., ‘1’, ‘123’) if a list is passed in, a USET is made if a str is passed in, a USET1 is made

comment : str; default=’‘

a comment for the card

add_uset1(self, name, ids, components, comment='')

See also

add_uset

add_view(self, iview, icavity, shade='BOTH', nbeta=1, ngamma=1, dislin=0.0, comment='')

Creates a VIEW card

add_view3d(self, icavity, gitb=4, gips=4, cier=4, error_tol=0.1, zero_tol=1e-10, warp_tol=0.01, rad_check=3, comment='')

Creates a VIEW3D card

caero_ids

gets the CAEROx ids

clear_attributes(self)

removes the attributes from the model

coord_ids

gets the number of coordinate system ids

create_card_object(self, card_lines, card_name, is_list=True, has_none=True)

Creates a BDFCard object, which is really just a list that allows indexing past the last field

Parameters:
card_lines: list[str]

the list of the card fields input is list of card_lines -> [‘GRID, 1, 2, 3.0, 4.0, 5.0’]

card_name : str

the card_name -> ‘GRID’

is_list : bool; default=True

True : this is a list of fields False : this is a list of lines

has_none : bool; default=True

can there be trailing Nones in the card data (e.g. [‘GRID, 1, 2, 3.0, 4.0, 5.0, ‘])

Returns:
card_object : BDFCard()

the card object representation of card

card : list[str]

the card with empty fields removed

create_subcases(self, subcase_ids=None)

creates a series of subcases

cross_reference(self, xref=True, xref_nodes=True, xref_elements=True, xref_nodes_with_elements=False, xref_properties=True, xref_masses=True, xref_materials=True, xref_loads=True, xref_constraints=True, xref_aero=True, xref_sets=True, xref_optimization=True, word='')

Links up all the cards to the cards they reference

Parameters:
xref : bool; default=True

cross references the model

xref_nodes : bool; default=True

set cross referencing of nodes/coords

xref_element : bool; default=True

set cross referencing of elements

xref_properties : bool; default=True

set cross referencing of properties

xref_masses : bool; default=True

set cross referencing of CMASS/PMASS

xref_materials : bool; default=True

set cross referencing of materials

xref_loads : bool; default=True

set cross referencing of loads

xref_constraints : bool; default=True

set cross referencing of constraints

xref_aero : bool; default=True

set cross referencing of CAERO/SPLINEs

xref_sets : bool; default=True

set cross referencing of SETx

word : str; default=’‘

model flag

To only cross-reference nodes:
.. code-block:: python

model = BDF() model.read_bdf(bdf_filename, xref=False) model.cross_reference(xref=True, xref_loads=False, xref_constraints=False,

xref_materials=False, xref_properties=False, xref_aero=False, xref_masses=False, xref_sets=False)

.. warning:: be careful if you call this method with False values
disable_cards(self, cards)

Method for removing broken cards from the reader

Parameters:
cards : List[str]; Set[str]

a list/set of cards that should not be read

.. python ::

bdf_model.disable_cards([‘DMIG’, ‘PCOMP’])

dmigs
dmijis
dmijs
dmiks
dmis
element_ids

gets the element ids

export_hdf5_file(self, hdf5_file, exporter=None)

Converts the BDF objects into hdf5 object

Parameters:
hdf5_file : H5File()

an h5py object

exporter : HDF5Exporter; default=None

unused

export_hdf5_filename(self, hdf5_filename)

Converts the BDF objects into hdf5 object

Parameters:
hdf5_filename : str

the path to the hdf5 file

TODO: doesn’t support:
  • BucklingEigenvalues
geom_check(self, geom_check, xref)

what about xref?

get_MPCx_node_ids(self, mpc_id, consider_mpcadd=True, stop_on_failure=True)

see pyNastran.bdf.mesh_utils.mpc_dependency.get_mpc_node_ids(...)

get_MPCx_node_ids_c1(self, mpc_id, consider_mpcadd=True, stop_on_failure=True)

see pyNastran.bdf.mesh_utils.mpc_dependency.get_mpc_node_ids_c1(...)

get_SPCx_node_ids(self, spc_id, consider_spcadd=True, stop_on_failure=True)

Get the SPC/SPCADD/SPC1/SPCAX IDs.

Parameters:
spc_id : int

the SPC id

stop_on_failure : bool; default=True

errors if parsing something new

Returns:
node_ids : List[int]

the constrained associated node ids

get_SPCx_node_ids_c1(self, spc_id, stop_on_failure=True)

Get the SPC/SPCADD/SPC1/SPCAX IDs.

Parameters:
spc_id : int

the SPC id

stop_on_failure : bool; default=True

errors if parsing something new

Returns:
node_ids_c1 : Dict[component] = node_ids
component : str

the DOF to constrain

node_ids : List[int]

the constrained node ids

get_area_breakdown(self, property_ids=None, stop_if_no_area=True, sum_bar_area=True)

gets a breakdown of the area by property region

TODO: What about CONRODs? #’PBRSECT’, #’PBCOMP’, #’PBMSECT’, #’PBEAM3’, #’PBEND’, #’PIHEX’, #’PCOMPS’,

sum_bar_area : bool; default=True
sum the areas for CBAR/CBEAM/CROD/CONROD/CTUBE elements True : get the area of the model by property id False : only get the cross sectional properties
get_bdf_cards(self, bulk_data_lines, bulk_data_ilines=None)

Parses the BDF lines into a list of card_lines

get_bdf_cards_dict(self, bulk_data_lines, bulk_data_ilines=None)

Parses the BDF lines into a list of card_lines

get_bdf_stats(self, return_type='string')

Print statistics for the BDF

Parameters:
return_type : str (default=’string’)
the output type (‘list’, ‘string’)

‘list’ : list of strings ‘string’ : single, joined string

Returns:
return_data : str, optional

the output data

Note

if a card is not supported and not added to the proper lists, this method will fail

Todo

RBE3s from OP2s can show up as ???s ..

get_card_ids_by_card_types(self, card_types=None, reset_type_to_slot_map=False, stop_on_missing_card=False, combine=False)
Parameters:
card_types : str / List[str] / default=None

the list of keys to consider (list of strings; string) None : all cards

reset_type_to_slot_map : bool

should the mapping dictionary be rebuilt (default=False); set to True if you added cards

stop_on_missing_card : bool

crashes if you request a card and it doesn’t exist

combine : bool; default=False

change out_dict into out_list combine the list of cards

Returns:
out_dict: dict[str]=List[ids]

the key=card_type, value=the ID of the card object

out_list: List[ids]

value=the ID of the card object useful

Examples

>>> out_dict = model.get_card_ids_by_card_types(
    card_types=['GRID', 'CTRIA3', 'CQUAD4'], combine=False)
>>> out_dict = {
    'GRID' : [1, 2, 10, 42, 1000],
    'CTRIA3' : [1, 2, 3, 5],
    'CQUAD4' : [4],
}

shell elements

>>> out_dict = model.get_card_ids_by_card_types(
    card_types=['CTRIA3', 'CQUAD4'], combine=True)
>>> out_dict = {
    [1, 2, 3, 4, 5],
}
get_cards_by_card_types(self, card_types, reset_type_to_slot_map=False, stop_on_missing_card=False)
Parameters:
card_types : List[str]

the list of keys to consider

reset_type_to_slot_map : bool

should the mapping dictionary be rebuilt (default=False); set to True if you added cards

stop_on_missing_card : bool

crashes if you request a card and it doesn’t exist

Returns:
out_dict : dict[str] = List[BDFCard()]

the key=card_type, value=the card object

get_custom_types(self)

helper method for dict_to_h5py

get_dependent_nid_to_components(self, mpc_id=None, stop_on_failure=True)

see pyNastran.bdf.mesh_utils.mpc_dependency.get_dependent_nid_to_components(...)

get_displacement_index(self)

Get index and transformation matricies for nodes with their output in coordinate systems other than the global. Used in combination with OP2.transform_displacements_to_global

Returns:
nids_all : (nnodes,) int ndarray

the GRID/SPOINT/EPOINT ids

nids_transform : dict[cd]

the indicies in nids_all that correspond to cd > 0 cd : int

the CD coordinate system

nnodesi : int

nnodesi <= nnodes

icd_transform : dict{int cid

Dictionary from coordinate id to index of the nodes in self.point_ids that their output (CD) in that coordinate system.

Examples

# assume GRID 1 has a CD=10 # assume GRID 2 has a CD=10 # assume GRID 5 has a CD=50 >>> model.point_ids [1, 2, 5] >>> icd_transform = model.get_displacement_index() >>> icd_transform[10] [0, 1]

>>> icd_transform[50]
[2]
get_displacement_index_xyz_cp_cd(self, fdtype='float64', idtype='int32', sort_ids=True)

Get index and transformation matricies for nodes with their output in coordinate systems other than the global. Used in combination with OP2.transform_displacements_to_global

Parameters:
fdtype : str; default=’float64’

the type of xyz_cp

idtype : str; default=’int32’

the type of nid_cp_cd

sort_ids : bool; default=True

sort the ids

Returns:
icd_transform : dict{int cd

Dictionary from coordinate id to index of the nodes in self.point_ids that their output (CD) in that coordinate system.

icp_transform : dict{int cp

Dictionary from coordinate id to index of the nodes in self.point_ids that their input (CP) in that coordinate system.

xyz_cp : (n, 3) float ndarray

points in the CP coordinate system

nid_cp_cd : (n, 3) int ndarray

node id, CP, CD for each node

Examples

# assume GRID 1 has a CD=10, CP=0 # assume GRID 2 has a CD=10, CP=0 # assume GRID 5 has a CD=50, CP=0 >>> model.point_ids [1, 2, 5] >>> out = model.get_displacement_index_xyz_cp_cd() >>> icd_transform, icp_transform, xyz_cp, nid_cp_cd = out >>> nid_cp_cd [

[1, 0, 10], [2, 0, 10], [5, 0, 50],

] >>> icd_transform[10] [0, 1]

>>> icd_transform[50]
[2]
get_dload_entries(self, sid, msg='')

gets the dload entries (e.g., TLOAD1, TLOAD2)

get_element_faces(self, element_ids=None, allow_blank_nids=True)

Gets the elements and faces that are skinned from solid elements. This includes internal faces, but not existing shells.

Parameters:
element_ids : List[int] / None

skin a subset of element faces default=None -> all elements

allow_blank_nids : bool; default=True

allows for nids to be None

Returns:
eid_faces : (int, List[(int, int, …)])

value1 : element id value2 : face

get_element_ids_dict_with_pids(self, pids=None, stop_if_no_eids=True, msg='')

Gets all the element IDs with a specific property ID.

Parameters:
pids : List[int] / int

list of property ID

stop_if_no_eids : bool; default=True

prevents crashing if there are no elements setting this to False really doesn’t make sense for non-DMIG models

Returns:
element_ids : dict[pid] = List[eid]

dictionary of lists by property pid : int

property id

eid : int

element id

For example, we want all the elements with pids=[4, 5, 6],
but we want them in separate groups

Notes

What happens with CONRODs?

get_element_ids_list_with_pids(self, pids=None)

Gets all the element IDs with a specific property ID.

Parameters:
pids : List[int]; default=None -> all

list of property ID

Returns:
element_ids : List[int]

the element ids

For example, we want to get all the element ids with pids=[1, 2, 3]
get_element_nodes_by_element_type(self, dtype='int32', solids=None)

see get_elements_properties_nodes_by_element_type

get_elements_nodes_by_property_type(self, dtype='int32', save_element_types=False)

Gets a dictionary of (etype, pid) to [eids, node_ids]

Parameters:
dtype : str; default=’int32’

the type of the integers

save_element_types : bool; default=False

adds the etype_to_eids_pids_nids output

Returns:
etype_pid_to_eids_nids : dict[(etype, pid)]
etype : str

the element type

pid : int

the property id CONRODS have a pid of 0

eids : (neids, ) int ndarray

the elements with the property id of pid

nids : (neids, nnodes/element) int ndarray

the nodes corresponding to the element

etype_to_eids_pids_nids : dict[etype]

Enabled by save_element_types; default=None etype : str

the element type

eids : (neids, ) int ndarray

the elements with the property id of pid

pids : (neids, ) int ndarray

the property ids CONRODS have a pid of 0

nids : (neids, nnodes/element) int ndarray

the nodes corresponding to the element

get_elements_properties_nodes_by_element_type(self, dtype='int32', solids=None, stop_if_no_eids=True)

Gets a dictionary of element type to [eids, pids, node_ids]

Parameters:
dtype : str; default=’int32’

the type of the integers

solids : dict[etype]
etype : str

the element type should only be CTETRA, CHEXA, CPENTA, CPYRAM

value : varies
(nnodes_min, nnodes_max) : Tuple(int, int)

the min/max number of nodes for the element

(nnodes, ) : Tuple(int, )

the number of nodes useful if you only have CTETRA4s or only want CTETRA10s fails if you’re wrong (and too low)

Returns:
etype_to_eids_pids_nids : dict[etype]
etype : str

the element type

eids : (neids, ) int ndarray

the elements with the property id of pid

pids : (neids, ) int ndarray

the property ids CONRODS have a pid of 0

nids : (neids, nnodes/element) int ndarray

the nodes corresponding to the element

get_encoding(self, encoding=None)

gets the file encoding

get_h5attrs(self)

helper method for dict_to_h5py

get_length_breakdown(self, property_ids=None, stop_if_no_length=True)

gets a breakdown of the length by property region

TODO: What about CONRODs?

get_load_arrays(self, subcase_id, eid_map, node_ids, normals, nid_map=None)

see pyNastran.bdf.mesh_utils.forces_moments.get_load_arrays(...)

get_mass_breakdown(self, property_ids=None, stop_if_no_mass=True, detailed=False)

Gets a breakdown of the mass by property region.

Parameters:
property_ids : List[int] / int

list of property ID

stop_if_no_mass : bool; default=True

prevents crashing if there are no elements setting this to False really doesn’t make sense for non-DMIG models

detailed : bool, optional, default

Separates structural and nonstructural mass outputs.

Returns:
pids_to_mass : dict {int

Map from property id to mass (structural mass only if detailed is True).

pids_to_mass_nonstructural : dict {int

Map from property id to nonstructural mass (only if detailed is True).

mass_type_to_mass : dict {str

Map from mass id to mass for mass elements.

TODO: What about CONRODs, CONM2s?
#’PBCOMP’,
#’PBMSECT’,
#’PBEAM3’,
#’PBEND’,
#’PIHEX’,
#’PCOMPS’,
get_material_id_to_property_ids_map(self, msg='')

Returns a dictionary that maps a material ID to a list of properties

Returns:
mid_to_pids_map : dict[int] = int

the mapping

msg : str; default=’‘

a message added to the error message

get_material_ids(self)

gets the material ids

get_mklist(self)

gets the MKLIST vector from MKAERO1/MKAERO2

get_mpcs(self, mpc_id, consider_mpcadd=True, stop_on_failure=True)

see pyNastran.bdf.mesh_utils.mpc_dependency.get_mpcs(...)

get_nid_map(self, sort_ids=True)

Maps the GRID/SPOINT/EPOINT ids to a sorted/unsorted order.

Parameters:
sort_ids : bool; default=True

sort the ids

Returns:
nid_map : Dict[nid]
nid : int

the GRID/SPOINT/EPOINT id

i : int

the index

..note :: GRIDs, SPOINTs, & EPOINTs are stored in separate slots,

so they are unorganized.

get_node_id_to_element_ids_map(self)

Returns a dictionary that maps node IDs to a list of elemnent IDs

Todo

support 0d or 1d elements

Todo

support elements with missing nodes (e.g. CQUAD8 with missing nodes)

get_node_id_to_elements_map(self)

Returns a dictionary that maps node IDs to a list of elements.

Returns:
nid_to_elements_map : Dict[nid]=List[eid]

node id to a list of elements

Todo

support 0d or 1d elements ..

Todo

support elements with missing nodes (e.g. CQUAD8 with missing nodes)

get_node_ids_with_elements(self, eids, msg='')

Get the node IDs associated with a list of element IDs

Parameters:
eids : List[int]

list of element ID

msg : str

An additional message to print out if an element is not found

Returns:
node_ids : Set[int]

set of node IDs

For example::

eids = [1, 2, 3] # list of elements with pid=1 msg = ‘ which are required for pid=1’ node_ids = bdf.get_node_ids_with_elements(eids, msg=msg)

get_pid_to_node_ids_and_elements_array(self, pids=None, etypes=None, idtype='int32', msg='')

a work in progress

Parameters:
pids : List[int]

list of property ID

etypes : List[str]

element types to consider

Returns:
pid_to_eids_ieids_map : dict[(pid, etype)] = eid_ieid
eid_ieid : (Nelements, 2) int ndarray

eid is the element id ieid is the index in the node_ids array

node_ids : (nelements, nnodes) int ndarray
nelements : int

the number of elements in the property type

nnodes : int

varies based on the element type

get_point_grids(self, nodes, msg='')

gets GRID, POINT cards

get_pressure_array(self, load_case_id, eids, stop_on_failure=True)

see pyNastran.bdf.mesh_utils.forces_moments.get_pressure_array(...)

get_property_id_to_element_ids_map(self, msg='')

Returns a dictionary that maps a property ID to a list of elements.

Returns:
pid_to_eids_map : Dict[pid]=List[eid]

property id to a list of elements

msg : str; default=’‘

a message added to the error message

get_reduced_dloads(self, dload_id, scale=1.0, consider_dload_combinations=True, skip_scale_factor0=False, msg='')

Accounts for scale factors.

Parameters:
dload_id : int

the desired DLOAD id

consider_dload_combinations : bool; default=True

look at the DLOAD card

scale : float; default=1.0

additional scale factor on top of the existing LOADs

skip_scale_factor0 : bool; default=False

Skip loads with scale factor=0.0. Nastran does not do this. Nastran will fail if referenced loads do not exist.

msg : str

debug message

Returns:
dloads : List[loads]

a series of dload objects

scale_factors : List[float]

the associated scale factors

Warning

assumes xref=True ..

get_reduced_loads(self, load_case_id, scale=1.0, consider_load_combinations=True, skip_scale_factor0=False, stop_on_failure=True, msg='')

Accounts for scale factors.

Parameters:
load_case_id : int

the desired LOAD id

consider_load_combinations : bool; default=True

look at the LOAD card

scale : float; default=1.0

additional scale factor on top of the existing LOADs

skip_scale_factor0 : bool; default=False

Skip loads with scale factor=0.0. Nastran does not do this. Nastran will fail if referenced loads do not exist.

stop_on_failure : bool; default=True

errors if parsing something new

msg : str

debug message

Returns:
loads : List[loads]

a series of load objects

scale_factors : List[float]

the associated scale factors

is_grav : bool

is there a gravity card

Warning

assumes xref=True ..

get_reduced_mpcs(self, mpc_id, consider_mpcadd=False, stop_on_failure=True)

Get all traced MPCs that are part of a set

Parameters:
mpc_id : int

the MPC id

consider_mpcadd : bool

MPCADDs should not be considered when referenced from an MPCADD from a case control, True should be used.

stop_on_failure : bool; default=True

errors if parsing something new

Returns:
mpcs : List[MPC]

the various MPCs

get_reduced_nsms(self, nsm_id, consider_nsmadd=True, stop_on_failure=True)

Get all traced NSMs that are part of a set

Parameters:
nsm_id : int

the NSM id

consider_nsmadd : bool

NSMADDs should not be considered when referenced from an NSMADD from a case control, True should be used.

stop_on_failure : bool; default=True

errors if parsing something new

Returns:
mpcs : List[NSM]

the various NSMs

get_reduced_spcs(self, spc_id, consider_spcadd=True, stop_on_failure=True)

Get all traced SPCs that are part of a set

Parameters:
spc_id : int

the SPC id

consider_spcadd : bool

SPCADDs should not be considered when referenced from an SPCADD from a case control, True should be used.

stop_on_failure : bool; default=True

errors if parsing something new

Returns:
spcs : List[SPC]

the various SPCs

get_rigid_elements_with_node_ids(self, node_ids)

see pyNastran.bdf.mesh_utils.mpc_dependency.get_rigid_elements_with_node_ids(...)

get_rslot_map(self, reset_type_to_slot_map=False)

gets the rslot_map

get_spcs(self, spc_id, consider_nodes=False, stop_on_failure=True)

Gets the SPCs in a semi-usable form.

Parameters:
spc_id : int

the desired SPC ID

consider_nodes : bool; default=False

True : consider the GRID card PS field False: consider the GRID card PS field

Returns:
nids : List[int]

the constrained nodes

comps : List[str]

the components that are constrained on each node

Considers:
  • SPC
  • SPC1
  • SPCADD
  • GRID
Doesn’t consider:
  • non-zero enforced value on SPC
  • GMSPC
get_structural_material_ids(self)
get_thermal_material_ids(self)

gets the thermal material ids

get_volume_breakdown(self, property_ids=None, stop_if_no_volume=True)

gets a breakdown of the volume by property region

TODO: What about CONRODs? #’PBRSECT’, #’PBCOMP’, #’PBMSECT’, #’PBEAM3’, #’PBEND’, #’PIHEX’,

get_xyz_in_coord(self, cid=0, fdtype='float64', sort_ids=True)

Gets the xyz points (including SPOINTS) in the desired coordinate frame

Parameters:
cid : int; default=0

the desired coordinate system

fdtype : str; default=’float64’

the data type of the xyz coordinates

sort_ids : bool; default=True

sort the ids

Returns:
xyz : (n, 3) ndarray

the xyz points in the cid coordinate frame

get_xyz_in_coord_array(self, cid=0, fdtype='float64', idtype='int32')

Gets the xyzs as an array in an arbitrary coordinate system

Parameters:
fdtype : str; default=’float64’

the type of xyz_cp

idtype : str; default=’int32’

the type of nid_cp_cd

cid : int; default=0

the coordinate system to get xyz in

Returns:
nid_cp_cd : (n, 3) int ndarray

node id, CP, CD for each node

xyz_cid : (n, 3) float ndarray

points in the CID coordinate system

xyz_cp : (n, 3) float ndarray

points in the CP coordinate system

icd_transform : dict{int cd

Dictionary from coordinate id to index of the nodes in self.point_ids that their output (CD) in that coordinate system.

icp_transform : dict{int cp

Dictionary from coordinate id to index of the nodes in self.point_ids that their input (CP) in that coordinate system.

Todo

how are SPOINTs/EPOINTs identified? ..

Examples

>>> out = model.get_xyz_in_coord_array(cid=0)
>>> nid_cp_cd, xyz_cid, xyz_cp, icd_transform, icp_transform = out
get_xyz_in_coord_no_xref(self, cid=0, fdtype='float64', sort_ids=True)

see get_xyz_in_coord

include_zip(self, bdf_filename=None, encoding=None, make_ilines=True)

Read a bdf without perform any other operation, except (optionally) insert the INCLUDE files in the bdf

Parameters:
bdf_filename : str / None

the input bdf (default=None; popup a dialog)

encoding : str; default=None -> system default

the unicode encoding

make_ilines : bool; default=True

flag for ilines

Returns:
all_lines : List[str]

all the lines packed into a single line stream

ilines : (nlines, 2) int ndarray
if make_ilines = True:

the [ifile, iline] pair for each line in the file

if make_ilines = False:

ilines = None

Note

Setting read_includes to False is kind of pointless if called directly; it’s useful for read_bdf

increase_card_count(self, card_name, count_num=1)

Used for testing to check that the number of cards going in is the same as each time the model is read verifies proper writing of cards

Parameters:
card_name : str

the card_name -> ‘GRID’

count_num : int, optional

the amount to increment by (default=1)

>>> bdf.read_bdf(bdf_filename)
>>> bdf.card_count[‘GRID’]
50
is_bdf_vectorized

Returns False for the BDF class

is_long_ids
is_reject(self, card_name)

Can the card be read.

If the card is rejected, it’s added to self.reject_count

Parameters:
card_name : str

the card_name -> ‘GRID’

load(self, obj_filename='model.obj')

Loads a pickleable object

load_hdf5_file(self, h5_file)

Loads a BDF object from an hdf5 object

Parameters:
hdf5_file : H5File()

an h5py object

exporter : HDF5Exporter; default=None

unused

load_hdf5_filename(self, hdf5_filename)

Loads a BDF object from an hdf5 filename

Parameters:
hdf5_filename : str

the path to the hdf5 file

loads = None

stores LOAD, FORCE, FORCE1, FORCE2, MOMENT, MOMENT1, MOMENT2, PLOAD, PLOAD2, PLOAD4, SLOAD GMLOAD, SPCD, DEFORM, QVOL

mass_properties(self, element_ids=None, mass_ids=None, reference_point=None, sym_axis=None, scale=None, inertia_reference='cg')

Calculates mass properties in the global system about the reference point.

Parameters:
element_ids : list[int]; (n, ) ndarray, optional

An array of element ids.

mass_ids : list[int]; (n, ) ndarray, optional

An array of mass ids.

reference_point : ndarray/int, optional
type : ndarray

An array that defines the origin of the frame. default = <0,0,0>.

type : int

the node id

sym_axis : str, optional

The axis to which the model is symmetric. If AERO cards are used, this can be left blank. allowed_values = ‘no’, x’, ‘y’, ‘z’, ‘xy’, ‘yz’, ‘xz’, ‘xyz’

scale : float, optional

The WTMASS scaling value. default=None -> PARAM, WTMASS is used float > 0.0

inertia_reference : str; default=’cg’

‘cg’ : inertia is taken about the cg ‘ref’ : inertia is about the reference point

Returns:
mass : float

The mass of the model.

cg : ndarray

The cg of the model as an array.

inertia : ndarray

Moment of inertia array([Ixx, Iyy, Izz, Ixy, Ixz, Iyz]).

I = mass * centroid * centroid
\[I_{xx} = m (dy^2 + dz^2) ..\]
\[I_{yz} = -m * dy * dz ..\]
where:
\[dx = x_{element} - x_{ref} ..\]

Note

This doesn’t use the mass matrix formulation like Nastran. It assumes m*r^2 is the dominant term. If you’re trying to get the mass of a single element, it will be wrong, but for real models will be correct.

Examples

Mass properties of entire structure

>>> mass, cg, inertia = model.mass_properties()
>>> Ixx, Iyy, Izz, Ixy, Ixz, Iyz = inertia

Mass properties of model based on Property ID

>>> pids = list(model.pids.keys())
>>> pid_eids = self.get_element_ids_dict_with_pids(pids)
>>> for pid, eids in sorted(pid_eids.items()):
>>>     mass, cg, inertia = model.mass_properties(element_ids=eids)
mass_properties_no_xref(self, element_ids=None, mass_ids=None, reference_point=None, sym_axis=None, scale=None, inertia_reference='cg')

Calculates mass properties in the global system about the reference point.

Parameters:
element_ids : list[int]; (n, ) ndarray, optional

An array of element ids.

mass_ids : list[int]; (n, ) ndarray, optional

An array of mass ids.

reference_point : ndarray/int, optional
type : ndarray

An array that defines the origin of the frame. default = <0,0,0>.

type : int

the node id

sym_axis : str, optional

The axis to which the model is symmetric. If AERO cards are used, this can be left blank. allowed_values = ‘no’, x’, ‘y’, ‘z’, ‘xy’, ‘yz’, ‘xz’, ‘xyz’

scale : float, optional

The WTMASS scaling value. default=None -> PARAM, WTMASS is used float > 0.0

inertia_reference : str; default=’cg’

‘cg’ : inertia is taken about the cg ‘ref’ : inertia is about the reference point

Returns:
mass : float

The mass of the model.

cg : ndarray

The cg of the model as an array.

inertia : ndarray

Moment of inertia array([Ixx, Iyy, Izz, Ixy, Ixz, Iyz]).

I = mass * centroid * centroid
\[I_{xx} = m (dy^2 + dz^2) ..\]
\[I_{yz} = -m * dy * dz ..\]
where:
\[dx = x_{element} - x_{ref} ..\]

Note

This doesn’t use the mass matrix formulation like Nastran. It assumes m*r^2 is the dominant term. If you’re trying to get the mass of a single element, it will be wrong, but for real models will be correct.

Examples

mass properties of entire structure

>>> mass, cg, inertia = model.mass_properties()
>>> Ixx, Iyy, Izz, Ixy, Ixz, Iyz = inertia

mass properties of model based on Property ID

>>> pids = list(model.pids.keys())
>>> pid_eids = self.get_element_ids_dict_with_pids(pids)
>>> for pid, eids in sorted(pid_eids.items()):
>>>     mass, cg, inertia = model.mass_properties(element_ids=eids)
mass_properties_nsm(self, element_ids=None, mass_ids=None, nsm_id=None, reference_point=None, sym_axis=None, scale=None, inertia_reference='cg', xyz_cid0_dict=None, debug=False)

Calculates mass properties in the global system about the reference point. Considers NSM, NSM1, NSML, NSML1.

Parameters:
model : BDF()

a BDF object

element_ids : list[int]; (n, ) ndarray, optional

An array of element ids.

mass_ids : list[int]; (n, ) ndarray, optional

An array of mass ids.

nsm_id : int

the NSM id to consider

reference_point : ndarray/int, optional
type : ndarray

An array that defines the origin of the frame. default = <0,0,0>.

type : int

the node id

sym_axis : str, optional

The axis to which the model is symmetric. If AERO cards are used, this can be left blank. allowed_values = ‘no’, x’, ‘y’, ‘z’, ‘xy’, ‘yz’, ‘xz’, ‘xyz’

scale : float, optional

The WTMASS scaling value. default=None -> PARAM, WTMASS is used float > 0.0

inertia_reference : str; default=’cg’

‘cg’ : inertia is taken about the cg ‘ref’ : inertia is about the reference point

xyz_cid0_dict : dict[nid]

mapping of the node id to the global position

debug : bool; default=False

developer debug; may be removed in the future

Returns:
mass : float

The mass of the model.

cg : ndarray

The cg of the model as an array.

inertia : ndarray

Moment of inertia array([Ixx, Iyy, Izz, Ixy, Ixz, Iyz]).

I = mass * centroid * centroid
\[I_{xx} = m (dy^2 + dz^2) ..\]
\[I_{yz} = -m * dy * dz ..\]
where:
\[dx = x_{element} - x_{ref} ..\]

Note

This doesn’t use the mass matrix formulation like Nastran. It assumes m*r^2 is the dominant term. If you’re trying to get the mass of a single element, it will be wrong, but for real models will be correct.

Warning

  • If eids are requested, but don’t exist, no warning is thrown. Decide if this is the desired behavior.
  • If the NSMx ALL option is used, the mass from all elements will be considered, even if not included in the element set

Examples

mass properties of entire structure

>>> mass, cg, inertia = model.mass_properties()
>>> Ixx, Iyy, Izz, Ixy, Ixz, Iyz = inertia

mass properties of model based on Property ID >>> pids = list(model.pids.keys()) >>> pid_eids = model.get_element_ids_dict_with_pids(pids) >>> for pid, eids in sorted(pid_eids.items()): >>> mass, cg, inertia = mass_properties(model, element_ids=eids)

material_ids

gets the material ids

nastran_format
ncaeros

gets the number of CAEROx panels

ncoords

gets the number of coordinate systems

nelements

gets the number of element

nid_map

Gets the GRID/SPOINT/EPOINT ids to a sorted order.

Parameters:
sort_ids : bool; default=True

sort the ids

Returns:
nid_map : Dict[nid]
nid : int

the GRID/SPOINT/EPOINT id

i : int

the index

..note :: GRIDs, SPOINTs, & EPOINTs are stored in separate slots,

so they are unorganized.

..note :: see self.get_nid_map(sort_ids=False) for the unsorted version
nmaterials

gets the number of materials

nnodes

gets the number of GRIDs

node_ids

gets the GRID ids

nodes = None

stores SPOINT, GRID cards

npoints

gets the number of GRID, SPOINT, EPOINT ids

nproperties

gets the number of properties

object_attributes(self, mode='public', keys_to_skip=None, filter_properties=False)

List the names of attributes of a class as strings. Returns public attributes as default.

Parameters:
mode : str

defines what kind of attributes will be listed * ‘public’ - names that do not begin with underscore * ‘private’ - names that begin with single underscore * ‘both’ - private and public * ‘all’ - all attributes that are defined for the object

keys_to_skip : List[str]; default=None -> []

names to not consider to avoid deprecation warnings

filter_properties: bool: default=False

filters the @property objects

Returns:
attribute_names : List[str]

sorted list of the names of attributes of a given type or None if the mode is wrong

object_methods(self, mode='public', keys_to_skip=None)

List the names of methods of a class as strings. Returns public methods as default.

Parameters:
obj : instance

the object for checking

mode : str

defines what kind of methods will be listed * “public” - names that do not begin with underscore * “private” - names that begin with single underscore * “both” - private and public * “all” - all methods that are defined for the object

keys_to_skip : List[str]; default=None -> []

names to not consider to avoid deprecation warnings

Returns:
method : List[str]

sorted list of the names of methods of a given type or None if the mode is wrong

point_ids

gets the GRID, SPOINT, EPOINT ids

pop_parse_errors(self)

raises an error if there are parsing errors

pop_xref_errors(self)

raises an error if there are cross-reference errors

property_ids

gets the property ids

read_bdf(self, bdf_filename=None, validate=True, xref=True, punch=False, read_includes=True, save_file_structure=False, encoding=None)

Read method for the bdf files

Parameters:
bdf_filename : str / None

the input bdf (default=None; popup a dialog)

validate : bool; default=True

runs various checks on the BDF

xref : bool; default=True

should the bdf be cross referenced

punch : bool; default=False

indicates whether the file is a punch file

read_includes : bool; default=True

indicates whether INCLUDE files should be read

save_file_structure : bool; default=False

enables the write_bdfs method

encoding : str; default=None -> system default

the unicode encoding

.. code-block:: python
>>> bdf = BDF()
>>> bdf.read_bdf(bdf_filename, xref=True)
>>> g1 = bdf.Node(1)
>>> print(g1.get_position())
[10.0, 12.0, 42.0]
>>> bdf.write_card(bdf_filename2)
>>> print(bdf.card_stats())

—BDF Statistics— SOL 101 bdf.nodes = 20 bdf.elements = 10 etc.

reject_card_lines(self, card_name, card_lines, show_log=True, comment='')

rejects a card

replace_cards(self, replace_model)

Replaces the common cards from the current (self) model from the ones in the new replace_model. The intention is that you’re going to replace things like PSHELLs and DESVARs from a pch file in order to update your BDF with the optimized geometry.

Todo

only does a subset of cards.

Notes

loads/spcs (not supported) are tricky because you can’t replace cards one-to-one…not sure what to do

reset_errors(self)

removes the errors from the model

reset_rslot_map(self)

helper method for get_rslot_map

safe_acsid(self, msg='')

gets the aerodynamic coordinate system

safe_aefact(self, aefact_id, ref_id, xref_errors, msg='')

Gets an AEFACT card

Parameters:
ref_id : int

the referencing value (e.g., an CAERO eid references a AEFACT)

safe_aelist(self, aelist_id, ref_id, xref_errors, msg='')

Gets an AELIST card

Parameters:
ref_id : int

the referencing value (e.g., an AESURF eid references a AELIST)

safe_caero(self, caero_id, ref_id, xref_errors, msg='')
safe_coord(self, cid, ref_id, xref_errors, msg='')

Gets a CORDx card

Parameters:
ref_id : int

the referencing value (e.g., an node and element references a coord)

safe_cross_reference(self, xref=True, xref_nodes=True, xref_elements=True, xref_nodes_with_elements=False, xref_properties=True, xref_masses=True, xref_materials=True, xref_loads=True, xref_constraints=True, xref_aero=True, xref_sets=True, xref_optimization=True, create_superelement_geometry=False, debug=True, word='')

Performs cross referencing in a way that skips data gracefully.

Warning

not fully implemented

safe_element(self, eid, ref_id, xref_errors, msg='')

Gets an element card

Parameters:
ref_id : int

the referencing value (e.g., a load references an element)

ref_id = 10 # PLOAD4
pid = 42 # CQUAD4
xref_errors = {‘eid’ : []}
self.safe_element(eid, ref_id, xref_errors)
safe_elements(self, eids, ref_id, xref_errors, msg='')

Gets an series of elements

Doesn’t get rigid (RROD, RBAR, RBE2, RBE3, RBAR, RBAR1, RSPLINE, RSSCON) or mass (CMASS1, CONM2)

safe_empty_nodes(self, nids, msg='')

safe xref version of self.Nodes(nid, msg=’‘)

safe_get_elements(self, eids, msg='')

safe xref version of self.Elements(eid, msg=’‘)

safe_get_nodes(self, nids, msg='')

safe xref version of self.Nodes(nid, msg=’‘)

safe_get_points(self, point_ids, msg='')

safe xref version of self.Points(point_ids, msg=’‘)

safe_material(self, mid, ref_id, xref_errors, msg='')

Gets a material card

Parameters:
ref_id : int

the referencing value (e.g., an property references a material)

safe_paero(self, paero_id, ref_id, xref_errors, msg='')

Gets a PAEROx card

Parameters:
ref_id : int

the referencing value (e.g., a load references an element)

ref_id = 10 # CAERO1
pid = 42 # PAERO1
xref_errors = {‘paero’ : []}
self.safe_element(pid, ref_id, xref_errors)
safe_property(self, pid, ref_id, xref_errors, msg='')
Parameters:
ref_id : int

the referencing value (e.g., an element references a property)

ref_id = 10 # CQUAD4
pid = 42 # PSHELL
xref_errors = {‘pid’ : []}
self.safe_property(pid, ref_id, xref_errors)
safe_property_mass(self, pid, ref_id, xref_errors, msg='')

Gets a mass_property card

Parameters:
ref_id : int

the referencing value (e.g., an element references a property)

safe_tabled(self, tabled_id, ref_id, xref_errors, msg='')
Parameters:
ref_id : int

the referencing value (e.g., an TLOAD1 eid references a TABLED1)

safe_tableh(self, tableh_id, ref_id, xref_errors, msg='')
Parameters:
ref_id : int

the referencing value (e.g., an MATT1 eid references a TABLEH1)

save(self, obj_filename='model.obj', unxref=True)

Saves a pickleable object

saves(self, unxref=True)

Saves a pickled string

set_as_msc(self)
set_as_nx(self)
set_as_zona(self)
set_cards(self, cards)

Method for setting the cards that will be processed

Parameters:
cards : List[str]; Set[str]

a list/set of cards that should not be read

.. python ::

bdf_model.set_cards([‘GRID’, ‘CTRIA3’])

set_dynamic_syntax(self, dict_of_vars)

Uses the OpenMDAO syntax of %varName in an embedded BDF to update the values for an optimization study.

Parameters:
dict_of_vars : dict[str] = int/float/str

dictionary of 7 character variable names to map.

.. code-block:: python

GRID, 1, %xVar, %yVar, %zVar

>>> dict_of_vars = {'xVar': 1.0, 'yVar', 2.0, 'zVar':3.0}
>>> bdf = BDF()
>>> bdf.set_dynamic_syntax(dict_of_vars)
>>> bdf.read_bdf(bdf_filename, xref=True)

Notes

Case sensitivity is supported. Variables should be 7 characters or less to fit in an 8-character field.

Warning

Type matters!

set_error_storage(self, nparse_errors=100, stop_on_parsing_error=True, nxref_errors=100, stop_on_xref_error=True)

Catch parsing errors and store them up to print them out all at once (not all errors are caught).

Parameters:
nparse_errors : int

how many parse errors should be stored (default=0; all=None; no storage=0)

stop_on_parsing_error : bool

should an error be raised if there are parsing errors (default=True)

nxref_errors : int

how many cross-reference errors should be stored (default=0; all=None; no storage=0)

stop_on_xref_error : bool

should an error be raised if there are cross-reference errors (default=True)

set_param(self, key, values)

sets a param card; creates it if necessary

sol

gets the solution (e.g. 101, 103)

subcases

gets the subcases

sum_forces_moments(self, p0, loadcase_id, include_grav=False, xyz_cid0=None, cid=0)

Sums applied forces & moments about a reference point p0 for all load cases. Considers:

  • FORCE, FORCE1, FORCE2
  • MOMENT, MOMENT1, MOMENT2
  • PLOAD, PLOAD2, PLOAD4
  • LOAD
Parameters:
p0 : NUMPY.NDARRAY shape=(3,) or integer (node ID)

the reference point

loadcase_id : int

the LOAD=ID to analyze

cid : int; default=0

the coordinate system for the summation

include_grav : bool; default=False

includes gravity in the summation (not supported)

xyz_cid0 : None / Dict[int] = (3, ) ndarray

the nodes in the global coordinate system

Returns:
forces : NUMPY.NDARRAY shape=(3,)

the forces

moments : NUMPY.NDARRAY shape=(3,)

the moments

Warning

not full validated ..

Todo

It’s super slow for cid != 0. We can speed this up a lot if we calculate the normal, area, centroid based on precomputed node locations.

Pressure acts in the normal direction per model/real/loads.bdf and loads.f06
sum_forces_moments_elements(self, p0, loadcase_id, eids, nids, include_grav=False, xyz_cid0=None, cid=0)

Sum the forces/moments based on a list of nodes and elements.

Parameters:
p0 : int; (3,) ndarray

the point to sum moments about type = int

sum moments about the specified grid point

type = (3, ) ndarray/list (e.g. [10., 20., 30]):

the x, y, z location in the global frame

loadcase_id : int

the LOAD=ID to analyze

eids : List[int]

the list of elements to include (e.g. the loads due to a PLOAD4)

nids : List[int]

the list of nodes to include (e.g. the loads due to a FORCE card)

cid : int; default=0

the coordinate system for the summation

include_grav : bool; default=False

includes gravity in the summation (not supported)

xyz_cid0 : None / Dict[int] = (3, ) ndarray

the nodes in the global coordinate system

Returns:
forces : NUMPY.NDARRAY shape=(3,)

the forces

moments : NUMPY.NDARRAY shape=(3,)

the moments

Nodal Types : FORCE, FORCE1, FORCE2,

MOMENT, MOMENT1, MOMENT2, PLOAD

Element Types: PLOAD1, PLOAD2, PLOAD4, GRAV
If you have a CQUAD4 (eid=3) with a PLOAD4 (sid=3) and a FORCE
card (nid=5) acting on it, you can incldue the PLOAD4, but
not the FORCE card by using:
For just pressure:
For just force:
or both:

Notes

If you split the model into sections and sum the loads on each section, you may not get the same result as if you summed the loads on the total model. This is due to the fact that nodal loads on the boundary are double/triple/etc. counted depending on how many breaks you have.

Todo

not done…

superelement_nodes(self, seid, nodes, msg='')
transform_xyzcp_to_xyz_cid(self, xyz_cp, nids, icp_transform, cid=0, in_place=False, atol=1e-06)

Vectorized method for calculating node locations in an arbitrary coordinate system.

Parameters:
xyz_cp : (n, 3) float ndarray

points in the CP coordinate system

nids : (n, ) int ndarray

the GRID/SPOINT/EPOINT ids corresponding to xyz_cp

icp_transform : dict{int cp

Dictionary from coordinate id to index of the nodes in self.point_ids that their input (CP) in that coordinate system.

cid : int; default=0

the coordinate system to get xyz in

in_place : bool, default=False

If true the original xyz_cp is modified, otherwise a new one is created.

Returns:
xyz_cid : (n, 3) float ndarray

points in the CID coordinate system

Examples

# assume GRID 1 has a CD=10, CP=0 # assume GRID 2 has a CD=10, CP=0 # assume GRID 5 has a CD=50, CP=1 >>> model.point_ids [1, 2, 5] >>> out = model.get_displacement_index_xyz_cp_cd() >>> icd_transform, icp_transform, xyz_cp, nid_cp_cd = out >>> nids = nid_cp_cd[:, 0] >>> xyz_cid0 = model.transform_xyzcp_to_xyz_cid(

xyz_cp, nids, icp_transform, cid=0)
>>> xyz_cid1 = model.transform_xyzcp_to_xyz_cid(
        xyz_cp, nids, icp_transform,
        cid=1)
type_slot_str

helper method for printing supported cards

uncross_reference(self, word='')

uncross references the model

update_card(self, card_name, icard, ifield, value)

Updates a Nastran card based on standard Nastran optimization names

Parameters:
card_name : str

the name of the card (e.g. GRID)

icard : int

the unique 1-based index identifier for the card (e.g. the GRID id)

ifield : int

the index on the card (e.g. X on GRID card as an integer representing the field number)

value : varies

the value to assign

Returns:
obj : varies

the corresponding object (e.g. the GRID object)

# On GRID 100, set Cp (2) to 42
>>> model.update_card('GRID', 100, 2, 42)
    ..
# On GRID 100, set X (3) to 43.
>>> model.update_card('GRID', 100, 3, 43.)
    ..
update_model_by_desvars(self, xref=True, desvar_values=None)

doesn’t require cross referenceing

update_solution(self, sol, method, sol_iline)

Updates the overall solution type (e.g. 101,200,600)

Parameters:
sol : int

the solution type (101, 103, etc)

method : str

the solution method (only for SOL=600)

sol_iline : int

the line to put the SOL/method on

validate(self)

runs some checks on the input data beyond just type checking

write_bdf(self, out_filename=None, encoding=None, size=8, is_double=False, interspersed=False, enddata=None, write_header=True, close=True)

Writes the BDF.

Parameters:
out_filename : varies; default=None

str - the name to call the output bdf file - a file object StringIO() - a StringIO object None - pops a dialog

encoding : str; default=None -> system specified encoding

the unicode encoding latin1, and utf8 are generally good options

size : int; {8, 16}

the field size

is_double : bool; default=False

False : small field True : large field

interspersed : bool; default=True

Writes a bdf with properties & elements interspersed like how Patran writes the bdf. This takes slightly longer than if interspersed=False, but makes it much easier to compare to a Patran-formatted bdf and is more clear.

enddata : bool; default=None

bool - enable/disable writing ENDDATA None - depends on input BDF

write_header : bool; default=True

flag for writing the pyNastran header

close : bool; default=True

should the output file be closed

write_bdfs(self, out_filenames, relative_dirname=None, encoding=None, size=8, is_double=False, enddata=None, close=True, is_windows=None)

Writes the BDF.

Parameters:
out_filename : varies; default=None

str - the name to call the output bdf file - a file object StringIO() - a StringIO object None - pops a dialog

relative_dirname : str; default=None -> os.curdir

A relative path to reference INCLUDEs. ‘’ : relative to the main bdf None : use the current directory path : absolute path

encoding : str; default=None -> system specified encoding

the unicode encoding latin1, and utf8 are generally good options

size : int; {8, 16}

the field size

is_double : bool; default=False

False : small field True : large field

enddata : bool; default=None

bool - enable/disable writing ENDDATA None - depends on input BDF

close : bool; default=True

should the output file be closed

is_windows : bool; default=None
True/False : Windows has a special format for writing INCLUDE

files, so the format for a BDF that will run on Linux and Windows is different.

None : Check the platform

write_skin_solid_faces(self, skin_filename, write_solids=False, write_shells=True, size=8, is_double=False, encoding=None)

Writes the skinned elements

Parameters:
skin_filename : str

the file to write

write_solids : bool; default=False

write solid elements that have skinned faces

write_shells : bool; default=False

write newly created shell elements if there are shells in the model, doesn’t write these

size : int; default=8

the field width

is_double : bool; default=False

double precision flag

encoding : str; default=None -> system default

the string encoding

wtmass

Gets the PARAM,WTMASS value, which defines the weight to mass conversion factor

kg -> kg : 1.0 lb -> slug : 1/32.2 lb -> slinch : 1/(32.2*12)=1/386.4

pyNastran.bdf.bdf.load_bdf_object(obj_filename, xref=True, log=None, debug=True)[source]
pyNastran.bdf.bdf.main()[source]

shows off how unicode works becausee it’s overly complicated

pyNastran.bdf.bdf.read_bdf(bdf_filename=None, validate=True, xref=True, punch=False, save_file_structure=False, skip_cards=None, read_cards=None, encoding=None, log=None, debug=True, mode='msc')[source]

Creates the BDF object

Parameters:
bdf_filename : str (default=None -> popup)

the bdf filename

debug : bool/None
used to set the logger if no logger is passed in

True: logs debug/info/error messages False: logs info/error messages None: logs error messages

log : logging module object / None

if log is set, debug is ignored and uses the settings the logging object has

validate : bool; default=True

runs various checks on the BDF

xref : bool; default=True

should the bdf be cross referenced

punch : bool; default=False

indicates whether the file is a punch file

save_file_structure : bool; default=False

enables the write_bdfs method

skip_cards : List[str]; default=None

None : include all cards list of cards to skip

read_cards : List[str]; default=None

None : include all cards list of cards to read (all the cards)

encoding : str; default=None -> system default

the unicode encoding

mode : str; default=’msc’

the type of Nastran valid_modes = {‘msc’, ‘nx’}

Returns:
model : BDF()

an BDF object

Note

this method will change in order to return an object that does not have so many methods

Todo

finish this ..