base_card Package¶
base_card Module¶

- defines:
BaseCard()
Element()
Property()
Material()
word, num = break_word_by_trailing_integer(pname_fid)
word, num = break_word_by_trailing_parentheses_integer_ab(pname_fid)
-
class
pyNastran.bdf.cards.base_card.BaseCard[source]¶ Bases:
objectDefines a series of base methods for every card class (e.g., GRID, CTRIA3) including:
deepcopy()
get_stats()
validate()
object_attributes(mode=’public’, keys_to_skip=None)
object_methods(self, mode=’public’, keys_to_skip=None)
comment
update_field(self, n, value)
-
property
comment¶ accesses the comment
-
get_field(n: int) → Union[int, float, str, None][source]¶ Gets a field based on it’s field number
- Parameters
- nint
the field number
- Returns
- valueint/float/str/None
the value of the field
-
object_attributes(mode: str = 'public', keys_to_skip: Optional[List[str]] = None, filter_properties: bool = False) → List[str][source]¶ See also
pyNastran.utils.object_attributes(…)
-
object_methods(mode: str = 'public', keys_to_skip: Optional[List[str]] = None) → List[str][source]¶ See also
pyNastran.utils.object_methods(…)
-
print_card(size: int = 8, is_double: bool = False) → str[source]¶ prints the card in 8/16/16-double format
-
repr_fields() → List[Union[int, float, str, None]][source]¶ Gets the fields in their simplified form
- Returns
- fieldsList[varies]
the fields that define the card
-
abstract property
type¶
-
update_field(n: int, value: Union[int, float, str, None]) → None[source]¶ Updates a field based on it’s field number.
- Parameters
- nint
the field number
- valueint/float/str/None
the value to update the field to
- .. note::
This is dynamic if the card length changes.
- update_field can be used as follows to change the z coordinate
- of a node::
>>> nid = 1 >>> node = model.nodes[nid] >>> node.update_field(3, 0.1)
-
class
pyNastran.bdf.cards.base_card.Element[source]¶ Bases:
pyNastran.bdf.cards.base_card.BaseCarddefines the Element class
dummy init
-
get_node_positions(nodes: Optional[Any] = None) → numpy.ndarray[source]¶ returns the positions of multiple node objects
-
get_node_positions_no_xref(model: BDF, nodes: List[Any] = None) → np.ndarray[source]¶ returns the positions of multiple node objects
-
pid= 0¶
-
-
class
pyNastran.bdf.cards.base_card.Material[source]¶ Bases:
pyNastran.bdf.cards.base_card.BaseCardBase Material Class
dummy init
-
property
TRef¶
-
property
-
class
pyNastran.bdf.cards.base_card.Property[source]¶ Bases:
pyNastran.bdf.cards.base_card.BaseCardBase Property Class
dummy init
-
pyNastran.bdf.cards.base_card.break_word_by_trailing_integer(pname_fid: str) → Tuple[str, str][source]¶ Splits a word that has a value that is an integer
- Parameters
- pname_fidstr
the DVPRELx term (e.g., A(11), NSM(5))
- Returns
- wordstr
the value not in parentheses
- valueint
the value in parentheses
Examples
>>> break_word_by_trailing_integer('T11') ('T', '11') >>> break_word_by_trailing_integer('THETA11') ('THETA', '11')
-
pyNastran.bdf.cards.base_card.break_word_by_trailing_parentheses_integer_ab(pname_fid: str) → Tuple[str, str][source]¶ Splits a word that has a value that can be A/B as well as an integer
- Parameters
- pname_fidstr
the DVPRELx term; A(11), NSM(5), NSM(B)
- Returns
- wordstr
the value not in parentheses
- valueint/str
the value in parentheses
Examples
>>> break_word_by_trailing_parentheses_integer('A(11)') ('A', '11') >>> break_word_by_trailing_parentheses_integer('NSM(11)') ('NSM', '11') >>> break_word_by_trailing_parentheses_integer('NSM(B)') ('NSM', 'B')