femlabpy.plotting#
Lightweight Matplotlib plotting helpers for quick FEM inspection.
Workflow role#
These functions are not a full visualization subsystem. They are compact, teaching-oriented helpers for checking meshes, supports, nodal loads, deformed shapes, and contour-like stress fields directly from the FemLab-style tables used throughout the package.
Public entry points#
plotelemdraws the undeformed mesh and optional labels.plotforcesandplotbcoverlay external loads and constraints.plotq4andplott3reconstruct scalar fields for quadrilateral and triangular meshes.plotudraws scalar nodal fields or displacement-derived contours.
Functions#
|
Plot prescribed boundary conditions on a 2D mesh view. |
|
Plot the undeformed mesh and optionally annotate node or element numbers. |
|
Plot nodal loads as arrows on a 2D mesh view. |
|
Plot a contour field reconstructed from Q4 Gauss-point results. |
|
Plot a contour field from T3 element results. |
|
Plot a scalar nodal field or displacement-derived contour. |
Function Reference#
- femlabpy.plotting.plotbc(T, X, C, ax=None)[source]#
Plot prescribed boundary conditions on a 2D mesh view.
- femlabpy.plotting.plotelem(T, X, line_style: str = 'k-', nonum: bool = False, noelem: bool = False, ax=None)[source]#
Plot the undeformed mesh and optionally annotate node or element numbers.
- femlabpy.plotting.plotforces(T, X, P, ax=None)[source]#
Plot nodal loads as arrows on a 2D mesh view.
- femlabpy.plotting.plotq4(T, X, S, scomp: int, ax=None)[source]#
Plot a contour field reconstructed from Q4 Gauss-point results.
- femlabpy.plotting.plott3(T, X, S, scomp: int, ax=None)[source]#
Plot a contour field from T3 element results.
- femlabpy.plotting.plotu(T, X, u, dof: int | None = None, component: int = 0, ax=None)[source]#
Plot a scalar nodal field or displacement-derived contour.
- Parameters:
- Tarray_like
Element topology table with one-based node ids and a trailing property id.
- Xarray_like
Nodal coordinates. Flat Gmsh
(x, y, z)meshes are plotted in 2D.- uarray_like
Either one scalar value per node, a
(nn, ncomp)nodal field, or a flattened global vector with lengthnn * dof.- dofint, optional
Degrees of freedom per node when
uis passed as a flattened global vector. When omitted,uis treated as a scalar nodal field unless it is already shaped as(nn, ncomp).- componentint, default 0
Which nodal component to plot when
ucontains multiple values per node. Use0for magnitude,1for the first component,2for the second component, and so on.- axmatplotlib.axes.Axes, optional
Existing Matplotlib axes. A new axes object is created when omitted.