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:
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

create_epointi(self)[source]

Creates individal EPOINT objects

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

Cd(self)[source]

Gets the output coordinate system

Returns:
cd : int

the output coordinate system

Cp(self)[source]

Gets the analysis coordinate system

Returns:
cp : int

the analysis coordinate system

Ps(self)[source]

Gets the GRID-based SPC

Returns:
ps : str

the GRID-based SPC

SEid(self)[source]

Gets the Superelement ID

Returns:
seid : int

the Superelement ID

classmethod _init_from_empty()[source]
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'
uncross_reference(self)[source]

Removes cross-reference links

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)

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

Cd(self)[source]

Gets the output coordinate system

Returns:
cd : int

the output coordinate system

Cp(self)[source]

Gets the analysis coordinate system

Returns:
cp : int

the analysis coordinate system

Nid(self)[source]

Gets the GRID ID

Returns:
nid : int

node ID

Ps(self)[source]

Gets the GRID-based SPC

Returns:
ps : str

the GRID-based SPC

SEid(self)[source]

Gets the Superelement ID

Returns:
seid : int

the Superelement ID

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

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

exports the nodes in a vectorized way

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_no_xref(self, model)[source]
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

get_position_wrt_no_xref(self, model, cid)[source]

see get_position_wrt

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'
uncross_reference(self)[source]
validate(self)[source]

card checking method that should be overwritten

write_card(self, size=8, is_double=False)[source]

The writer method used by BDF.write_card

Parameters:
size : int; default=8

the size of the card (8/16)

is_double : bool; default=False

should this card be written with double precision

Returns:
msg : str

the card as a string

write_card_16(self, is_double=False)[source]

Writes a GRID card in 16-field format

write_card_8(self)[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(self)[source]

Gets the output coordinate system

Returns:
cd : int

the output coordinate system

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

get_position(self)[source]
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'
write_card(self, size=8, is_double=False)[source]

The writer method used by BDF.write_card

Parameters:
size : int; default=8

the size of the card (8/16)

is_double : bool; default=False

should this card be written with double precision

Returns:
msg : str

the card as a string

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 _init_from_empty()[source]
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'
uncross_reference(self)[source]
validate(self)[source]

card checking method that should be overwritten

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 _init_from_empty()[source]
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

append(self, seqgp)[source]
cross_reference(self, model)[source]
raw_fields(self)[source]

Gets the fields in their unmodified form

Returns:
fields : List[varies]

the fields that define the card

type = 'SEQGP'
write_card(self, size=8, is_double=False)[source]

The writer method used by BDF.write_card

Parameters:
size : int; default=8

unused

is_double : bool; 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:
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

create_spointi(self)[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, nids)[source]

exports the nodes in a vectorized way

classmethod _init_from_empty()[source]
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

write_card(self, size=8, is_double=False)[source]

The writer method used by BDF.write_card

Parameters:
size : int; default=8

unused

is_double : bool; 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:
card : BDFCard()

a BDFCard object

comment : str; default=’‘

a comment for the card

add_points(self, sList)[source]

Adds more EPOINTs/SPOINTs to this object

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

write_card(self, size=8, is_double=False)[source]

The writer method used by BDF.write_card

Parameters:
size : int; default=8

unused

is_double : bool; default=False

unused

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,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, points, comment='')[source]

writes SPOINTs/EPOINTs