bars Module

Inheritance diagram of pyNastran.bdf.cards.elements.bars
defines:
  • CBAR
  • CBARAO
  • BAROR
  • CBEAM3
  • CBEND
class pyNastran.bdf.cards.elements.bars.BAROR(pid, is_g0, g0, x, offt='GGG', comment='')[source]

Bases: pyNastran.bdf.cards.base_card.BaseCard

1 2 3 4 5 6 7 8 9
BAROR   PID     G0/X1 X2 X3 OFFT
BAROR   39     0.6 2.9 -5.87 GOG
classmethod _init_from_empty()[source]
classmethod add_card(card, comment='')[source]
raw_fields(self)[source]

Gets the fields of the card in their full form

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

Writes the card with the specified width and precision

Parameters:
size : int (default=8)

size of the field; {8, 16}

is_double : bool (default=False)

is this card double precision

Returns:
msg : str

the string representation of the card

class pyNastran.bdf.cards.elements.bars.CBAR(eid, pid, nids, x, g0, offt='GGG', pa=0, pb=0, wa=None, wb=None, comment='')[source]

Bases: pyNastran.bdf.cards.elements.bars.LineElement

1 2 3 4 5 6 7 8 9
CBAR EID PID GA GB X1 X2 X3 OFFT
  PA PB W1A W2A W3A W1B W2B W3B

or

1 2 3 4 5 6 7 8 9
CBAR EID PID GA GB G0     OFFT
  PA PB W1A W2A W3A W1B W2B W3B
1 2 3 4 5 6 7 8 9
CBAR 2 39 7 6 105     GGG
    513 0.0 0.0 -9. 0.0 0.0 -9.

Adds a CBAR card

Parameters:
pid : int

property id

mid : int

material id

nids : List[int, int]

node ids; connected grid points at ends A and B

x : List[float, float, float]

Components of orientation vector, from GA, in the displacement coordinate system at GA (default), or in the basic coordinate system

g0 : int

Alternate method to supply the orientation vector using grid point G0. Direction of is from GA to G0. is then transferred to End A

offt : str; default=’GGG’

Offset vector interpretation flag

pa / pb : int; default=0

Pin Flag at End A/B. Releases the specified DOFs

wa / wb : List[float, float, float]

Components of offset vectors from the grid points to the end points of the axis of the shear center

comment : str; default=’‘

a comment for the card

Area(self)[source]

returns the area of the element face

Centroid(self)[source]
G0(self)[source]

gets G0

Ga(self)[source]

gets Ga/G1

Gb(self)[source]

gets Gb/G2

I1(self)[source]
I2(self)[source]
J(self)[source]

returns the Polar Moment of Inertia, \(J\)

Length(self)[source]

Gets the length, \(L\), of the element.

\[L = \sqrt{ (n_{x2}-n_{x1})^2+(n_{y2}-n_{y1})^2+(n_{z2}-n_{z1})^2 }\]
Mid(self)[source]
Nsm(self)[source]

Placeholder method for the non-structural mass, \(nsm\)

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

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

Parameters:
card : BDFCard()

a BDFCard object

beamor : BAROR() or None

defines the defaults

comment : str; default=’‘

a comment for the card

center_of_mass(self)[source]
cross_reference(self, model)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

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

exports the elements in a vectorized way

get_edge_ids(self)[source]

Return the edge IDs

get_orientation_vector(self, xyz)[source]

Element offsets are defined in a Cartesian system located at the connecting grid point. The components of the offsets are always defined in units of translation, even if the displacement coordinate system is cylindrical or spherical.

For example, in Figure 11-11, the grid point displacement coordinate system is cylindrical, and the offset vector is defined using Cartesian coordinates u1, u2, and u3 in units of translation.

get_x_g0_defaults(self)[source]

X and G0 compete for the same fields, so the method exists to make it easier to write the card

Returns:
x_g0 : varies

g0 : List[int, None, None] x : List[float, float, float]

Notes

Used by CBAR and CBEAM

node_ids
nodes
nodes_ref
raw_fields(self)[source]

Gets the fields of the card in their full form

repr_fields(self)[source]

Gets the fields of the card in their reduced form

safe_cross_reference(self, model, xref_errors)[source]
type = 'CBAR'
uncross_reference(self)[source]

Removes cross-reference links

update_by_cp_name(self, cp_name, value)[source]
validate(self)[source]

card checking method that should be overwritten

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

Writes the card with the specified width and precision

Parameters:
size : int (default=8)

size of the field; {8, 16}

is_double : bool (default=False)

is this card double precision

Returns:
msg : str

the string representation of the card

write_card_16(self, is_double=False)[source]
class pyNastran.bdf.cards.elements.bars.CBARAO(eid, scale, x, comment='')[source]

Bases: pyNastran.bdf.cards.base_card.BaseCard

Per MSC 2016.1 +——–+——+——-+——+—–+——–+—–+—-+—-+ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | +========+======+=======+======+=====+========+=====+====+====+ | CBARAO | EID | SCALE | X1 | X2 | X3 | X4 | X5 | X6 | +——–+——+——-+——+—–+——–+—–+—-+—-+ | CBARAO | 1065 | FR | 0.2 | 0.4 | 0.6 | 0.8 | | | +——–+——+——-+——+—–+——–+—–+—-+—-+

Alternate form (not supported): +——–+——+——-+——+—–+——–+—–+—-+—-+ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | +========+======+=======+======+=====+========+=====+====+====+ | CBARAO | EID | SCALE | NPTS | X1 | DELTAX | | | | +——–+——+——-+——+—–+——–+—–+—-+—-+ | CBARAO | 1065 | FR | 4 | 0.2 | 0.2 | | | | +——–+——+——-+——+—–+——–+—–+—-+—-+

Creates a CBARAO card, which defines additional output locations for the CBAR card.

It also changes the OP2 element type from a CBAR-34 to a CBAR-100. However, it is ignored if there are no PLOAD1s in the model. Furthermore, the type is changed for the whole deck, regardless of whether there are PLOAD1s in the other load cases.

Parameters:
eid : int

element id

scale : str

defines what x means LE : x is in absolute coordinates along the bar FR : x is in fractional

x : List[float]

the additional output locations (doesn’t include the end points) len(x) <= 6

comment : str; default=’‘

a comment for the card

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

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

Parameters:
card : BDFCard()

a BDFCard object

comment : str; default=’‘

a comment for the card

raw_fields(self)[source]
repr_fields(self)[source]

Gets the fields in their simplified form

Returns:
fields : List[varies]

the fields that define the card

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

Writes the card with the specified width and precision

Parameters:
size : int (default=8)

size of the field; {8, 16}

is_double : bool (default=False)

is this card double precision

Returns:
msg : str

the string representation of the card

class pyNastran.bdf.cards.elements.bars.CBEAM3(eid, pid, nids, x, g0, wa=None, wb=None, wc=None, tw=None, s=None, comment='')[source]

Bases: pyNastran.bdf.cards.elements.bars.LineElement

Area(self)[source]

returns the area of the element face

Centroid(self)[source]
G0(self)[source]

gets the orientation vector node

Ga(self)[source]

gets node 1

Gb(self)[source]

gets node 2

Gc(self)[source]

gets the node between node 1 and 2

Length(self)[source]

We’ll fit a 2nd order polynomial to the x, y, and z coefficients. We know GA (t=0), GB(t=1), and GC (t=0.5 assumed). This gives us A, for:

  • y1 = a1*t^2 = b1*t + c1
where:
  • yi is for the x, y, and z terms

[xa, xb, xc] = [A][a1, b1, c1].T [ya, yb, yc] = [A][a2, b2, c2].T [za, zb, zc] = [A][a3, b3, c3].T

[a1, b1, c1] = [A^-1][[xa, xb, xc].T A = [0. , 0. , 1. ]

[1. , 1. , 1. ] [0.25, 0.5 , 1. ]
Ainv = [ 2., 2., -4.]
[-3., -1., 4.] [ 1., 0., 0.]
MassPerLength(self)[source]

Get the mass per unit length, :math:` rac{m}{L}`

Nsm(self)[source]

Placeholder method for the non-structural mass, \(nsm\)

Volume(self)[source]
classmethod _init_from_empty()[source]
_integrate(self, xabc, yabc, zabc)[source]
We integrate:
y = sqrt(x’(t)^2 + y’(t)^2 + z’(t)^2)*dt from 0 to 1 y = sqrt(r)
/where:
  • x(t) = a*t^2 + b*t + c
  • x’(t) = 2*a*t + b
  • x’(t)^2 = 4*(a*t)^2 + 2*a*b*t + b^2
expanding terms:
  • x’(t)^2 = 4*(a1*t)^2 + 2*a1*b1*t + b1^2
  • y’(t)^2 = 4*(a2*t)^2 + 2*a2*b2*t + b2^2
  • z’(t)^2 = 4*(a3*t)^2 + 2*a3*b3*t + b3^2
grouping terms:
  • a = 4 * (a1 ** 2 + a2 ** 2 + a3 ** 2) * t^2
  • b = 2 * (a1 * b1 + a2 * b2 + a3 * b3) * t
  • c = b1 ** 2 + b2 ** 2 + b3 ** 2
  • y = integrate(sqrt(a*t^2 + b*t + t), t, 0., 1.)

Looking up integral formulas, we get a really complicated integral.

for a = 0 (and rewriting):
  • y = integrate(sqrt(a*t + b), t, 0., 1.)
  • y = (2*b/3a + 2*t/3) * sqrt(at + b)
or:
  • y = (2*c/3b + 2*t/3) * sqrt(b*t + c)
_properties = ['node_ids', 'nodes']

Defines a three-node beam element

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

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

Parameters:
card : BDFCard()

a BDFCard object

comment : str; default=’‘

a comment for the card

center_of_mass(self)[source]
cross_reference(self, model)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

get_edge_ids(self)[source]

Return the edge IDs

get_x_g0_defaults(self)[source]

X and G0 compete for the same fields, so the method exists to make it easier to write the card

Returns:
x_g0 : varies

g0 : List[int, None, None] x : List[float, float, float]

Notes

Used by CBAR, CBEAM, and CBEAM3

node_ids
nodes
raw_fields(self)[source]
repr_fields(self)[source]

Gets the fields in their simplified form

Returns:
fields : List[varies]

the fields that define the card

safe_cross_reference(self, model, xref_errors)[source]
type = 'CBEAM3'
uncross_reference(self)[source]

Removes cross-reference links

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

Writes the card with the specified width and precision

Parameters:
size : int (default=8)

size of the field; {8, 16}

is_double : bool (default=False)

is this card double precision

Returns:
msg : str

the string representation of the card

class pyNastran.bdf.cards.elements.bars.CBEND(eid, pid, nids, g0, x, geom, comment='')[source]

Bases: pyNastran.bdf.cards.elements.bars.LineElement

Creates a CBEND card

Parameters:
eid : int

element id

pid : int

property id (PBEND)

nids : List[int, int]

node ids; connected grid points at ends A and B

g0 : int

???

x : List[float, float, float]

???

geom : int

1 : The center of curvature lies on the line AO (or its extension) or vector v. 2 : The tangent of centroid arc at end A is parallel to line AO or vector v.

Point O (or vector v) and the arc must be on the same side of the chord AB.

3 : The bend radius (RB) is specified on the PBEND entry:

Points A, B, and O (or vector v) define a plane parallel or coincident with the plane of the element arc. Point O (or vector v) lies on the opposite side of line AB from the center of the curvature.

4 : THETAB is specified on the PBEND entry. Points A, B, and O (or vector v)

define a plane parallel or coincident with the plane of the element arc. Point O (or vector v) lies on the opposite side of line AB from the center of curvature.

comment : str; default=’‘

a comment for the card

Area(self)[source]

returns the area of the element face

Centroid(self)[source]
Ga(self)[source]
Gb(self)[source]
Length(self)[source]

Gets the length, \(L\), of the element.

\[L = \sqrt{ (n_{x2}-n_{x1})^2+(n_{y2}-n_{y1})^2+(n_{z2}-n_{z1})^2 }\]
classmethod _init_from_empty()[source]
_properties = ['node_ids']
classmethod add_card(card, comment='')[source]

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

Parameters:
card : BDFCard()

a BDFCard object

comment : str; default=’‘

a comment for the card

center_of_mass(self)[source]
cross_reference(self, model)[source]

Cross links the card so referenced cards can be extracted directly

Parameters:
model : BDF()

the BDF object

get_x_g0_defaults(self)[source]
node_ids
nodes
nodes_ref
raw_fields(self)[source]
repr_fields(self)[source]

Gets the fields in their simplified form

Returns:
fields : List[varies]

the fields that define the card

safe_cross_reference(self, model, xref_errors)[source]
type = 'CBEND'
uncross_reference(self)[source]

Removes cross-reference links

validate(self)[source]

card checking method that should be overwritten

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

Writes the card with the specified width and precision

Parameters:
size : int (default=8)

size of the field; {8, 16}

is_double : bool (default=False)

is this card double precision

Returns:
msg : str

the string representation of the card

class pyNastran.bdf.cards.elements.bars.LineElement[source]

Bases: pyNastran.bdf.cards.base_card.Element

Area(self)[source]

returns the area of the element face

C(self)[source]

torsional constant

E(self)[source]

returns the Young’s Modulus, \(E\)

G(self)[source]

returns the Shear Modulus, \(G\)

I11(self)[source]

returns the Moment of Inertia, \(I_{11}\)

I12(self)[source]

returns the Moment of Inertia, \(I_{12}\)

I22(self)[source]

returns the Moment of Inertia, \(I_{22}\)

J(self)[source]

returns the Polar Moment of Inertia, \(J\)

Length(self)[source]

Gets the length, \(L\), of the element.

\[L = \sqrt{ (n_{x2}-n_{x1})^2+(n_{y2}-n_{y1})^2+(n_{z2}-n_{z1})^2 }\]
Mass(self)[source]

Get the mass of the element.

\[m = \left( \rho A + nsm \right) L\]
MassPerLength(self)[source]

Get the mass per unit length, :math:` rac{m}{L}`

Nsm(self)[source]

Placeholder method for the non-structural mass, \(nsm\)

Nu(self)[source]

Get Poisson’s Ratio, :math:` u`

Rho(self)[source]

Get the material density, :math:` ho`

get_edge_ids(self)[source]

Return the edge IDs

uncross_reference(self)[source]

Removes cross-reference links

pyNastran.bdf.cards.elements.bars.check_offt(element)[source]

B,G,O Note: The character ‘O’ in the table replaces the obsolete character ‘E’

pyNastran.bdf.cards.elements.bars.get_bar_vector(model, elem, node1, node2, xyz1)[source]

helper method for rotate_v_wa_wb

pyNastran.bdf.cards.elements.bars.get_bar_yz_transform(v, ihat, eid, xyz1, xyz2, nid1, nid2, i, Li)[source]

helper method for _get_bar_yz_arrays

Parameters:
v : List[float, float, float]

the projection vector that defines the y-axis (jhat)

ihat : (3, ) float ndarray

the normalized x-axis (not including the CBEAM offset)

eid : int

the element id

xyz1 / xyz2 : (3, ) float ndarray

the xyz locations for node 1 / 2

nid1 / nid2 : int

the node ids for xyz1 / xyz2

i : (3, ) float ndarray

the unnormalized x-axis (not including the CBEAM offset)

Li : float

the length of the CBAR/CBEAM (not including the CBEAM offset)

Returns:
yhat (3, ) float ndarray

the CBAR/CBEAM’s y-axis

zhat (3, ) float ndarray

the CBAR/CBEAM’s z-axis

pyNastran.bdf.cards.elements.bars.init_x_g0(card, eid, x1_default, x2_default, x3_default)[source]

common method to read the x/g0 field for the CBAR, CBEAM, CBEAM3

pyNastran.bdf.cards.elements.bars.init_x_g0_cbeam3(card, eid, x1_default, x2_default, x3_default)[source]

reads the x/g0 field for the CBEAM3

pyNastran.bdf.cards.elements.bars.rotate_v_wa_wb(model, elem, xyz1, xyz2, node1, node2, ihat_offset, i_offset, eid, Li_offset, log)[source]

Rotates v, wa, wb

Parameters:
model : BDF()

BDF : assume the model isn’t xref’d None : use the xref’d values

elem : CBAR() / CBEAM()

the CBAR/CBEAM

xyz1 / xyz2 : (3, ) float ndarray

the xyz locations for node 1 / 2

node1 / node2 : GRID()

the xyz object for node 1 / 2

ihat_offset : (3, ) float ndarray

the normalized x-axis (not including the CBEAM offset)

i_offset : (3, ) float ndarray

the unnormalized x-axis (not including the CBEAM offset)

eid : int

the element id

Li_offset : float

the length of the CBAR/CBEAM (not including the CBEAM offset)

log : Log()

a logging object or None

Returns:
v : List[float, float, float]

the projection vector that defines the y-axis (jhat)

wa : List[float, float, float]

the offset vector at A

wb : List[float, float, float]

the offset vector at B

xform : (3, 3) float ndarray

a vstack of the [ihat, jhat, khat] axes

Notes

This section details the OFFT flag.

ABC or A-B-C (an example is G-G-G or B-G-G) while the slots are:

  • A -> orientation; values=[G, B]
  • B -> End A; values=[G, O]
  • C -> End B; values=[G, O]
and the values for A,B,C mean:
  • B -> basic
  • G -> global
  • O -> orientation

so for example G-G-G, that’s global for all terms. BOG means basic orientation, orientation end A, global end B

so now we’re left with what does basic/global/orientation mean? - basic -> the global coordinate system defined by cid=0 - global -> the local coordinate system defined by the

CD field on the GRID card, but referenced by the CBAR/CBEAM
  • orientation -> wa/wb are defined in the xform_offset (yz) frame;
    this is likely the easiest frame for a user