Metadata-Version: 2.4
Name: panels
Version: 0.18.5
Summary: Semi-analytical models for plates, shells and stiffened panels
Author: Nathan D'Souza
Author-email: "Saullo G. P. Castro" <S.G.P.Castro@tudelft.nl>
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/saullocastro/panels
Project-URL: Documentation, https://saullocastro.github.io/panels/
Project-URL: Repository, https://github.com/saullocastro/panels
Keywords: Ritz method,semi-analytical,Energy-based method,structural analysis,structural optimization,static analysis,buckling,vibration,panel flutter,structural dynamics,implicit time integration,explicit time integration
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Education
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX :: BSD
Classifier: Environment :: WebAssembly :: Emscripten
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: matplotlib
Requires-Dist: composites>=0.10.2
Requires-Dist: structsolve>=0.14.0
Dynamic: license-file

Github Actions status:

[![Actions Status](https://github.com/saullocastro/panels/workflows/pytest/badge.svg)](https://github.com/saullocastro/panels/actions)

Coverage status:

[![Codecov Status](https://codecov.io/gh/saullocastro/panels/branch/main/graph/badge.svg?token=KD9D8G8D2P)](https://codecov.io/gh/saullocastro/panels)


Semi-analytical methods for plates, shells and stiffened panels
===============================================================

- Linear and non-linear static analyses, with field outputs of displacements, strains and
  stresses
- Linear buckling
- Vibration, with or without pre-stress
- Panel flutter using the piston theory
- Geometrically non-linear static analyses (postbuckling) using the Newton-Raphson method, the stabilized Newton-Raphson method, which passes mode jumps under load control, or the arc-length methods of Riks and Crisfield, with the product of the tangent stiffness matrix by a vector available without assembly
- Dead or follower (hydrostatic) pressure loads, with the unsymmetric load stiffness of the follower pressure
- Multi-domain assemblies of plates, cylindrical shells, cylinders, stiffened panels, with the domains connected exactly with the null-space method, the default, or by penalty stiffnesses. Debonding defects or cohesive zone can be simulated
- Prescribed displacements and rotations imposed exactly with the null-space method, the default, `MultiDomain(..., pd_method='null-space')`, for displacement control in linear static, linear buckling and geometrically non-linear (Newton-Raphson, Riks, Crisfield) analyses, with the reaction forces; or by penalty stiffnesses
- CLPT, FSDT and TSDT kinematics for plates and cylindrical shells
- Donnell and Sanders-Koiter kinematics for cylindrical shells

The structural matrices are solved with
[structsolve](https://github.com/saullocastro/structsolve).


Citing this library
===================

Saullo G. P. Castro, Nathan D'Souza. (2026). Semi-analytical methods for plates, shells and stiffened panels (Version 0.18.5). Zenodo. DOI: https://doi.org/10.5281/zenodo.2541522.


Documentation
=============

The documentation is available on: https://saullocastro.github.io/panels.


Installation
============

To get the latest version:

    python -m pip install panels


Running the tests
=================

From the root of the repository, with the Cython extensions built in place:

    python -m pip install -r requirements.txt -r requirements_ci.txt
    python setup.py build_ext --inplace
    python -m pytest tests

The tests marked `slow`, `@pytest.mark.slow`, registered in
`pyproject.toml`, are those that are slow under the line tracing of the
Cython code and cover no line of the `.pyx` files that the other tests do
not cover. Every test runs by default; the coverage workflow,
`.github/workflows/coverage.yml`, deselects them with `-m "not slow"` in
its run with the line-traced build only, and runs them in its run with the
optimized build, which measures the Python code. A new test that is slow
under line tracing can be marked once the coverage of the other tests,
measured with `pytest --cov --cov-context=test` on the line-traced build,
is shown to include every line of the `.pyx` files that it covers.


Running in the browser with Pyodide
===================================

A WebAssembly wheel is published on PyPI for [Pyodide](https://pyodide.org)
314 (CPython 3.14), such that `panels` runs in the browser, e.g. in
JupyterLite or in a web page with Pyodide. NumPy, SciPy and matplotlib come
with Pyodide, and `micropip` installs `composites` and `structsolve` from PyPI:

```python
import micropip
await micropip.install("panels")

import io
from structsolve import lb
from panels.shell import Shell, load

s = Shell(a=0.6, b=0.4, stack=[0, 45, -45, 90], plyt=0.125e-3,
          laminaprop=(142.5e9, 8.7e9, 0.28, 5.1e9, 5.1e9, 3.0e9), m=10, n=10)
s.Nxx = -1.
eigvals, eigvecs = lb(s.calc_kC(), s.calc_kG(), silent=True)
print('critical load: Nxx = %1.2f N/m' % -eigvals[0])
s.results['eigvals'] = eigvals
s.results['eigvecs'] = eigvecs

# saving to memory, since a web page has no file system
buf = io.BytesIO()
s.save(buf)
data = buf.getvalue()

# offering the file for download
from js import Blob, Object, URL, document
from pyodide.ffi import to_js
blob = Blob.new(to_js([data]), to_js({'type': 'application/zip'},
                                     dict_converter=Object.fromEntries))
link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = 'plate.shell.zip'
link.click()

# loading the bytes back, e.g. from a file uploaded by the user
s2 = load(io.BytesIO(data))
```

In Pyodide the field outputs run serially, without OpenMP.


Saving and loading
==================

`Shell`, `StiffPanelBay` and `MultiDomain` are saved with `save()` to a zip
file with the inputs in JSON and the arrays, such as the results, in NumPy's
`.npy` format, see `panels.json_io`. The files are independent of the Python
version, readable outside Python and safe to load from untrusted sources,
unlike pickle:

```python
from panels.shell import load
s.name = 'plate'
s.save()              # writes plate.shell.zip
s2 = load('plate')
```

Pickle files are not loaded, since a pickle file can execute arbitrary code;
one from a trusted source can be converted by loading it with `pickle.load()`
and saving the object again.


History
=======

See [CHANGELOG.md](CHANGELOG.md) for the details of each version.
* version 0.18.5 (2026-11-30)
    - The tables of the approximation functions of all the numerically integrated kernels (`*_num`) are kept on each shell across calls, with the same results bit for bit, and the Bardell functions are evaluated with Horner's rule instead of `pow`, which changes the results at the round-off; the nonlinear analyses of the cohesive coupons were 1.34-1.35 times faster on a cluster node (Xeon E5-2640 v4)
    - New opt-in `MultiDomain(..., plate_kernels='blas')`: the nonlinear plate kernels of `plate_clpt_donnell` and `plate_fsdt_donnell` as matrix products, equal to the Cython kernels to the round-off
    - New opt-in `reuse_kT=True` of `get_reduced_functions` and `solve_coupon`, and `linear_solver` of `solve_coupon`, e.g. `'pardiso_lu'` of structsolve 0.13.0
    - The notebooks were executed again with the present code, the runs of the mixed-mode coupons made again by the notebooks, and the tests import the installed `panels` without changing `sys.path`
    - New case of the stabilized Newton-Raphson method of structsolve 0.14.0, `NL_method='stabilized_NR'`: mode jump of a compressed plate from one to two half-waves, which `'NR'` cannot pass under load control (test `tests/tests_shell/test_stabilized_nr_mode_jump.py`, notebook `ex_stabilized_newton_raphson`, section of the documentation page `shell_overview`)
    - Requires `structsolve>=0.14.0`
    - The jobs that upload a release to PyPI do not cancel each other when one fails and skip the files already uploaded, so that a failed upload can be run again
    - New opt-in `BladeStiff2D(..., face='lower')`: the flange tied to the face of the base, or of the skin, its height measured from that face
    - The blades and webs built on a foot, a base or a skin in the notebooks and tests of Egle and Sewall, Abramovich et al., Lanzi, Stamatelos and Labeas, Sewall and Naumann, and Moore and Wescoat are tied to its face, with the heights of the sources measured from it; new coarse test of Moore and Wescoat specimen 19
    - Files of earlier versions with the keys `'ABD'` (`Shell`) or `'T_tol'` (`MultiDomain`) are no longer loaded
* version 0.17.0 (2026-11-24)
    - New connection `'CZM'`, a mixed-mode multilinear cohesive interface: a superposition of bilinear laws with a mode-dependent penalty stiffness, each with its own Benzeggagh-Kenane exponent and damage, with contact and a consistent tangent, for the CLPT, FSDT and TSDT models; the history is updated with the converged states through `structsolve.Analysis.on_converged`
    - New `MultiDomain.add_linear_constraint`, linear constraints between panels imposed exactly with the null-space method, and `panels.multidomain.delamination`, DCB, ENF and MMB coupons with the lever of the MMB apparatus as a linear constraint
    - Requires `structsolve>=0.12.0`
    - New validation notebooks of the mixed-mode cohesive coupons, one per test campaign: `mmb_camanho2003_as4peek`, `mmb_ratcliffe2014_im78552`, `krueger2012_mmb_benchmark`, `mmb_tijs2022_as4dpekk`, `mmb_cho2025_glassepoxy`, `mmb_gong2017_t700qy9511` and `mmb_raimondo2021_im78552`
* version 0.16.0 (2026-11-13)
    - New models with transverse shear and Green-Lagrange membrane strains, `plate_fsdt_gl`, `plate_tsdt_gl`, `cylshell_fsdt_gl` and `cylshell_tsdt_gl`, total-Lagrangian models `plate_fsdt_tl`, `cylshell_fsdt_tl`, `plate_tsdt_tl` and `cylshell_tsdt_tl`, and the Kirchhoff-Love cylinders `cylshell_clpt_gl` and `cylshell_clpt_tl`
    - New annular-sector plate models: `annular_clpt_donnell`, `annular_clpt_gl`, `annular_clpt_tl`, `annular_fsdt_donnell`, `annular_fsdt_gl`, `annular_fsdt_tl`, `annular_tsdt_donnell`, `annular_tsdt_gl` and `annular_tsdt_tl`
    - New stiffener model `bladestiff2d_clt_sanders`; new function `create_cylinder_z_stiffened`, cylinders with Z-section stringers; key `'face'` of the connections `'BFxcte'` and `'BFycte'`, which ties flanges and ring-frame webs to a face of the base; argument `models` of the wing box and of the blade-stiffened cylinder
    - New defaults: `MultiDomain` imposes the prescribed displacements with `pd_method='null-space'`, `create_wingbox` connects the domains with `conn_method='null-space'`, the blades and flanges of the ready-made assemblies use `plate_clpt_gl`, and the ends of the `BladeStiff2D` flange follow the bay
    - API changes: `create_cylinder_blade_stiffened` returns `(md, conns, info)` and takes the argument `side`; in-plane loads `Nyy_*` and `Nxy_*` of `tstiff2d_1stiff_flutter`; the boundary-condition flags of `StiffPanelBay` are fixed once it has panels; the cylinder builders store their connections in the assembly; `tstiff2d_1stiff_freq` and `tstiff2d_1stiff_flutter` restrain `u = v = w = 0` at the edges of the skin and the ends of the flange, as in Castro and Donadon (2017)
    - BUG: `Shell.m` and `Shell.n` above 30 assigned after the construction were silently capped and now raise a `ValueError`; the flange of `BladeStiff2D` has the free edges it is documented with
    - New validation notebooks in `notebooks/`, among them the stiffened cylinders in torsion of Moore and Wescoat (1944), blade-stiffened cylinders (`card1966_*`, `peterson1959_*`, `sewall1968_*`, `singer1971_*`, `weller1977_*`) and annular plates and webs (`thick_annular_plates`, `annular_webs_on_cylinders`); validation runs of more than 30 s are in the notebooks only, with fast tests of the same features
* version 0.15.0 (2026-11-03)
    - New model `plate_clpt_gl`, plates with full Green-Lagrange membrane strains, for large rotations, e.g. of wing boxes
    - New connection `'BFxycte'`, an edge `x = const` joined to an edge `y = const`, and the wing-box example `panels.multidomain.wingbox` (High-AR-t5) built with it
    - `ConnectionTermsWarning` when a domain has too few terms across an edge connection
    - Documentation and tests of the null rows and columns in the linear static solves of `MultiDomain`; on Linux, the static runtime libraries are linked only when the compiler finds them (`PANELS_STATIC_RUNTIME`)
    - Tests of the transverse shear correction of the FSDT against Rohwer (1988), Table 2, and Vlachoutsis (1992), Table I
    - Coverage workflow in one job of two runs, the optimized build for the Python code and the line-traced build without the tests marked `slow` for the Cython code, with the same coverage as before
    - Benchmark of the post-buckling of an axially compressed cylinder with initial imperfections, Simo, Fox and Rifai (1990), test and notebook, Riks method and branch switching of structsolve
    - Benchmark of a cantilever cylinder under a follower pressure with an initial imperfection, Schweizerhof and Ramm (1984), test and notebook, Riks method and inertia of the unsymmetric tangent stiffness matrix
    - Requires `structsolve>=0.10.0` and `composites>=0.10.2`, whose `MatLamina` invariants are those of plane stress also for materials given with nine constants, and whose lamination-parameter route accounts for the offset of the laminate
* version 0.14.1 (2026-10-28)
    - BUG: the mass matrices used `shell.rho` in the closed-form kernels and the opposite sign of the laminate offset; they now use the moments of the density of the laminate, exact for per-ply densities
    - BUG: TSDT with a laminate offset, the transverse shear vanishes at the faces of the laminate, and the connections tie the rotations at the common reference surface
    - BUG: `BladeStiff1D` torsion with `GJ = 4 bf D66` and coupling `S1` with the condensed stiffness about the mid-plane of the flange; `StiffPanelBay.calc_kA` no longer skew-symmetrizes; one load per panel in the cylinder assembly functions; `MultiDomain.force_out_plane` and `MultiDomain.plot` fixed
    - Documentation of the theory in the docstrings, new page on the TSDT with an offset, validation notebook of the snap-through of a shallow circular arch (Fung and Kaplan, 1952); the rotations of the von Kármán terms take the sign of the rotations of the normal, `beta_x = -w,x`, results unchanged
    - Requires `composites>=0.10.0` and `structsolve>=0.9.3`, whose residual is `R = F_int - F_ext`, as in the documentation of `panels`, and whose arc-length steps no longer double back along the path (since 0.9.2)
* version 0.13.11 (2026-10-16)
    - BUG: the analytical constitutive stiffness matrix of the CLPT models ignored `force_orthotropic_laminate`, inconsistently with the internal forces and the numerical matrices
    - `Shell.ABD` is calculated from the laminate and read-only; new attribute `Shell.ABDnxny` for a stiffness that is not that of the laminate, constant or one matrix per integration point, used by all the kernels, also within a `MultiDomain`, and by `Shell.stress()`, and checked to have symmetric blocks as any laminate; new `Shell.integration_points()`
    - Documentation: the derivation of the tangent stiffness matrix of the CLPT models with Donnell kinematics, formerly a LaTeX file, is part of the theory page of the tangent stiffness
    - `Shell.calc_kTv()` and `MultiDomain.calc_kTv()`: product of the tangent stiffness matrix by a vector without assembling it, for all the models, at the cost of one evaluation of the internal forces; used for the displacement control with prescribed displacements imposed exactly
    - The numerically integrated kernels evaluate the approximation functions once per integration point instead of in their innermost loops, with identical results: the non-linear matrices, the connections, the cohesive zone and the stiffeners are assembled several times faster
    - Cohesive zone `'SB_TSL'`: rules of the discretisation of the cohesive domain, `tsl_resolution()`, `tsl_margin()` and `tsl_discretization()`, and a warning when the cohesive domain is under-resolved; the decay rate of the opening is `(k_o (1/D11_1 + 1/D11_2)/4)**0.25`, `(k_o/(2 D11))**0.25` for the symmetric DCB (the tag 0.13.9 used the rate of one panel on a rigid foundation, `(k_o/(4 D11))**0.25`), and the margin ahead of the crack front is `3 l_cz + 8/lambda`
    - No upper limit for the number of Gauss-Legendre points of `MultiDomain.calc_results()` and `MultiDomain.force()`
    - `calc_kw_tsl()` requires `k_i`, `tau_o` and `G1c`
    - Maintenance: `.gitignore` without the runs of `thesis_timing.py`
    - Requires `structsolve>=0.8.0`
* version 0.12.0 (2026-10-14)
    - Prescribed displacements imposed exactly with the null-space method, `MultiDomain(..., pd_method='null-space')`, as inhomogeneous linear constraints `c = Z c_r + c_p0 + lbd*c_p1`: linear static, linear buckling, Newton-Raphson and arc-length analyses under displacement control, reactions `MultiDomain.reaction_pd()` and `MultiDomain.reaction_resultant()`, also for a single `Shell`; prescribed rotations; the penalty method remains the default
    - BUG: `fkCld_xcte` and `fkCld_ycte` placed the penalty stiffnesses of `ku` and `kv` at the rows and columns of `w`
    - Requires `structsolve>=0.7.0`
* version 0.11.1 (2026-10-08)
    - Saving and loading in a zip file with JSON and NumPy arrays, replacing pickle: `Shell.save()`, `StiffPanelBay.save()`, `MultiDomain.save()`, also to `io.BytesIO`, and `panels.json_io`
    - Pyodide support: `await micropip.install("panels")` in the browser, and the whole test suite runs in Pyodide in GitHub Actions
    - Requires `composites>=0.9.21` and `structsolve>=0.6.1`
* version 0.11.0 (2026-10-07)
    - Follower (hydrostatic) pressure loads, `Shell.add_pressure_load(..., follower=True)`, with the unsymmetric load stiffness `kCfollower` in `Shell` and `MultiDomain`
    - Theory documentation, verification tests and validation notebooks of the follower pressure
    - Interactive 3D plots of multi-domain assemblies with plotly, `MultiDomain.plot3d()`
    - Improved Cython and compiler flags
    - TSDT uses `Laminate.Dts` and `Laminate.Fts`, requires `composites>=0.9.12` and `structsolve>=0.5.0`
* version 0.9.0 (2026-09-24)
    - Null-space connection, exact, new default, as alternative to penalty-based connection
* version 0.8.0 (2026-09-23)
    - FSDT and TSDT for plate and cylindrical shells
    - Sanders-Koiter for cylindrical shells
    - Shell and Multidomain connections supporting FSDT, TSDT and Sanders-Koiter kinematics
    - Many improvements in the documentation
    - New tests based on literature
    - BUG fixes on aerodynamic matrix of cylindrical shells and mass matrix of stiffener 1D
* version 0.7.1 (2026-09-21)
    - Fixed the cohesive zone of the `MultiDomain` connection `'SB_TSL'`,
      which could not capture the onset of failure of the DCB: tangential
      separation with the rotation of each panel, tractions with the
      uncorrected separation and separation correction as in the thesis of
      D'Souza (2024)
    - Consistent tangent of the cohesive zone, `MultiDomain.calc_kT_TSL()`,
      and faster assembly of the `'SB_TSL'` secant stiffness
    - The kernels `fkCSB11_dmg`, `fkCSB12_dmg` and `fkCSB22_dmg` take the
      distances `dt` and `db` from each mid-surface to the interface
    - Validation of the cohesive zone against mode I DCB results in the
      literature, in notebooks, with a convergence study
    - Fixed `StiffPanelBay.save()` with `composites>=0.9.0`
* version 0.6.21 (2026-09-18)
    - Fixed the mass of the base of `BladeStiff2D`, which was missing, and the
      section forces of `MultiDomain.force()`, which lacked the Jacobian
    - `StiffPanelBay.calc_kA()` sums the contribution of every panel, and
      `calc_kA`, `calc_cA`, `calc_fext`, `save`, `get_size` and
      `uvw_stiffener` of `StiffPanelBay` and `Shell.calc_cA` no longer raise
    - `Shell.strain()` and `Shell.stress()` work for a plate with `r=None`
    - Line coverage of the tests raised from 67 % to 92 %
    - Fixed `StiffPanelBay.add_panel` and the partial-domain integration of
      `Shell.calc_kC`, `calc_kG` and `calc_kM`
    - The limits `Shell.x1, x2, y1, y2` of the integration domain default to
      `None` instead of the sentinels `-1` and `+1`, which silently integrated
      the full domain for a limit at `1.0` and ignored a limit given on one
      side only; the old `-1` now raises
    - Fixed the `MultiDomain` skin-base connections: the `'SB'` penalty was a
      hard-coded mm-unit value, the top and bottom panels depended on their
      order in the assembly, and the connection dictionaries were modified
    - Penalty constants of each `MultiDomain` connection can be given with
      `'kt'` and `'kr'`
    - Reproduction of Stamatelos and Labeas with plate domains only in
      `tests/multidomain/test_stamatelos_labeas_2023_multidomain.py`, using
      every `MultiDomain` connection
    - Fixed the argument handling of the stiffness API: an invalid `c` or
      `c_cte` no longer reaches the nogil kernels, and a model that needs a
      radius raises instead of computing with `r = 0`
    - Reproduction of Stamatelos and Labeas (Computation 2023, 11, 110) in
      a notebook
    - Tangent stiffness matrix that is the exact derivative of the internal
      force vector, giving quadratic convergence to the Newton-Raphson method
    - `Shell` and `MultiDomain` can be passed directly to
      `structsolve.Analysis`, including the arc-length methods
    - Gauss-Legendre points and weights from `scipy.special.roots_legendre`
    - Modules of the models renamed without the `_bardell` suffix, and the
      legacy `_bardell` model names removed from `panels.modelDB.db`
    - Sphinx documentation with usage examples
* versions 0.5.x
    - Damaged multidomain connections
* up to version 0.3.x
    - Multidomain methods for pristine structures


License
=======

Distributed under the 3-Clause BSD license
(https://raw.github.com/saullocastro/panels/main/LICENSE).

Contact: S.G.P.Castro@tudelft.nl
