nodes
Module¶
All nodes are defined in this file. This includes:
Node * XPoint
- EPOINT
- SPOINT
- XPoints * EPOINTs * SPOINTs
- GRID
- GRDSET
- GRIDB
POINT
Ring * RINGAX
SEQGP
All ungrouped elements are Node objects.
The EPOINT/SPOINT classes refer to a single EPOINT/SPOINT. The EPOINTs/SPOINTs classes are for multiple degrees of freedom (e.g. an SPOINT card).
-
class
pyNastran.bdf.cards.nodes.
EPOINT
(nid, comment='')[source]¶ Bases:
pyNastran.bdf.cards.nodes.XPoint
defines the EPOINT class
Creates the EPOINT card
Parameters: - nid : int
the EPOINT id
- comment : str; default=’‘
a comment for the card
-
type
= 'EPOINT'¶
-
class
pyNastran.bdf.cards.nodes.
EPOINTs
(ids, comment='')[source]¶ Bases:
pyNastran.bdf.cards.nodes.XPoints
1 2 3 4 5 6 7 8 9 EPOINT ID1 THRU ID2 EPOINT ID1 ID1 ID3 ID4 ID5 ID6 ID7 ID8 ID8 etc. Creates the EPOINTs card that contains many EPOINTs
Parameters: - ids : List[int]
EPOINT ids
- comment : str; default=’‘
a comment for the card
-
type
= 'EPOINT'¶
-
class
pyNastran.bdf.cards.nodes.
GRDSET
(cp, cd, ps, seid, comment='')[source]¶ Bases:
pyNastran.bdf.cards.base_card.BaseCard
Defines default options for fields 3, 7, 8, and 9 of all GRID entries.
1 2 3 4 5 6 7 8 9 GRDSET CP CD PS SEID 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
-
Cp
(self)[source]¶ Gets the analysis coordinate system
Returns: - cp : int
the analysis coordinate system
-
classmethod
add_card
(card, comment='')[source]¶ Adds a GRDSET card from
BDF.add_card(...)
Parameters: - card : BDFCard()
a BDFCard object
- comment : str; default=’‘
a comment for the card
-
cd
= None¶ Analysis coordinate system
-
cp
= None¶ Output Coordinate System
-
cross_reference
(self, model)[source]¶ Cross links the card so referenced cards can be extracted directly
Parameters: - model : BDF()
the BDF object
-
ps
= None¶ Default SPC constraint on undefined nodes
-
raw_fields
(self)[source]¶ Gets the fields in their unmodified form
Returns: - fields : List[varies]
the fields that define the card
-
repr_fields
(self)[source]¶ Gets the fields in their simplified form
Returns: - fields : List[varies]
the fields that define the card
-
seid
= None¶ Superelement ID
-
type
= 'GRDSET'¶
-
class
pyNastran.bdf.cards.nodes.
GRID
(nid, xyz, cp=0, cd=0, ps='', seid=0, comment='')[source]¶ Bases:
pyNastran.bdf.cards.base_card.BaseCard
1 2 3 4 5 6 7 8 9 GRID NID CP X1 X2 X3 CD PS SEID Attributes: - nid : int
node id
- xyz : float ndarray
Raw location <\(x_1, x_2, x_3\)>
- cp : int
reference coordinate system
- cd : int
analysis coordinate system
- ps : str
nodal-based constraints
- seid : int
superelement id
- cp_ref : Coord() or None
cross-referenced cp
- cd_ref : Coord() or None
cross-referenced cd
Methods
Nid() gets nid Cp() gets cp_ref.cid or cp depending on cross-referencing Cd() gets cd_ref.cid or cd depending on cross-referencing Ps() gets ps SEid() superelement id get_position() gets xyz in the global frame get_position_wrt(model, cid) gets xyz in a local frame cross_reference(model) cross-references the card uncross_reference() uncross-references the card set_position(model, xyz, cid=0, xref=True) updates the coordinate system Using the GRID object:: model = read_bdf(bdf_filename) node = model.Node(nid) # gets the position of the node in the global frame node.get_position() node.get_position_wrt(model, cid=0) # gets the position of the node in a local frame node.get_position_wrt(model, cid=1) # change the location of the node node.set_position(model, array([1.,2.,3.]), cid=3) 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
-
Cp
(self)[source]¶ Gets the analysis coordinate system
Returns: - cp : int
the analysis coordinate system
-
classmethod
add_card
(card, comment='')[source]¶ Adds a GRID card from
BDF.add_card(...)
Parameters: - card : BDFCard()
a BDFCard object
- comment : str; default=’‘
a comment for the card
-
cross_reference
(self, model, grdset=None)[source]¶ Cross links the card so referenced cards can be extracted directly
Parameters: - model : BDF()
the BDF object
- grdset : GRDSET / None; default=None
a GRDSET if available (default=None)
- .. note:: The gridset object will only update the fields that
have not been set
-
get_position
(self)[source]¶ Gets the point in the global XYZ coordinate system.
Returns: - xyz : (3, ) float ndarray
the position of the GRID in the global coordinate system
-
get_position_assuming_rectangular
(self)[source]¶ Gets the point in a coordinate system that has unit vectors in the referenced coordinate system, but is not transformed from a cylindrical/spherical system. This is used by cards like CBAR/CBEAM for element offset vectors.
Returns: - xyz : (3, ) float ndarray
the position of the GRID in the global coordinate system
-
get_position_wrt
(self, model, cid)[source]¶ Gets the location of the GRID which started in some arbitrary system and returns it in the desired coordinate system
Parameters: - model : BDF()
the BDF object
- cid : int
the desired coordinate ID
Returns: - xyz : (3, ) float ndarray
the position of the GRID in an arbitrary coordinate system
-
raw_fields
(self)[source]¶ Gets the fields in their unmodified form
Returns: - fields : List[int/float/str]
the fields that define the card
-
repr_fields
(self)[source]¶ Gets the fields in their simplified form
Returns: - fields : List[int/float/str]
the fields that define the card
-
set_position
(self, model, xyz, cid=0, xref=True)[source]¶ Updates the GRID location
Parameters: - xyz : (3, ) float ndarray
the location of the node.
- cp : int; default=0 (global)
the analysis coordinate system
- xref : bool; default=True
cross-references the coordinate system
-
type
= 'GRID'¶
-
class
pyNastran.bdf.cards.nodes.
GRIDB
(nid, phi, cd, ps, ringfl, comment='')[source]¶ Bases:
pyNastran.bdf.cards.base_card.BaseCard
defines the GRIDB class
Creates the GRIDB card
-
classmethod
add_card
(card, comment='')[source]¶ Adds a GRIDB card from
BDF.add_card(...)
Parameters: - card : BDFCard()
a BDFCard object
- comment : str; default=’‘
a comment for the card
-
nid
= None¶ node ID
-
ps
= None¶ local SPC constraint
-
raw_fields
(self)[source]¶ Gets the fields in their unmodified form
Returns: - fields : List[varies]
the fields that define the card
-
repr_fields
(self)[source]¶ Gets the fields in their simplified form
Returns: - fields : List[varies]
the fields that define the card
-
ringfl
= None¶ ringfl
-
type
= 'GRIDB'¶
-
classmethod
-
class
pyNastran.bdf.cards.nodes.
POINT
(nid, xyz, cp=0, comment='')[source]¶ Bases:
pyNastran.bdf.cards.base_card.BaseCard
1 2 3 4 5 6 POINT NID CP X1 X2 X3 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
-
Cp
(self)[source]¶ Gets the analysis coordinate system
Returns: - cp : int
the analysis coordinate system
-
classmethod
add_card
(card, comment='')[source]¶ Adds a POINT card from
BDF.add_card(...)
Parameters: - card : BDFCard()
a BDFCard object
- comment : str; default=’‘
a comment for the card
-
cp
= None¶ Grid point coordinate system
-
cross_reference
(self, model)[source]¶ Cross links the card so referenced cards can be extracted directly
Parameters: - model : BDF()
the BDF object
-
get_position
(self)[source]¶ Gets the point in the global XYZ coordinate system.
Returns: - position : (3,) float ndarray
the position of the POINT in the globaly coordinate system
-
get_position_wrt
(self, model, cid)[source]¶ Gets the location of the POINT which started in some arbitrary system and returns it in the desired coordinate system
Parameters: - model : BDF()
the BDF model object
- cid : int
the desired coordinate ID
Returns: - xyz : (3,) ndarray
the position of the POINT in an arbitrary coordinate system
-
nid
= None¶ Node ID
-
raw_fields
(self)[source]¶ Gets the fields in their unmodified form
Returns: - fields : list[varies]
the fields that define the card
-
repr_fields
(self)[source]¶ Gets the fields in their simplified form
Returns: - fields : list[varies]
the fields that define the card
-
set_position
(self, model, xyz, cid=0)[source]¶ Updates the POINT location
Parameters: - xyz : (3,) float ndarray
the location of the node
- cp : int; default=0 (global)
the analysis coordinate system
-
type
= 'POINT'¶
-
write_card
(self, size=8, is_double=False)[source]¶ The writer method used by BDF.write_card
Parameters: - size : int
the size of the card (8/16)
-
xyz
= None¶ node location in local frame
-
class
pyNastran.bdf.cards.nodes.
SEQGP
(nids, seqids, comment='')[source]¶ Bases:
pyNastran.bdf.cards.base_card.BaseCard
defines the SEQGP class
Creates the SEQGP card
Parameters: - nid : int
the node id
- seqid : int/float
the superelement id
- comment : str; default=’‘
a comment for the card
-
classmethod
add_card
(card, comment='')[source]¶ Adds a SEQGP card from
BDF.add_card(...)
Parameters: - card : BDFCard()
a BDFCard object
- comment : str; default=’‘
a comment for the card
-
raw_fields
(self)[source]¶ Gets the fields in their unmodified form
Returns: - fields : List[varies]
the fields that define the card
-
type
= 'SEQGP'¶
-
class
pyNastran.bdf.cards.nodes.
SPOINT
(nid, comment='')[source]¶ Bases:
pyNastran.bdf.cards.nodes.XPoint
defines the SPOINT class
Creates the SPOINT card
Parameters: - nid : int
the SPOINT id
- comment : str; default=’‘
a comment for the card
-
type
= 'SPOINT'¶
-
class
pyNastran.bdf.cards.nodes.
SPOINTs
(ids, comment='')[source]¶ Bases:
pyNastran.bdf.cards.nodes.XPoints
1 2 3 4 5 6 7 8 9 SPOINT ID1 THRU ID2 SPOINT ID1 ID1 ID3 ID4 ID5 ID6 ID7 ID8 ID8 etc. Creates the SPOINTs card that contains many SPOINTs
Parameters: - ids : List[int]
SPOINT ids
- comment : str; default=’‘
a comment for the card
-
type
= 'SPOINT'¶
-
class
pyNastran.bdf.cards.nodes.
XPoint
(nid, comment)[source]¶ Bases:
pyNastran.bdf.cards.base_card.BaseCard
common class for EPOINT/SPOINT
-
cross_reference
(self, model)[source]¶ Cross links the card so referenced cards can be extracted directly
Parameters: - model : BDF()
the BDF object
-
raw_fields
(self)[source]¶ Gets the fields in their unmodified form
Returns: - fields : List[varies]
the fields that define the card
-
type
¶ dummy method for EPOINT/SPOINT classes
-
-
class
pyNastran.bdf.cards.nodes.
XPoints
(ids, comment='')[source]¶ Bases:
pyNastran.bdf.cards.base_card.BaseCard
common class for EPOINTs and SPOINTs
-
classmethod
add_card
(card, comment='')[source]¶ Adds a SPOINT/EPOINT card from
BDF.add_card(...)
Parameters: - card : BDFCard()
a BDFCard object
- comment : str; default=’‘
a comment for the card
-
cross_reference
(self, model)[source]¶ Cross links the card so referenced cards can be extracted directly
Parameters: - model : BDF()
the BDF object
-
raw_fields
(self)[source]¶ Gets the fields in their unmodified form
Returns: - fields : List[varies]
the fields that define the card
-
type
¶ dummy method for EPOINTs/SPOINTs classes
-
classmethod
-
pyNastran.bdf.cards.nodes.
compress_xpoints
(point_type, xpoints)[source]¶ Gets the SPOINTs/EPOINTs in sorted, short form.
uncompresed: SPOINT,1,3,5 compressed: SPOINT,1,3,5
uncompresed: SPOINT,1,2,3,4,5 compressed: SPOINT,1,THRU,5
uncompresed: SPOINT,1,2,3,4,5,7 compressed: SPOINT,7
SPOINT,1,THRU,5point_type = ‘SPOINT’ spoints = [1, 2, 3, 4, 5] fields = compressed_xpoints(point_type, spoints) >>> fields [‘SPOINT’, 1, ‘THRU’, 5]