femlabpy.assembly#
Scatter-assembly helpers that map element-level results into global arrays.
Workflow role#
Element kernels in femlabpy.elements compute local matrices and vectors
for one element at a time. This module converts the one-based topology row into
global degree-of-freedom indices and adds those local contributions into the
global stiffness matrix or internal-force vector in place.
Reading guide#
Read assmk first if you want to understand matrix assembly and assmq
second for force-vector assembly. Both functions share the same indexing path,
so once the topology-to-DOF mapping is clear the rest of the global workflow is
much easier to follow.
Functions#
Function Reference#
- femlabpy.assembly.assmk(K, Ke, Te, dof: int = 1)[source]#
Assemble one element stiffness matrix into the global stiffness matrix.
- Parameters:
- K:
Global stiffness matrix updated in place.
- Ke:
Element stiffness matrix ordered by the element’s local DOFs.
- Te:
Legacy FemLab topology row whose last entry stores the property id.
- dof:
Degrees of freedom per node.
- Returns:
- ndarray or sparse matrix
Updated global stiffness matrix.
- femlabpy.assembly.assmq(q, qe, Te, dof: int = 1)[source]#
Assemble one element force vector into the global internal-force vector.
- Parameters:
- q:
Global internal-force vector updated in place.
- qe:
Element internal-force vector.
- Te:
Legacy FemLab topology row whose last entry stores the property id.
- dof:
Degrees of freedom per node.
- Returns:
- ndarray
Updated global internal-force vector.