nodes Module

Inheritance diagram of pyNastran.bdf.cards.nodes

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
nidint

the EPOINT id

commentstr; 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
idsList[int]

EPOINT ids

commentstr; default=’’

a comment for the card

create_epointi()[source]

Creates individal EPOINT objects

type = 'EPOINT'
class pyNastran.bdf.cards.nodes.GRDSET(cp: int, cd: int, ps: str, seid: int, comment: str = '')[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
cpint; default=0

the xyz coordinate frame

cdint; default=0

the analysis coordinate frame

psstr; default=’’

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

seidint; default=0

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

commentstr; default=’’

a comment for the card

Cd()[source]

Gets the output coordinate system

Returns
cdint

the output coordinate system

Cp()[source]

Gets the analysis coordinate system

Returns
cpint

the analysis coordinate system

Ps()[source]

Gets the GRID-based SPC

Returns
psstr

the GRID-based SPC

SEid()[source]

Gets the Superelement ID

Returns
seidint

the Superelement ID

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

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

Parameters
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

cd = None

Analysis coordinate system

cp = None

Output Coordinate System

cross_reference(model: BDF) → None[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

ps = None

Default SPC constraint on undefined nodes

raw_fields()[source]

Gets the fields in their unmodified form

Returns
fieldsList[varies]

the fields that define the card

repr_fields()[source]

Gets the fields in their simplified form

Returns
fieldsList[varies]

the fields that define the card

seid = None

Superelement ID

type = 'GRDSET'
uncross_reference() → None[source]

Removes cross-reference links

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

The writer method used by BDF.write_card

Parameters
sizeint

the size of the card (8/16)

class pyNastran.bdf.cards.nodes.GRID(nid: int, xyz: Union[None, List[float], numpy.ndarray], cp: int = 0, cd: int = 0, ps: str = '', seid: int = 0, comment: str = '')[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
nidint

node id

xyzfloat ndarray

Raw location <\(x_1, x_2, x_3\)>

cpint

reference coordinate system

cdint

analysis coordinate system

psstr

nodal-based constraints

seidint

superelement id

cp_refCoord() or None

cross-referenced cp

cd_refCoord() 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
nidint

node id

cpint; default=0

the xyz coordinate frame

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

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

cdint; default=0

the analysis coordinate frame

psstr; default=’’

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

seidint; default=0

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

commentstr; default=’’

a comment for the card

Cd() → int[source]

Gets the output coordinate system

Returns
cdint

the output coordinate system

Cp() → int[source]

Gets the analysis coordinate system

Returns
cpint

the analysis coordinate system

Nid() → int[source]

Gets the GRID ID

Returns
nidint

node ID

Ps() → str[source]

Gets the GRID-based SPC

Returns
psstr

the GRID-based SPC

SEid() → int[source]

Gets the Superelement ID

Returns
seidint

the Superelement ID

classmethod add_card(card: BDFCard, comment: str = '') → Any[source]

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

Parameters
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

cross_reference(model: BDF, grdset: Optional[Any] = None) → None[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

grdsetGRDSET / None; default=None

a GRDSET if available (default=None)

.. note:: The gridset object will only update the fields that

have not been set

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

exports the nodes in a vectorized way

get_position() → numpy.ndarray[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() → NDArray3float[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_no_xref(model: Any) → numpy.ndarray[source]
get_position_wrt(model: BDF, cid: int) → np.ndarray[source]

Gets the location of the GRID which started in some arbitrary system and returns it in the desired coordinate system

Parameters
modelBDF()

the BDF object

cidint

the desired coordinate ID

Returns
xyz(3, ) float ndarray

the position of the GRID in an arbitrary coordinate system

get_position_wrt_coord_ref(coord_out: CORDx) → np.ndarray[source]

Gets the location of the GRID which started in some arbitrary system and returns it in the desired coordinate system

Parameters
coord_outCORDx

the desired coordinate system

Returns
xyz(3, ) float ndarray

the position of the GRID in an arbitrary coordinate system

get_position_wrt_no_xref(model: BDF, cid: int) → NDArray3float[source]

see get_position_wrt

raw_fields() → List[Any][source]

Gets the fields in their unmodified form

Returns
fieldsList[int/float/str]

the fields that define the card

repr_fields() → List[Any][source]

Gets the fields in their simplified form

Returns
fieldsList[int/float/str]

the fields that define the card

set_position(model: BDF, xyz: np.ndarray, cid: int = 0, xref: bool = True) → None[source]

Updates the GRID location

Parameters
xyz(3, ) float ndarray

the location of the node.

cpint; default=0 (global)

the analysis coordinate system

xrefbool; default=True

cross-references the coordinate system

type = 'GRID'
uncross_reference() → None[source]

Removes cross-reference links

validate() → None[source]

card checking method that should be overwritten

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

The writer method used by BDF.write_card

Parameters
sizeint; default=8

the size of the card (8/16)

is_doublebool; default=False

should this card be written with double precision

Returns
msgstr

the card as a string

write_card_16(is_double: bool = False) → str[source]

Writes a GRID card in 16-field format

write_card_8() → str[source]

Writes a GRID card in 8-field format

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

Cd()[source]

Gets the output coordinate system

Returns
cdint

the output coordinate system

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

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

Parameters
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

get_position()[source]
nid = None

node ID

ps = None

local SPC constraint

raw_fields()[source]

Gets the fields in their unmodified form

Returns
fieldsList[varies]

the fields that define the card

repr_fields()[source]

Gets the fields in their simplified form

Returns
fieldsList[varies]

the fields that define the card

ringfl = None

ringfl

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

The writer method used by BDF.write_card

Parameters
sizeint; default=8

the size of the card (8/16)

is_doublebool; default=False

should this card be written with double precision

Returns
msgstr

the card as a string

class pyNastran.bdf.cards.nodes.POINT(nid: int, xyz: Union[List[float], numpy.ndarray], cp: int = 0, comment: str = '')[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
nidint

node id

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

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

cpint; default=0

coordinate system for the xyz location

commentstr; default=’’

a comment for the card

Cp() → int[source]

Gets the analysis coordinate system

Returns
cpint

the analysis coordinate system

classmethod _init_from_empty()[source]
classmethod add_card(card: BDFCard, comment: str = '') → POINT[source]

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

Parameters
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

cp = None

Grid point coordinate system

cross_reference(model: BDF) → None[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

get_position() → NDArray3float[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(model, cid)[source]

Gets the location of the POINT which started in some arbitrary system and returns it in the desired coordinate system

Parameters
modelBDF()

the BDF model object

cidint

the desired coordinate ID

Returns
xyz(3,) ndarray

the position of the POINT in an arbitrary coordinate system

nid = None

Node ID

raw_fields() → List[Union[int, float, str, None]][source]

Gets the fields in their unmodified form

Returns
fieldslist[varies]

the fields that define the card

repr_fields() → List[Union[int, float, str]][source]

Gets the fields in their simplified form

Returns
fieldslist[varies]

the fields that define the card

set_position(model, xyz, cid=0)[source]

Updates the POINT location

Parameters
xyz(3,) float ndarray

the location of the node

cpint; default=0 (global)

the analysis coordinate system

type = 'POINT'
uncross_reference() → None[source]

Removes cross-reference links

validate() → None[source]

card checking method that should be overwritten

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

The writer method used by BDF.write_card

Parameters
sizeint

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
nidint

the node id

seqidint/float

the superelement id

commentstr; default=’’

a comment for the card

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

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

Parameters
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

append(seqgp)[source]
cross_reference(model: BDF) → None[source]
raw_fields()[source]

Gets the fields in their unmodified form

Returns
fieldsList[varies]

the fields that define the card

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

The writer method used by BDF.write_card

Parameters
sizeint; default=8

unused

is_doublebool; default=False

unused

class pyNastran.bdf.cards.nodes.SPOINT(nid, comment='')[source]

Bases: pyNastran.bdf.cards.nodes.XPoint

defines the SPOINT class

Creates the SPOINT card

Parameters
nidint

the SPOINT id

commentstr; default=’’

a comment for the card

get_position()[source]
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
idsList[int]

SPOINT ids

commentstr; default=’’

a comment for the card

create_spointi()[source]

Creates individal SPOINT objects

type = 'SPOINT'
class pyNastran.bdf.cards.nodes.XPoint(nid, comment)[source]

Bases: pyNastran.bdf.cards.base_card.BaseCard

common class for EPOINT/SPOINT

classmethod _export_to_hdf5(h5_file, model: BDF, nids: List[int]) → None[source]

exports the nodes in a vectorized way

classmethod _init_from_empty()[source]
cross_reference(model: BDF) → None[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

raw_fields()[source]

Gets the fields in their unmodified form

Returns
fieldsList[varies]

the fields that define the card

property type

dummy method for EPOINT/SPOINT classes

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

The writer method used by BDF.write_card

Parameters
sizeint; default=8

unused

is_doublebool; default=False

unused

class pyNastran.bdf.cards.nodes.XPoints(ids, comment='')[source]

Bases: pyNastran.bdf.cards.base_card.BaseCard

common class for EPOINTs and SPOINTs

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

Adds a SPOINT/EPOINT card from BDF.add_card(...)

Parameters
cardBDFCard()

a BDFCard object

commentstr; default=’’

a comment for the card

add_points(sList)[source]

Adds more EPOINTs/SPOINTs to this object

cross_reference(model: BDF) → None[source]

Cross links the card so referenced cards can be extracted directly

Parameters
modelBDF()

the BDF object

raw_fields()[source]

Gets the fields in their unmodified form

Returns
fieldsList[varies]

the fields that define the card

property type

dummy method for EPOINTs/SPOINTs classes

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

The writer method used by BDF.write_card

Parameters
sizeint; default=8

unused

is_doublebool; default=False

unused

pyNastran.bdf.cards.nodes.compress_xpoints(point_type: str, xpoints: List[int]) → List[List[int]][source]

Gets the SPOINTs/EPOINTs in sorted, short form.

uncompressed: SPOINT,1,3,5 compressed: SPOINT,1,3,5

uncompressed: SPOINT,1,2,3,4,5 compressed: SPOINT,1,THRU,5

uncompressed: SPOINT,1,2,3,4,5,7 compressed: SPOINT,7

SPOINT,1,THRU,5

point_type = ‘SPOINT’ spoints = [1, 2, 3, 4, 5] fields = compressed_xpoints(point_type, spoints) >>> fields [‘SPOINT’, 1, ‘THRU’, 5]

pyNastran.bdf.cards.nodes.write_xpoints(cardtype: str, points, comment: str = '') → str[source]

writes SPOINTs/EPOINTs