bars
Module
digraph inheritancef8b99e8d07 {
bgcolor=transparent;
rankdir=LR;
size="";
"pyNastran.bdf.cards.base_card.BaseCard" [URL="../pyNastran.bdf.cards.base_card.html#pyNastran.bdf.cards.base_card.BaseCard",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Defines a series of base methods for every card class"];
"pyNastran.bdf.cards.base_card.Element" [URL="../pyNastran.bdf.cards.base_card.html#pyNastran.bdf.cards.base_card.Element",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="defines the Element class"];
"pyNastran.bdf.cards.base_card.BaseCard" -> "pyNastran.bdf.cards.base_card.Element" [arrowsize=0.5,style="setlinewidth(0.5)"];
"pyNastran.bdf.cards.elements.bars.BAROR" [URL="#pyNastran.bdf.cards.elements.bars.BAROR",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="+-------+---+-----+---+---+-------+-----+-------+------+"];
"pyNastran.bdf.cards.base_card.BaseCard" -> "pyNastran.bdf.cards.elements.bars.BAROR" [arrowsize=0.5,style="setlinewidth(0.5)"];
"pyNastran.bdf.cards.elements.bars.CBAR" [URL="#pyNastran.bdf.cards.elements.bars.CBAR",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="+-------+-----+-----+-----+-----+-----+-----+-----+------+"];
"pyNastran.bdf.cards.elements.bars.LineElement" -> "pyNastran.bdf.cards.elements.bars.CBAR" [arrowsize=0.5,style="setlinewidth(0.5)"];
"pyNastran.bdf.cards.elements.bars.CBARAO" [URL="#pyNastran.bdf.cards.elements.bars.CBARAO",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Per MSC 2016.1"];
"pyNastran.bdf.cards.base_card.BaseCard" -> "pyNastran.bdf.cards.elements.bars.CBARAO" [arrowsize=0.5,style="setlinewidth(0.5)"];
"pyNastran.bdf.cards.elements.bars.CBEAM3" [URL="#pyNastran.bdf.cards.elements.bars.CBEAM3",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"];
"pyNastran.bdf.cards.elements.bars.LineElement" -> "pyNastran.bdf.cards.elements.bars.CBEAM3" [arrowsize=0.5,style="setlinewidth(0.5)"];
"pyNastran.bdf.cards.elements.bars.CBEND" [URL="#pyNastran.bdf.cards.elements.bars.CBEND",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"];
"pyNastran.bdf.cards.elements.bars.LineElement" -> "pyNastran.bdf.cards.elements.bars.CBEND" [arrowsize=0.5,style="setlinewidth(0.5)"];
"pyNastran.bdf.cards.elements.bars.LineElement" [URL="#pyNastran.bdf.cards.elements.bars.LineElement",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"];
"pyNastran.bdf.cards.base_card.Element" -> "pyNastran.bdf.cards.elements.bars.LineElement" [arrowsize=0.5,style="setlinewidth(0.5)"];
}
- defines:
CBAR
CBARAO
BAROR
CBEAM3
CBEND
- class pyNastran.bdf.cards.elements.bars.BAROR(pid, is_g0, g0, x, offt='GGG', comment='')[source]
Bases:
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
- type = 'BAROR'
- 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:
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:
- pidint
property id
- midint
material id
- nidslist[int, int]
node ids; connected grid points at ends A and B
- xlist[float, float, float]
Components of orientation vector, from GA, in the displacement coordinate system at GA (default), or in the basic coordinate system
- g0int
Alternate method to supply the orientation vector using grid point G0. Direction of is from GA to G0. is then transferred to End A
- offtstr; default=’GGG’
Offset vector interpretation flag
- pa / pbint; default=0
Pin Flag at End A/B. Releases the specified DOFs
- wa / wblist[float, float, float]
Components of offset vectors from the grid points to the end points of the axis of the shear center
- commentstr; default=’’
a comment for the card
- Length()[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 add_card(card, baror=None, comment='')[source]
Adds a CBAR card from
BDF.add_card(...)
- Parameters:
- cardBDFCard()
a BDFCard object
- beamorBAROR() or None
defines the defaults
- commentstr; default=’’
a comment for the card
- cross_reference(model: BDF) None [source]
Cross links the card so referenced cards can be extracted directly
- Parameters:
- modelBDF()
the BDF object
- get_axes(model: BDF) tuple[bool, Any] [source]
Gets the axes of a CBAR/CBEAM, while respecting the OFFT flag.
- Returns:
- is_passed: bool
flag
- out: (v, ihat, jhat, khat, wa, wb)
data
Notes
pyNastran.bdf.cards.elements.bars.rotate_v_wa_wb()
for a description of the OFFT flag.
- get_axes_by_nodes(model: BDF, node1: GRID, node2: GRID, xyz1: np.ndarray, xyz2: np.ndarray, log: SimpleLogger) tuple[bool, Any] [source]
Gets the axes of a CBAR/CBEAM, while respecting the OFFT flag.
Notes
pyNastran.bdf.cards.elements.bars.rotate_v_wa_wb()
for a description of the OFFT flag.
- get_orientation_vector(model: BDF)[source]
Gets the axes of a CBAR/CBEAM, while respecting the OFFT flag.
Notes
pyNastran.bdf.cards.elements.bars.rotate_v_wa_wb()
for a description of the OFFT flag.
- get_x_g0_defaults()[source]
X and G0 compete for the same fields, so the method exists to make it easier to write the card
- Returns:
- x_g0varies
g0 : list[int, None, None] x : list[float, float, float]
Notes
Used by CBAR and CBEAM
- property node_ids
- property nodes
- property nodes_ref
- type = 'CBAR'
- class pyNastran.bdf.cards.elements.bars.CBARAO(eid, scale, x, comment='')[source]
Bases:
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:
- eidint
element id
- scalestr
defines what x means LE : x is in absolute coordinates along the bar FR : x is in fractional
- xlist[float]
the additional output locations (doesn’t include the end points) len(x) <= 6
- commentstr; default=’’
a comment for the card
- MSC only
- classmethod add_card(card, comment='')[source]
Adds a CBARAO card from
BDF.add_card(...)
- Parameters:
- cardBDFCard()
a BDFCard object
- commentstr; default=’’
a comment for the card
- repr_fields()[source]
Gets the fields in their simplified form
- Returns:
- fieldslist[varies]
the fields that define the card
- type = 'CBARAO'
- 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:
LineElement
dummy init
- Length()[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.]
- _integrate(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:
- cardBDFCard()
a BDFCard object
- commentstr; default=’’
a comment for the card
- cross_reference(model: BDF) None [source]
Cross links the card so referenced cards can be extracted directly
- Parameters:
- modelBDF()
the BDF object
- get_x_g0_defaults()[source]
X and G0 compete for the same fields, so the method exists to make it easier to write the card
- Returns:
- x_g0varies
g0 : list[int, None, None] x : list[float, float, float]
Notes
Used by CBAR, CBEAM, and CBEAM3
- property node_ids
- property nodes
- repr_fields()[source]
Gets the fields in their simplified form
- Returns:
- fieldslist[varies]
the fields that define the card
- type = 'CBEAM3'
- class pyNastran.bdf.cards.elements.bars.CBEND(eid, pid, nids, g0, x, geom, comment='')[source]
Bases:
LineElement
Creates a CBEND card
- Parameters:
- eidint
element id
- pidint
property id (PBEND)
- nidslist[int, int]
node ids; connected grid points at ends A and B
- g0int
???
- xlist[float, float, float]
???
- geomint
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.
- 3The 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.
- 4THETAB 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.
- commentstr; default=’’
a comment for the card
- Length()[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 }\]
- _properties = ['node_ids']
- classmethod add_card(card, comment='')[source]
Adds a CBEND card from
BDF.add_card(...)
- Parameters:
- cardBDFCard()
a BDFCard object
- commentstr; default=’’
a comment for the card
- cross_reference(model: BDF) None [source]
Cross links the card so referenced cards can be extracted directly
- Parameters:
- modelBDF()
the BDF object
- property node_ids
- property nodes
- property nodes_ref
- repr_fields()[source]
Gets the fields in their simplified form
- Returns:
- fieldslist[varies]
the fields that define the card
- type = 'CBEND'
- class pyNastran.bdf.cards.elements.bars.LineElement[source]
Bases:
Element
dummy init
- pyNastran.bdf.cards.elements.bars.check_offt(element)[source]
B,G,O Note: The character ‘O’ in the table replaces the obsolete character ‘E’ allowed = ‘GGG,BGG,GGO,BGO,GOG,BOG,GOO,BOO,GGE,BGE,GEG,BEG,GEE,BEE,GGB,BGB,GBG,BBG,GBB,BBB,B’
- pyNastran.bdf.cards.elements.bars.get_bar_vector(model: BDF, elem: CBAR | CBEAM, node1: GRID, node2: GRID, xyz1: np.ndarray) tuple[np.ndarray, int, Coord, int, Coord] [source]
helper method for
rotate_v_wa_wb
- pyNastran.bdf.cards.elements.bars.get_bar_yz_transform(v: ndarray, ihat: ndarray, eid: int, xyz1: ndarray, xyz2: ndarray, nid1: int, nid2: int, i: ndarray, Li: float) tuple[ndarray, ndarray] [source]
helper method for
_get_bar_yz_arrays
- Parameters:
- vlist[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)
- eidint
the element id
- xyz1 / xyz2(3, ) float ndarray
the xyz locations for node 1 / 2
- nid1 / nid2int
the node ids for xyz1 / xyz2
- i(3, ) float ndarray
the unnormalized x-axis (not including the CBEAM offset)
- Lifloat
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: BDF, elem, xyz1: np.ndarray, xyz2: np.ndarray, node1: GRID, node2: GRID, ihat_offset: np.ndarray, i_offset: np.ndarray, eid: int, Li_offset: float, log: SimpleLogger) tuple[NDArray3float, NDArray3float, NDArray3float, NDArray33float] [source]
Rotates v, wa, wb
- Parameters:
- modelBDF()
BDF : assume the model isn’t xref’d None : use the xref’d values
- elemCBAR() / CBEAM()
the CBAR/CBEAM
- xyz1 / xyz2(3, ) float ndarray
the xyz locations for node 1 / 2
- node1 / node2GRID()
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)
- eidint
the element id
- Li_offsetfloat
the length of the CBAR/CBEAM (not including the CBEAM offset)
- logLog()
a logging object or None
- Returns:
- vlist[float, float, float]
the projection vector that defines the y-axis (jhat)
- walist[float, float, float]
the offset vector at A
- wblist[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