bdf_card Module

digraph inheritance2f7b356f47 { bgcolor=transparent; rankdir=LR; size=""; "pyNastran.bdf.bdf_interface.bdf_card.BDFCard" [URL="#pyNastran.bdf.bdf_interface.bdf_card.BDFCard",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A BDFCard is a list that has a default value of None for fields out of range."]; }

Defines the BDFCard class that is passed into the various Nastran cards.

class pyNastran.bdf.bdf_interface.bdf_card.BDFCard(card: list[str], has_none: bool = True)[source]

Bases: object

A BDFCard is a list that has a default value of None for fields out of range.

Parameters:
cardlist[str]

the split values for the card

has_nonebool; default=True

helps with a special case to speed up runtime

# definitely bad
card = [‘GRID’, ‘1’, ‘’, ‘1.0’, ‘2.0’, ‘3.0’]
BDFCard(card, has_none=False)
# definitely correct
card = [‘GRID’, ‘1’, None, ‘1.0’, ‘2.0’, ‘3.0’]
BDFCard(card, has_none=True)
# ???
card = [‘GRID’, ‘1’, ‘’, 1.0, 2.0, 3.0]
BDFCard(card, has_none=True)
field(i: int, default: int | float | str | None = None) int | float | str | None[source]

Gets the ith field on the card

Parameters:
iint

the ith field on the card (following list notation)

defaultint/float/str/None

the default value for the field

Returns:
valueint/float/str/None

the value on the ith field

fields(i: int = 0, j: int | None = None) list[Any][source]

Gets multiple fields on the card

Parameters:
iint > 0

the ith field on the card (following list notation)

jint / None

int : the jth field on the card None : last field on the card

Returns:
valueslist[varies]

int/float/str the values on the ith-jth fields

fields_defaults(i: int = 0, j: int | None = None, defaults: Any = None) list[Any][source]

Gets multiple fields on the card

Parameters:
iint > 0

the ith field on the card (following list notation)

jint / None

int : the jth field on the card None : last field on the card

defaultslist[int/float/str]

the default value for the field (as a list) len(defaults)=i-j-1

Returns:
valueslist[varies]

int/float/str the values on the ith-jth fields

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

prints the card in 8/16/16-double format