Metadata-Version: 2.4
Name: pyfe3d
Version: 0.12.0
Summary: General-purpose finite element solver for structural analysis and optimization based on Python and Cython
Author-email: "Saullo G. P. Castro" <S.G.P.Castro@tudelft.nl>
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/saullocastro/pyfe3d
Project-URL: Documentation, https://saullocastro.github.io/pyfe3d/
Project-URL: Repository, https://github.com/saullocastro/pyfe3d
Keywords: finite elements,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 :: POSIX :: BSD
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: Unix
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
License-File: AUTHORS
Requires-Dist: numpy
Requires-Dist: scipy
Dynamic: license-file

General-purpose finite element solver - pyfe3d
==============================================

Github Actions status:

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

Coverage status:

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

About pyfe3d
------------

The ``pyfe3d`` module is a general-purpose finite element solver for structural
analysis and optimization based on Python and Cython. The main principles
guiding the development of ``pyfe3d`` are: simplicity, efficiency and
compatibility. The aimed level of compatibility allows one to run this solver
in any platform, including the Google Colab environment.


Citing this library
-------------------

Saullo G. P. Castro. (2026). General-purpose finite element solver based on Python and Cython (Version 0.12.0). Zenodo. DOI: https://doi.org/10.5281/zenodo.6573489.


Documentation
-------------

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


Important features of this library
----------------------------------
- efficient and simple for linear and nonlinear analyses
- importable and cimportable code
- 6 degrees-of-freedom per node
- linear static analyses, also of unsupported structures with inertia
  relief, balancing the loads with the inertia forces of the rigid-body
  accelerations (`pyfe3d.solver.apply_inertia_relief`)
- linear buckling, natural frequency and damped (complex) frequency
  analyses, with verified eigenvalues
- geometrically non-linear static analyses with the Newton-Raphson method
  and the arc-length methods of Riks and Crisfield, configuration-dependent
  loads and prescribed displacements
- large rotations with the element-independent co-rotational formulation
  of `pyfe3d.corotational`, for every element
- cross-sectional analysis of composite beams with `pyfe3d.vabs`, whose
  6x6 sectional stiffness matrix, with all its couplings, is taken by the
  beam elements


Available finite elements
-------------------------
- 'Quad4' - 4-node plate with linear interpolation, equivalent to Nastran's
  CQUAD4, with the MITC4 transverse shear of Dvorkin and Bathe (1984) by
  default. The recommended quadrilateral plate element.

- 'Quad4R' - 4-node plate with linear interpolation and one integration point,
  with the physical stabilisation of Belytschko and Leviathan (1994) for the
  bending and the transverse shear, and the hourglass control of Brockman
  (1987) for the membrane.

- 'Tria3DSG' - 3-node plate with linear interpolation and a discrete shear
  gap transverse shear field, after Bletzinger, Bischoff and Ramm (2000), free
  of shear locking by construction and without a tuning parameter, with a
  constant-strain membrane. The better choice on coarse meshes of doubly
  curved shells, where it is less stiff than Tria3R.

- 'Tria3R' - 3-node shell with linear interpolation, the recommended
  triangular element. Since 0.12.0 it takes the discrete shear gap transverse
  shear field of Tria3DSG by default, with the membrane enriched by the
  drilling rotations of Allman (1984), which makes
  it much better than Tria3DSG in in-plane bending. Its former transverse
  shear, sampled at the centroid and stabilised by `alpha_shear_locking`,
  remains available with `shear_model = 0`, but it does not converge on thin
  plates and shells, see the element documentation.

- 'BeamC' - 2-node Timoshenko beam element with consistent shape functions and
analytical integration, exact under nodal loads for any sectional stiffness
matrix. The recommended beam element.

- 'BeamLR' - 2-node Timoshenko beam element with linear interpolation and
reduced integration. 

- 'Spring' - 2-node spring element with 6 stiffenesses defined in the element
  coordinate system.

- 'Truss' - 2-node truss element with only axial and torsion stiffness. I
recommend using the BeamLR instead, which is physically more consistent.


Development history
-------------------

See [CHANGELOG.md](CHANGELOG.md) for the details of each version.

| Main versions | Changes |
| - | - |
| 0.12.0 | New module `pyfe3d.vabs`: variational asymptotic cross-sectional analysis (VABS) of prismatic beams with arbitrary cross sections and anisotropic materials, giving the classical 4x4 and the generalized Timoshenko 6x6 stiffness matrices, the tension and shear centres and the mass properties, with the conversion to the convention of pyfe3d and to a `BeamProp`; general 6x6 sectional stiffness matrix `BeamProp.C` of the beams, with BeamC exact under nodal loads for any coupling; new module `pyfe3d.corotational`, an element-independent co-rotational formulation for large rotations; inertia relief with `apply_inertia_relief()`; MITC4 transverse shear of Quad4 by default; physical hourglass stabilisation of Quad4R; discrete shear gap transverse shear of Tria3R by default; rigid offsets of warped quadrilaterals; eigenvalue solvers that complete missing eigenvalues. |
| 0.11.0 | Non-linear static solvers in `pyfe3d.solver` (Newton-Raphson, arc-length methods of Riks and Crisfield, Crisfield's convergence criterion as the default, with a round-off floor of the residual); damped (quadratic) eigenvalue solver `complex_frequency()`; fixed sign of the shear parameters of BeamC; fixed piston-theory slope of Quad4 and Quad4R; fixed `MatLamina` `c11` and `q31` and the 66 row of `GradABD.calc_LP_grad`; `pyfe3d.shellprop` mirrors `composites.Laminate` (breaking: `force_*` renamed `make_*`, `get_transf_matrix_displ_to_lamina`; new shear corrections, `make_smeared`, a posteriori transverse shear); derivation scripts in `theory/`. |
| 0.10.0 | New Tria3DSG element with discrete shear gap transverse shear, the recommended triangle; physics-based drilling stiffness (Allman, Hughes-Brezzi) as the default, with the K6ROT penalty kept through `drilling_model`; fixed lost K6ROT coefficient; new `pyfe3d.solver` module for linear buckling and natural frequencies; speedup with Cython and compiler flags. |
| 0.9.0 | Shear correction factors as per Rohwer and Vlachoutsis. |
| 0.8.0 | KCNL matrix for all elements, with more accurate nonlinear analyses; fixed KC0 and KG for beams; fixed KC0 for Tria3R. |
| 0.7.0 | Drilling stiffness re-coupled with in-plane rotation using K6ROT; fixed drilling stiffness integration; restored missing `pid` attribute. |
| 0.6.4 | Internal force vectors (finte) for all elements; fixed drilling stiffness (K6ROT) scaling; added Python 3.14 and removed Python 3.8 support; Linux wheels limited to 64-bit;  Exposed update_probe_finte to Python; new documentation examples. |
| 0.5.2 | New Quad4 element; K6ROT drilling stiffness; probe.update_BL; removed alg3dpy dependency; topology optimization tutorial  |
| 0.4.28 | Piston theory aerodynamics for Quad4R; fixed array casting on some systems; Quad4R less sensitive to small element sizes; new `pid` attribute for elements; exposed element orientation vectors; Python 3.12 support; fixed build for Linux and macOS wheels. |
| 0.3.24 | New Tria3R element; fixed BeamC formulation; fixed beam torsion stiffness; fixed lamination parameters and added their gradients; fixed lumped mass for Tria3R; removed dependency on the NumPy C API; OpenMP build fixes; improved Zenodo metadata and documentation layout; Python 3.10 support. |
| 0.2.8 | Material coordinate systems for plate elements; Fixed Truss mass matrix; more aggressive Cython directives; license changed to 3-clause BSD; license info in README, author metadata updates. |
| 0.1.16 | New Spring element; Rotation matrices using direct `rij` terms instead of Euler angles; renamed `update_xe` to `update_probe_xe`; `probe` made a public attribute; KG with a given stress state; renamed `update_ue` to `update_probe_ue` |
| 0.1.3 | First release: Quad4R, BeamC, BeamLR and Truss elements; shell properties; linear buckling |



Installing pyfe3d
-----------------

First, you should try to install from the distributed binaries by simply doing:

```
python -m pip install pyfe3d
```

If a distribution could not be found, you can try to install from the source
code using:

```
python -m pip install .
```

Another alternative is the following:

```
python -m pip install -r requirements.txt
python -m pip install --no-build-isolation .
```

If none of the above alternatives worked for you, this link shares some
information on how to set up a C compiler on different operating systems: 

https://cython2.readthedocs.io/en/latest/src/quickstart/install.html


License
-------
Distrubuted under the 3-Clause BSD license
(https://raw.github.com/saullocastro/pyfe3d/main/LICENSE):

    Copyright (c) 2021-2026, Saullo G. P. Castro (S.G.P.Castro@tudelft.nl)
    All rights reserved.

    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

    3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Contacts:
- Saullo G. P. Castro, S.G.P.Castro@tudelft.nl

