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#
kebarandqebarwork at single-element level.kbarandqbarassemble those contributions over a full topology table.mebarandmbarprovide consistent or lumped mass matrices for dynamic analyses.
Functions#
|
Assemble bar or truss tangent stiffness contributions into the global matrix. |
|
Compute the tangent stiffness matrix of a geometrically nonlinear bar element. |
|
Assemble bar/truss mass matrices into the global mass matrix. |
|
Compute the element mass matrix for a 2-node bar/truss element. |
|
Assemble bar or truss internal forces and element output quantities. |
|
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]. Ifrhois 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)