femlabpy.elements.bars#

Geometrically nonlinear bar and truss element kernels.

Workflow role#

This module contains both element-level routines and assembled global wrappers for bar-like members. It is the main reference for one-dimensional axial behavior, geometric nonlinearity, and the simplest mass-matrix construction in the codebase.

Public entry points#

  • kebar and qebar work at single-element level.

  • kbar and qbar assemble those contributions over a full topology table.

  • mebar and mbar provide consistent or lumped mass matrices for dynamic analyses.

Functions#

kbar(K, T, X, G[, u])

Assemble bar or truss tangent stiffness contributions into the global matrix.

kebar(Xe0, Xe1, Ge)

Compute the tangent stiffness matrix of a geometrically nonlinear bar element.

mbar(M, T, X, G[, dof, lumped])

Assemble bar/truss mass matrices into the global mass matrix.

mebar(Xe, Ge[, dof, lumped])

Compute the element mass matrix for a 2-node bar/truss element.

qbar(q, T, X, G[, u])

Assemble bar or truss internal forces and element output quantities.

qebar(Xe0, Xe1, Ge)

Compute the internal-force response of a single geometrically nonlinear bar.

Function Reference#

femlabpy.elements.bars.kbar(K, T, X, G, u=None)[source]#

Assemble bar or truss tangent stiffness contributions into the global matrix.

femlabpy.elements.bars.kebar(Xe0, Xe1, Ge)[source]#

Compute the tangent stiffness matrix of a geometrically nonlinear bar element.

femlabpy.elements.bars.mbar(M, T, X, G, dof: int = 2, *, lumped: bool = False)[source]#

Assemble bar/truss mass matrices into the global mass matrix.

Parameters:
Mndarray or sparse, shape (ndof, ndof)

Global mass matrix (modified in place).

Tarray_like, shape (nel, 3)

Topology table [n1, n2, mat_id].

Xarray_like, shape (nn, ndim)

Nodal coordinates.

Garray_like

Material table with rows [A, E, rho].

dofint

Degrees of freedom per node.

lumpedbool

If True, assemble lumped mass.

Returns:
Mndarray or sparse

Updated global mass matrix.

femlabpy.elements.bars.mebar(Xe, Ge, dof: int = 2, *, lumped: bool = False)[source]#

Compute the element mass matrix for a 2-node bar/truss element.

Consistent mass:

M = (rho * A * L / 6) * [[2, 1], [1, 2]] tensor I_dof

Lumped mass:

M = (rho * A * L / 2) * I_{2*dof}

Parameters:
Xearray_like, shape (2, ndim)

Initial (undeformed) nodal coordinates.

Gearray_like

Material row [A, E, rho]. If rho is omitted it defaults to 1.

dofint

Degrees of freedom per node.

lumpedbool

If True, return the diagonally lumped mass matrix.

Returns:
Mendarray, shape (2*dof, 2*dof)
femlabpy.elements.bars.qbar(q, T, X, G, u=None)[source]#

Assemble bar or truss internal forces and element output quantities.

femlabpy.elements.bars.qebar(Xe0, Xe1, Ge)[source]#

Compute the internal-force response of a single geometrically nonlinear bar.