BeamLR - Linear Timoshenko 3D beam element with reduced integration (pyfe3d.beamlr)#

Defines the two-node beam element BeamLR, with six degrees-of-freedom per node, its probe BeamLRProbe and BeamLRData, which gives the number of sparse entries per element of each structural matrix. The cross-section and material properties are given by a BeamProp object.

class pyfe3d.beamlr.BeamLR#

Timoshenko 3D beam element with linear shape functions

Nodal connectivity for the beam element:

^ y axis
|
|
______   --> x axis
1    2

The constructor stores p in probe, sets eid, pid, n1, n2, c1 and c2 to -1, and sets the init_k_* positions, length, vxyi, vxyj, vxyk and the rotation matrix to 0. The methods use the attributes updated by the others: update_rotation_matrix() reads c1 and c2; update_probe_xe() reads the rotation matrix and updates length; the update_K*, update_M() and update_probe_finte() methods read length and the rotation matrix; update_KG(), update_KCNL() and update_probe_finte() also read probe.ue, updated by update_probe_ue().

Parameters:
pBeamLRProbe object

Probe of the element, stored in probe. It can be shared with other elements.

Attributes:
eid,int

Element identification number.

pid,int

Property identification number.

length,double

Element length, dimension length. Updated by update_length().

r11, r12, r13, r21, r22, r23, r31, r32, r33double

Entries \(T_{ij}\) of the transformation matrix \(\boldsymbol{T}_{3\times 3}\) from element to global coordinates, whose columns are the element axes. Dimensionless.

vxyi, vxyj, vxykdouble

Components of a vector on the \(XY\) plane of the element coordinate system, defined using global coordinates. Only the direction of the vector is used.

c1, c2int

Position of each node in the global stiffness matrix, i.e. of the first of its 6 degrees-of-freedom. The coordinates of the node are read from the position c1//2 or c2//2 of the array of nodal coordinates.

n1, n2int

Node identification number.

init_k_KC0, init_k_KCNL, init_k_KG, init_k_Mint

Position in the arrays storing the sparse data for the structural matrices, where the entries of this element start, see BeamLRData for their number.

probeBeamLRProbe object

probe: pyfe3d.beamlr.BeamLRProbe

Methods

update_KC0(self, long[, long[, double[, ...)

Update sparse vectors for linear constitutive stiffness matrix KC0

update_KCNL(self, long[, long[, double[, ...)

Update sparse vectors for the nonlinear stiffness matrix KCNL

update_KG(self, long[, long[, double[, ...)

Update sparse vectors for geometric stiffness matrix KG

update_M(self, long[, long[, double[, ...)

Update sparse vectors for mass matrix M

update_fint(self, double[, BeamProp prop, ...)

Update the internal force vector

update_length(self)

Update element length

update_probe_finte(self, BeamProp prop, ...)

Update the internal force vector of the probe

update_probe_ue(self, double[)

Update the local displacement vector of the probe of the element

update_probe_xe(self, double[)

Update the 3D coordinates of the probe of the element

update_rotation_matrix(self, double vxyi, ...)

Update the rotation matrix of the element

Notes

Formulation based on reference [1], replacing the consistent shape functions by linear functions and performing numerical integration with just 1 point at the beam center.

The displacements of the cross section, the strains and the linear strain energy are those given in the notes of BeamC, with the sectional stiffness matrix C of BeamProp, which is built from the transverse shear moduli G12 and G13 of the planes \(xy\) and \(xz\), the torsional stiffness GJ and the other attributes when it is not set; it must be positive semi-definite, see BeamProp. The six displacements \(u, v, w, r_x, r_y, r_z\) of the beam axis are interpolated linearly between the two nodes, such that the axial strain \(u_{,x}\), the curvatures \(\kappa_y = -{r_z}_{,x}\), \(\kappa_z = {r_y}_{,x}\) and the twist \({r_x}_{,x}\) are constant along the element, while the transverse shear strains \(\gamma_{xy} = v_{,x} - r_z\) and \(\gamma_{xz} = w_{,x} + r_y\) are linear. The strain energy is evaluated at the center of the element, i.e. with a reduced one-point integration, \(\boldsymbol{K}_{C0} = L \boldsymbol{B}_L^\top \boldsymbol{C} \boldsymbol{B}_L\) with the strain-displacement matrix \(\boldsymbol{B}_L\) at the center, which is exact for the terms of the constant strains and avoids the shear locking of the linear interpolation in slender elements. The interpolation does not depend on C, and every coupling of C, e.g. the bending-shear couplings of a composite section, is represented with the same convergence as the square of the element length as an uncoupled section, see the notes of BeamC and tests/test_beam_sectional_stiffness.py. Since the curvature is constant in each element, more elements are needed than with BeamC for the same accuracy in bending.

The element does not use the shear parameters \(\alpha_y\), \(\alpha_z\) of BeamC, and is therefore an independent check of their sign: in tests/test_timoshenko_beam_literature.py refined meshes of BeamLR converge to the same cantilever tip deflection \(P L^3/(3 E I_{zz}) + P L/(G A)\), Eq. (1.2) of [2], as one element of BeamC, and to the same exact frequencies of a deep cantilever, Table 3.6 of [3]; in tests/test_beam_shear_moduli.py they do so in each plane with its own modulus when G12 and G13 differ.

The geometric stiffness matrix of update_KG(), the nonlinear matrix of update_KCNL() and the nonlinear internal forces of update_probe_finte() come from the von Kármán axial strain \(\epsilon_{xx} = u_{,x} + (v_{,x}^2 + w_{,x}^2)/2\), whose slopes \(v_{,x}\) and \(w_{,x}\) are taken from the linear interpolations of \(v\) and \(w\), as the axial strain requires and as in BeamC. They are constant along the element, and the geometric stiffness matrix is that of a string, \(N/L\) times [[1, -1], [-1, 1]] for \(v\) and for \(w\). Slopes taken from the rotations, \(v_{,x} = r_z\) and \(w_{,x} = -r_y\), would hold only without shear deformation: the buckling mode could then deflect with vanishing shear strains, and the buckling load would converge to the Euler load \(P_e\) whatever the shear stiffness \(\kappa G A\), instead of \(P_e/(1 + P_e/(\kappa G A))\), Eq. (2-57) of [4]. For a clamped-free column with \(P_e/(\kappa G A)\) = 0.0002, 0.018, 0.18 and 0.59, \(P_{cr}/P_e\) is 0.9998, 0.9825, 0.8488 and 0.6274 with 160 elements, as from Eq. (2-57), converging to Eq. (2-57) as the square of the element length, see tests/test_beam_linear_buckling_3D_column.py. For \(P_e/(\kappa G A) = 0.0002\), the load is 4.1e-3 and 1.0e-3 above Eq. (2-57) with 10 and 20 elements. With constant slopes the axial strain \(u_{,x} + w_{,x}^2/2\) can vanish in each element, so BeamLR is free of membrane locking; BeamC avoids it with the element-averaged axial strain described in its notes, see tests/test_nonlinear_benchmarks_sze2004.py.

The matrices and the internal forces are computed in element coordinates and transformed to global coordinates with the rotation matrix of the element, as described in the notes of BeamC.

References

[1]

Luo, Y., 2008, “An Efficient 3D Timoshenko Beam Element with Consistent Shape Functions,” Adv. Theor. Appl. Mech., 1(3), pp. 95–106.

[2]

Bathe, K. J., 2014, Finite Element Procedures, 2nd ed., K. J. Bathe, Watertown, MA, ISBN 978-0-9790049-5-7, Section 1.2, p. 5, Eq. (1.2), Fig. 1.2(b).

[3]

Petyt, M., 2010, Introduction to Finite Element Vibration Analysis, 2nd ed., Cambridge University Press, Section 3.9. https://doi.org/10.1017/CBO9780511761195

[4]

Timoshenko, S. P., Gere, J. M., 1961, Theory of Elastic Stability, 2nd ed., McGraw-Hill, Section 2.17, p. 133, Eq. (2-57).

Examples

Linear stiffness matrix of one element of length 2 along \(x\):

>>> import numpy as np
>>> from scipy.sparse import coo_matrix
>>> from pyfe3d import BeamLR, BeamLRData, BeamLRProbe, DOF, INT, DOUBLE
>>> from pyfe3d.beamprop import BeamProp
>>> prop = BeamProp()
>>> prop.A, prop.E, prop.G = 0.0025, 203e9, 78e9
>>> prop.Iyy = prop.Izz = 0.05**4/12
>>> prop.J = prop.Iyy + prop.Izz
>>> x = np.array([0., 0., 0., 2., 0., 0.])
>>> data, probe = BeamLRData(), BeamLRProbe()
>>> beam = BeamLR(probe)
>>> beam.c1, beam.c2 = 0, DOF
>>> beam.update_rotation_matrix(0., 1., 0., x)
>>> beam.update_probe_xe(x)
>>> KC0r = np.zeros(data.KC0_SPARSE_SIZE, dtype=INT)
>>> KC0c = np.zeros(data.KC0_SPARSE_SIZE, dtype=INT)
>>> KC0v = np.zeros(data.KC0_SPARSE_SIZE, dtype=DOUBLE)
>>> beam.update_KC0(KC0r, KC0c, KC0v, prop)
>>> KC0 = coo_matrix((KC0v, (KC0r, KC0c)), shape=(2*DOF, 2*DOF)).toarray()
>>> KC0.shape
(12, 12)
>>> float(KC0[0, 0])
253750000.0
c1#

c1: ‘int’

c2#

c2: ‘int’

eid#

eid: ‘int’

init_k_KC0#

init_k_KC0: ‘int’

init_k_KCNL#

init_k_KCNL: ‘int’

init_k_KG#

init_k_KG: ‘int’

init_k_M#

init_k_M: ‘int’

length#

length: ‘double’

n1#

n1: ‘int’

n2#

n2: ‘int’

pid#

pid: ‘int’

probe#

probe: pyfe3d.beamlr.BeamLRProbe

r11#

r11: ‘double’

r12#

r12: ‘double’

r13#

r13: ‘double’

r21#

r21: ‘double’

r22#

r22: ‘double’

r23#

r23: ‘double’

r31#

r31: ‘double’

r32#

r32: ‘double’

r33#

r33: ‘double’

update_KC0(self, long[: :1] KC0r, long[: :1] KC0c, double[: :1] KC0v, BeamProp prop, int update_KC0v_only=0) → void#

Update sparse vectors for linear constitutive stiffness matrix KC0

The 144 entries of the matrix of the element, in global coordinates, are written at the positions init_k_KC0 to init_k_KC0 + 143: the row and column indices, built from c1 and c2, are stored in KC0r and KC0c, and the values are added to those already in KC0v. The matrix is computed from length, the rotation matrix and the sectional stiffness matrix C of prop, see BeamProp. length and the rotation matrix must be updated before, see update_rotation_matrix() and update_probe_xe().

Parameters:
KC0rnp.array

Array to store row positions of sparse values. 1-D array of integers of the C type long, of size at least init_k_KC0 + 144.

KC0cnp.array

Array to store column positions of sparse values. Same type and size as KC0r.

KC0vnp.array

Array to store sparse values. 1-D array of floats of size at least init_k_KC0 + 144.

propBeamProp object

Beam property object from where the stiffness and mass attributes are read from.

update_KC0v_onlyint, optional

The default 0 means that the row and column indices KC0r and KC0c should also be updated. Any other value will only update the stiffness matrix values KC0v.

Notes

KC0 is the Hessian, with respect to the element displacements ue, of the linear strain energy given in the notes of BeamC, with the linear shape functions and the integration described in the notes of BeamLR, transformed to global coordinates with the rotation matrix of the element.

update_KCNL(self, long[: :1] KCNLr, long[: :1] KCNLc, double[: :1] KCNLv, BeamProp prop, int update_KCNLv_only=0) → void#

Update sparse vectors for the nonlinear stiffness matrix KCNL

The matrix, evaluated at the displacements probe.ue, is computed from length, the rotation matrix and the attributes of prop read by _update_probe_KCNLve(). The tangent stiffness matrix of the internal forces of update_fint() with nonlinear=1 is KC0 + KCNL + KG, see update_KC0() and update_KG().

Before this function is called, the probe BeamLRProbe attribute of the BeamLR object must be updated using update_probe_ue() with the current displacements; and update_probe_xe() with the node coordinates.

The 144 entries of the matrix of the element, in global coordinates, are written at the positions init_k_KCNL to init_k_KCNL + 143: the row and column indices, built from c1 and c2, are stored in KCNLr and KCNLc, and the values are added to those already in KCNLv. The matrix in element coordinates is also stored in probe.KCNLve, overwriting it.

Parameters:
KCNLrnp.array

Array to store row positions of sparse values. 1-D array of integers of the C type long, of size at least init_k_KCNL + 144.

KCNLcnp.array

Array to store column positions of sparse values. Same type and size as KCNLr.

KCNLvnp.array

Array to store sparse values. 1-D array of floats of size at least init_k_KCNL + 144.

propBeamProp object

Beam property object from where the stiffness and mass attributes are read from.

update_KCNLv_onlyint, optional

The default 0 means that the row and column indices KCNLr and KCNLc should also be updated. Any other value will only update the stiffness matrix values KCNLv.

Notes

KCNL = KC0L + KCL0 + KCLL + KGNL, that is \(\boldsymbol{K}_{CNL} + \boldsymbol{K}_{GNL}\): the nonlinear constitutive stiffness matrix \(\boldsymbol{K}_{CNL}\), the terms of \(\int_0^L (\boldsymbol{B}_L + \boldsymbol{B}_{NL})^\top \boldsymbol{C}_{sec} (\boldsymbol{B}_L + \boldsymbol{B}_{NL}) dx\) that contain \(\boldsymbol{B}_{NL}\), plus the geometric stiffness matrix \(\boldsymbol{K}_{GNL}\) of the axial force of the nonlinear axial strain. Crisfield [1], Section 7.1.1, Eq. (7.24), keeps that axial force in the initial-stress matrix instead, whose axial force is the total one of Eq. (7.18), that is \(\boldsymbol{K}_G + \boldsymbol{K}_{GNL}\); the tangent stiffness matrix is the same. The matrices are built from the von Kármán axial strain

\[\epsilon_{xx} = u_{,x} + \frac{1}{2} \left( v_{,x}^2 + w_{,x}^2 \right)\]

whose nonlinear part is \(\epsilon_{NL} = \frac{1}{2} \boldsymbol{B}_{NL} \boldsymbol{u}_e\), with \(\boldsymbol{B}_{NL} = v_{,x} \frac{\partial \boldsymbol{S}^v}{\partial x} + w_{,x} \frac{\partial \boldsymbol{S}^w}{\partial x}\) its variation, \(\boldsymbol{S}^v\) and \(\boldsymbol{S}^w\) being the linear interpolations of \(v\) and \(w\), whose derivatives, the rows Sv_x and Sw_x of _update_probe_BL_G(), are constant along the element, see the notes of BeamLR. With \(\boldsymbol{B}_L\) the linear strain-displacement matrix, \(\boldsymbol{C}_{sec}\) the sectional stiffness matrix C of BeamProp, whose first row couples the axial strain with the other strains, e.g. through \(E A_y\) and \(E A_z\), and \(N_{NL} = C_{00} \epsilon_{NL}\), \(C_{00} = E A\) when C is not set:

  • KC0L = \(\boldsymbol{B}_L^\top \boldsymbol{C}_{sec} \boldsymbol{B}_{NL}\)

  • KCL0 = KC0L`^top`

  • KCLL = \(\boldsymbol{B}_{NL}^\top \boldsymbol{C}_{sec} \boldsymbol{B}_{NL}\)

  • KGNL = \(N_{NL} \left( \frac{\partial \boldsymbol{S}^v}{\partial x}^\top \frac{\partial \boldsymbol{S}^v}{\partial x} + \frac{\partial \boldsymbol{S}^w}{\partial x}^\top \frac{\partial \boldsymbol{S}^w}{\partial x} \right)\)

The first three groups are the constitutive terms coupling the linear and the nonlinear parts of the axial strain. KGNL is geometric, carrying the axial force of the nonlinear axial strain. It is collected here so that update_KG() stays homogeneous of degree one in the displacements, which is what a linear buckling analysis needs. With it here,

\[\boldsymbol{K}_T = \boldsymbol{K}_{C0} + \boldsymbol{K}_{CNL}(\boldsymbol{u}) + \boldsymbol{K}_{GNL}(\boldsymbol{u}) + \boldsymbol{K}_G(\boldsymbol{u})\]

is the exact Jacobian of the internal forces of update_fint() with nonlinear=1, and a Newton-Raphson iteration built on them converges quadratically.

The integration is made by _update_probe_KCNLve(), exactly, since the integrands are constant along the element. The von Kármán axial strain is valid for small strains and moderate rotations: the nonlinear axial strain \(\epsilon_{NL}\) is uniform over the cross section, the curvatures and the transverse shear strains are linear in the displacements, and the element coordinate system is not updated with the displacements.

References

[1]

Crisfield, M. A., Non-linear Finite Element Analysis of Solids and Structures, Volume 1: Essentials, John Wiley & Sons, Chichester, 1991.

update_KG(self, long[: :1] KGr, long[: :1] KGc, double[: :1] KGv, BeamProp prop, int update_KGv_only=0) → void#

Update sparse vectors for geometric stiffness matrix KG

The 36 entries of the matrix of the element, in global coordinates, are written at the positions init_k_KG to init_k_KG + 35: the row and column indices, built from c1 and c2, are stored in KGr and KGc, and the values are added to those already in KGv. The matrix depends on the axial force computed from the displacements probe.ue, from length and from the first row C[0, :] of the sectional stiffness matrix of prop. probe.ue, length and the rotation matrix must be updated before, see update_probe_ue() and update_probe_xe(). The rows and columns of the entries are those of the translations of the two nodes.

Parameters:
KGrnp.array

Array to store row positions of sparse values. 1-D array of integers of the C type long, of size at least init_k_KG + 36.

KGcnp.array

Array to store column positions of sparse values. Same type and size as KGr.

KGvnp.array

Array to store sparse values. 1-D array of floats of size at least init_k_KG + 36.

propBeamProp object

Beam property object from where the stiffness and mass attributes are read from.

update_KGv_onlyint, optional

The default 0 means that the row and column indices KGr and KGc are also updated. Any other value will only update the stiffness matrix values KGv.

Notes

The geometric stiffness matrix is

\[\boldsymbol{K}_G = \int_0^L N \left( \frac{\partial \boldsymbol{S}^v}{\partial x}^\top \frac{\partial \boldsymbol{S}^v}{\partial x} + \frac{\partial \boldsymbol{S}^w}{\partial x}^\top \frac{\partial \boldsymbol{S}^w}{\partial x} \right) dx\]

the Hessian of \(\frac{1}{2} \int_0^L N (v_{,x}^2 + w_{,x}^2) dx\) at a constant axial force \(N\), where the slopes are those of the linear interpolations \(\boldsymbol{S}^v\) and \(\boldsymbol{S}^w\) of \(v\) and \(w\), see _update_probe_BL_G(), and \(N = \boldsymbol{C}_{0,:} \boldsymbol{\epsilon}\) is the axial force of the linear strains at probe.ue, at the center of the element, where update_KC0() evaluates the strain energy, see the notes of BeamC; when C is not set, \(N = E (A u_{,x} + A_y \kappa_y + A_z \kappa_z)\), constant along the element. \(N\) is also the axial force of the nodal internal forces, -finte[0] = finte[6]. In element coordinates the matrix is \(N/L\) times [[1, -1], [-1, 1]] for the \(v\) and for the \(w\) of the two nodes.

The slopes are those that enter the axial strain. Slopes taken from the rotations, \(v_{,x} = r_z\) and \(w_{,x} = -r_y\), would neglect the shear deformation in buckling, so that the buckling load would converge to the Euler load instead of Eq. (2-57) of Timoshenko and Gere (1961), see the notes of BeamLR.

\(\boldsymbol{K}_G\) is homogeneous of degree one in probe.ue. With probe.ue from the linear static solution of a reference load, the critical load multipliers \(\lambda\) of the linear buckling analysis solve \((\boldsymbol{K}_{C0} + \lambda \boldsymbol{K}_G) \boldsymbol{u} = \boldsymbol{0}\), see linear_buckling(). The geometric term of the nonlinear axial strain is in update_KCNL().

update_M(self, long[: :1] Mr, long[: :1] Mc, double[: :1] Mv, BeamProp prop, int mtype=0) → void#

Update sparse vectors for mass matrix M

The entries of the matrix of the element, in global coordinates, are written from the position init_k_M: 144 entries with mtype=0 and 36 entries with mtype=1. The row and column indices, built from c1 and c2, are stored in Mr and Mc, and the values are added to those already in Mv. The matrix is computed from length, the rotation matrix and the attributes intrho, intrhoy, intrhoz, intrhoy2, intrhoz2 and intrhoyz of prop. length and the rotation matrix must be updated before, see update_rotation_matrix() and update_probe_xe().

Parameters:
Mrnp.array

Array to store row positions of sparse values. 1-D array of integers of the C type long, of size at least init_k_M + 144 (init_k_M + 36 with mtype=1).

Mcnp.array

Array to store column positions of sparse values. Same type and size as Mr.

Mvnp.array

Array to store sparse values. 1-D array of floats, of the same size as Mr.

propBeamProp object

Beam property object from where the inertial attributes are read.

mtypeint, optional

0 for consistent mass matrix, 1 for lumped mass matrix. Default 0. The element has no reduced-integration mass matrix, 2.

Raises:
ValueError

If mtype is not 0 or 1.

Notes

The mass matrices come from the kinetic energy of the displacement field of the notes of BeamC, integrated over the cross section with the inertial attributes of BeamProp:

\[T = \frac{1}{2} \int_0^L \Big[ m (\dot{u}^2 + \dot{v}^2 + \dot{w}^2) + m_{yy} \dot{r}_z^2 + m_{zz} \dot{r}_y^2 - 2 m_{yz} \dot{r}_y \dot{r}_z - 2 m_y \dot{u} \dot{r}_z + 2 m_z \dot{u} \dot{r}_y - 2 m_z \dot{v} \dot{r}_x + 2 m_y \dot{w} \dot{r}_x + (m_{yy} + m_{zz}) \dot{r}_x^2 \Big] dx\]

with \(m\) = intrho, \(m_y\) = intrhoy, \(m_z\) = intrhoz, \(m_{yy}\) = intrhoy2, \(m_{zz}\) = intrhoz2 and \(m_{yz}\) = intrhoyz.

mtype=0 gives the consistent mass matrix, the Hessian of \(T\) with respect to the nodal velocities, with the six displacements of the beam axis interpolated linearly, as in BeamLR. The integral along the element is computed exactly, e.g. with the two-point Gauss-Legendre quadrature, and the rotary inertia is included.

mtype=1 gives the lumped mass matrix, diagonal in element coordinates: at each node, \(L m/2\) for the three translations, \(L (m_{yy} + m_{zz})/2\) for \(r_x\), \(L m_{zz}/2\) for \(r_y\) and \(L m_{yy}/2\) for \(r_z\). It corresponds to the two-point Gauss-Lobatto quadrature of \(T\), whose points are the nodes, without the coupling terms of \(m_y\), \(m_z\) and \(m_{yz}\), which are not included.

The lumped mass matrix follows the lumped mass matrix by Lobatto integration of Brockman (1987) [1], p. 2348, adapted to the beam: the two-point Gauss-Lobatto quadrature of \(T\), whose points are the nodes, gives a diagonal matrix only without the first moments of the density, which are therefore dropped. The consistent mass matrix is the integral of Petyt (2010) [2], Sec. 3.3, Eqs. (3.58) and (3.59), for each linearly interpolated field, e.g. \(L m/6\) times \([2, 1; 1, 2]\) for each translation, and Sec. 3.4, Eq. (3.102), with \(m_{yy} + m_{zz}\) in place of \(\rho I_x\), for the twist \(r_x\).

References

[1]

Brockman, R. A., 1987, “Dynamics of the Bilinear Mindlin Plate Element,” Int. J. Numer. Methods Eng., 24(12), pp. 2343–2356. https://onlinelibrary.wiley.com/doi/pdf/10.1002/nme.1620241208

[2]

Petyt, M., 2010, Introduction to Finite Element Vibration Analysis, 2nd ed., Cambridge University Press, Cambridge. https://doi.org/10.1017/CBO9780511761195

update_fint(self, double[: :1] fint, BeamProp prop, int nonlinear=0) → void#

Update the internal force vector

Calls update_probe_finte(prop, nonlinear), transforms the forces and moments of probe.finte to global coordinates with the rotation matrix and adds them to fint at the positions c1 to c1 + 5 and c2 to c2 + 5. The displacements probe.ue must be updated before, see update_probe_ue().

Parameters:
fintnp.array

Array that is updated in place with the internal forces. The internal forces stored in fint are calculated in global coordinates. Method update_probe_finte() is called to update the parameter finte of the BeamLRProbe with the internal forces in local coordinates. 1-D array of size 6*M, for \(M\) nodes in the model.

propBeamProp object

Beam property object from where the stiffness and mass attributes are read from.

nonlinearint, optional

The default 0 gives the linear internal forces, KC0*u. Any other value adds the geometrically nonlinear terms, for which the tangent stiffness matrix of the internal forces is KC0 + KCNL + KG, see update_KCNL().

Notes

The nonlinear terms are those of the von Kármán strains, for which the exact Jacobian of the internal forces is KC0 + KCNL + KG, see update_probe_finte() and update_KCNL().

update_length(self) → void#

Update element length

The distance between the two nodes, computed from the coordinates probe.xe in the element coordinate system, is stored in the attribute length. Called by update_probe_xe().

Notes

With the element coordinates \((x_i, y_i, z_i)\) of nodes 1 and 2,

\[L = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}\]

which, the transformation to element coordinates being a rotation, is the distance between the two nodes in global coordinates.

update_probe_finte(self, BeamProp prop, int nonlinear=0) → void#

Update the internal force vector of the probe

The attribute finte is updated with the BeamLRProbe the internal forces in local coordinates. While using this function, mind that the probe can be shared amongst more than one finite element, depending how you defined them, meaning that the probe will always safe the values from the last udpate.

Note

The finte attribute of object BeamLRProbe is updated, accessible using .probe.finte.

The 12 values of finte are overwritten. They are computed from length and from the displacements probe.ue, which must be updated before, see update_probe_xe() and update_probe_ue().

Parameters:
propBeamProp object

Beam property object from where the stiffness and mass attributes are read from.

nonlinearint, optional

The default 0 gives the linear internal forces, KC0*u. Any other value adds the geometrically nonlinear terms, for which the tangent stiffness matrix of the internal forces is KC0 + KCNL + KG, see update_KCNL().

Notes

The linear internal forces are \(\boldsymbol{K}_{C0_e} \boldsymbol{u}_e\), with the matrix \(\boldsymbol{K}_{C0_e}\) of update_KC0() in element coordinates. With nonlinear different from 0, the terms of the von Kármán strains are added, see _update_probe_finte_nonlinear(), such that finte is the gradient of the strain energy with the von Kármán axial strain, for which the exact Jacobian of the internal forces is KC0 + KCNL + KG, see update_KCNL().

update_probe_ue(self, double[: :1] u) → void#

Update the local displacement vector of the probe of the element

Note

The ue attribute of object BeamLRProbe is updated, accessible using .probe.ue.

The translations and rotations of the two nodes, read from u at the positions c1 to c1 + 5 and c2 to c2 + 5, are transformed to the element coordinate system with the transpose \(\boldsymbol{T}_{3\times 3}^\top\) of the transformation matrix, which must be updated before, see update_rotation_matrix().

Parameters:
uarray-like

Array with global displacements, for a total of \(M\) nodes in the model, this array will be arranged as: \(u_1, v_1, w_1, {r_x}_1, {r_y}_1, {r_z}_1, u_2, v_2, w_2, {r_x}_2, {r_y}_2, {r_z}_2, ..., u_M, v_M, w_M, {r_x}_M, {r_y}_M, {r_z}_M\). Translations of dimension length and rotations, 1-D array of size 6*M.

Notes

For each node, \(\{u, v, w\}_e^\top = \boldsymbol{T}_{3\times 3}^\top \{u, v, w\}^\top\) and \(\{r_x, r_y, r_z\}_e^\top = \boldsymbol{T}_{3\times 3}^\top \{r_x, r_y, r_z\}^\top\), with \(\boldsymbol{T}_{3\times 3}\) of update_rotation_matrix(), whose columns are the element axes in global coordinates.

update_probe_xe(self, double[: :1] x) → void#

Update the 3D coordinates of the probe of the element

Note

The xe attribute of object BeamLRProbe is updated, accessible using .probe.xe.

The coordinates of the two nodes, read from x at the positions c1//2 and c2//2, are transformed to the element coordinate system with the transpose \(\boldsymbol{T}_{3\times 3}^\top\) of the transformation matrix, which must be updated before, see update_rotation_matrix(). Then update_length() is called, updating length.

Parameters:
xarray-like

Array with global nodal coordinates, for a total of \(M\) nodes in the model, this array will be arranged as: \(x_1, y_1, z_1, x_2, y_2, z_2, ..., x_M, y_M, z_M\). Dimension length, 1-D array of size 3*M.

Notes

For each node, \(\{x, y, z\}_e^\top = \boldsymbol{T}_{3\times 3}^\top \{x, y, z\}^\top\), with \(\boldsymbol{T}_{3\times 3}\) of update_rotation_matrix(), whose columns are the element axes in global coordinates. The element coordinates are thus measured from the origin of the global system along the element axes.

update_rotation_matrix(self, double vxyi, double vxyj, double vxyk, double[: :1] x) → void#

Update the rotation matrix of the element

Attributes r11,r12,r13,r21,r22,r23,r31,r32,r33 are updated, with the entries \(T_{ij}\) of the transformation matrix \(\boldsymbol{T}_{3\times 3}\) from element to global coordinates, whose columns are the element axes.

The element attributes vxyi, vxyj and vxyk are also updated when this function is called.

The element coordinate system is determined, identifying the \(ijk\) components of each axis: \({x_e}_i, {x_e}_j, {x_e}_k\); \({y_e}_i, {y_e}_j, {y_e}_k\); \({z_e}_i, {z_e}_j, {z_e}_k\).

The element \(x\) axis goes from node 1 to node 2, whose coordinates are read from x at the positions c1//2 and c2//2. The \(z\) axis is normal to the \(x\) axis and to the vector (vxyi, vxyj, vxyk), the \(y\) axis completes the right-handed system, and the three axes are normalized.

Parameters:
vxyi, vxyj, vxykdouble

Components of a vector on the \(XY\) plane of the element coordinate system, defined using global coordinates. Only the direction of the vector is used. A vector parallel to the element axis gives a null \(z\) axis and a rotation matrix with nan entries.

xarray-like

Array with global nodal coordinates, for a total of \(M\) nodes in the model, this array will be arranged as: \(x_1, y_1, z_1, x_2, y_2, z_2, ..., x_M, y_M, z_M\). Dimension length, 1-D array of size 3*M.

Notes

With \(\boldsymbol{x}_1\) and \(\boldsymbol{x}_2\) the positions of the two nodes and \(\boldsymbol{v}_{xy}\) the vector (vxyi, vxyj, vxyk), \(\boldsymbol{e}_x = (\boldsymbol{x}_2 - \boldsymbol{x}_1) / \|\boldsymbol{x}_2 - \boldsymbol{x}_1\|\) and

\[\boldsymbol{e}_z = \frac{\boldsymbol{e}_x \times \boldsymbol{v}_{xy}}{\|\boldsymbol{e}_x \times \boldsymbol{v}_{xy}\|}, \qquad \boldsymbol{e}_y = \boldsymbol{e}_z \times \boldsymbol{e}_x\]

and \(\boldsymbol{T}_{3\times 3} = [\boldsymbol{e}_x, \boldsymbol{e}_y, \boldsymbol{e}_z]\). The axis \(\boldsymbol{e}_y\) is thus the component of \(\boldsymbol{v}_{xy}\) normal to \(\boldsymbol{e}_x\), normalized. The norm \(\|\boldsymbol{e}_x \times \boldsymbol{v}_{xy}\|\) vanishes when \(\boldsymbol{v}_{xy}\) is parallel to the element axis, and the division then gives the nan entries.

vxyi#

vxyi: ‘double’

vxyj#

vxyj: ‘double’

vxyk#

vxyk: ‘double’

class pyfe3d.beamlr.BeamLRData#

Used to allocate memory for the sparse matrices.

Each attribute is the number of entries that one BeamLR element writes in the arrays of rows, columns and values of a sparse matrix, at the consecutive positions that start at its init_k_KC0, init_k_KCNL, init_k_KG or init_k_M. The constructor takes no argument and sets the values below.

Attributes:
KC0_SPARSE_SIZE,int

KC0_SPARSE_SIZE = 144, written by BeamLR.update_KC0().

KCNL_SPARSE_SIZE,int

KCNL_SPARSE_SIZE = 144, written by BeamLR.update_KCNL().

KG_SPARSE_SIZE,int

KG_SPARSE_SIZE = 36, written by BeamLR.update_KG().

M_SPARSE_SIZE,int

M_SPARSE_SIZE = 144, written by BeamLR.update_M() with mtype=0; with mtype=1 only the first 36 are written.

KC0_SPARSE_SIZE#

KC0_SPARSE_SIZE: ‘int’

KCNL_SPARSE_SIZE#

KCNL_SPARSE_SIZE: ‘int’

KG_SPARSE_SIZE#

KG_SPARSE_SIZE: ‘int’

M_SPARSE_SIZE#

M_SPARSE_SIZE: ‘int’

class pyfe3d.beamlr.BeamLRProbe#

Probe used for local coordinates, local displacements, local stresses etc

The idea behind using a probe is to avoid allocating larger memory buffers per finite element. The memory buffers are allocated per probe, and one probe can be shared amongst many finite elements, with the information being updated and retrieved on demand.

Note

The probe can be shared amongst more than one finite element, depending on how you defined them. Mind that the probe will always safe the values from the last udpate.

The constructor takes no argument and allocates the arrays below, filled with zeros.

Attributes:
xe,array-like

Array of size NUM_NODES*DOF//2=6 containing the nodal coordinates in the element coordinate system, in the following order \({x_e}_1, {y_e}_1, {z_e}_1, {x_e}_2, {y_e}_2, {z_e}_2\). Dimension length. Updated by BeamLR.update_probe_xe().

ue,array-like

Array of size NUM_NODES*DOF=12 containing the element displacements in the following order \(u_{e_1}, v_{e_1}, w_{e_1}, {r_x}_{e_1}, {r_y}_{e_1}, {r_z}_{e_1}, u_{e_2}, v_{e_2}, w_{e_2}, {r_x}_{e_2}, {r_y}_{e_2}, {r_z}_{e_2}\). Translations of dimension length and rotations. Updated by BeamLR.update_probe_ue().

finte,array-like

Array of size NUM_NODES*DOF=12 containing the element internal forces corresponding to the degrees-of-freedom described by ue, forces and moments. Updated by BeamLR.update_probe_finte().

BLexx, BLky, BLkzarray-like

Arrays of size NUM_NODES*DOF=12 with the rows of the linear strain-displacement matrix for the axial strain and the two curvatures, at the last evaluated integration point.

BLgammay, BLgammaz, BLkxarray-like

Arrays of size NUM_NODES*DOF=12 with the rows of the linear strain-displacement matrix for the two transverse shear strains and the twist, at the last evaluated integration point, read with the three rows above for the axial force of a sectional stiffness matrix with couplings, see BeamLR._update_probe_BL_G().

Sv_x, Sw_xarray-like

Arrays of size NUM_NODES*DOF=12 with the rows giving the slopes \(v_{,x}\) and \(w_{,x}\) of the linear interpolations of \(v\) and \(w\), constant along the element, as in BeamCProbe, see the notes of BeamLR.

KCNLvearray-like

KCNLve: ‘double[::1]’

BLexx#

BLexx: ‘double[::1]’

BLgammay#

BLgammay: ‘double[::1]’

BLgammaz#

BLgammaz: ‘double[::1]’

BLkx#

BLkx: ‘double[::1]’

BLky#

BLky: ‘double[::1]’

BLkz#

BLkz: ‘double[::1]’

KCNLve#

KCNLve: ‘double[::1]’

Sv_x#

Sv_x: ‘double[::1]’

Sw_x#

Sw_x: ‘double[::1]’

finte#

finte: ‘double[::1]’

ue#

ue: ‘double[::1]’

xe#

xe: ‘double[::1]’

See also

The theory of this module in context: Beam theory and the beam elements.