Skip to main content

Python library for ply-wise stress, strain, and failure analysis of anisotropic laminates.

Project description

3pc-lamfail

3pc-lamfail is a Python library used for ply-wise stress and strain analysis of shear deformable anisotropic laminates under hygrothermal and mechanical loads. It provides a Lamfail class to calculate stresses, strains, and various margins of safety (MS) based on classical and first-order shear deformation theories.

Installation

Use the package manager pip to install 3pc-lamfail. Since the package and its dependencies are available on PyPI, you can install them directly:

pip install 3pc-lamfail

API Reference

Lamfail Class

The primary component of this package is the Lamfail class, which takes a panel and a load case to compute detailed failure metrics.

from lamfail.lamfail import Lamfail

Required Parameters

When initializing Lamfail, the following parameters are required:

  • panel (Panel): An instance of the Panel class (from 3pc-panel) containing the laminate definition and geometry.
  • loads (Loads): An instance of the Loads class (from 3pc-loads) containing the load case and environmental conditions.

Calculated Properties

The class automatically calculates the following properties lazily:

  • NT, MT: Thermal in-plane loads and moments.
  • NC, MC: Hygral in-plane loads and moments.
  • ek0: Mid-plane strains and curvatures [ex0, ey0, gxy0, kx0, ky0, kxy0].
  • gT0: Mid-plane transverse strains [gyz0, gxz0].
  • tauyz, tauxz: Transverse shear stresses for each ply.
  • stress: Total stress in reference coordinate axes (x-y-z) for each ply (bottom, mid, top).
  • stressM, stressT, stressH: Mechanical, thermal, and hygral components of stress in reference axes.
  • stress1, stressM1, stressT1, stressH1: Stresses transformed to material coordinate axes (1-2-3).
  • strain, strainM, strainT, strainH: Strains in reference coordinate axes.
  • strain1, strainM1, strainT1, strainH1: Strains in material coordinate axes.

Margins of Safety (MS)

The following failure theories are implemented:

  • stress1MS: Max Stress theory using total stress.
  • stressM1MS: Max Stress theory using mechanical stress.
  • strain1MS: Max Strain theory using total strain.
  • strainM1MS: Max Strain theory using mechanical strain.
  • tsaiHill1MS, tsaiHillM1MS: Tsai-Hill failure theory (Total/Mechanical).
  • tsaiWu1MS, tsaiWuM1MS: Tsai-Wu failure theory (Total/Mechanical).

Methods

Lamfail.fromDict(**kwargs)

Initializes a Lamfail instance using a dictionary of keyword arguments.


Usage Examples

Basic Initialization

Below is an example of performing a failure analysis on a panel under a specific load case.

from panel.panel import Panel
from loads.loads import Loads
from lamfail.lamfail import Lamfail

# Assuming pnl (Panel) and ld (Loads) are already defined
lf = Lamfail(panel=pnl, loads=ld)

# Access Margins of Safety for Ply 1 (bottom ply)
print("Max Stress MS (Material Axes):", lf.stress1MS["1"]["mid"])
print("Tsai-Wu MS:", lf.tsaiWu1MS["1"]["mid"])

# Access stresses
print("Total Stress (x-y-z):", lf.stress["1"]["top"])

Commands

The package provides a command-line interface entry point. After installing, you can run the application using:

lamfail input.cfg

(This entry point is defined in lamfail.__main__:main)

Options

  • config (positional): Specify the configuration file (.cfg) to run the analysis.
  • -h, --help: Show the help message and exit.
  • -v, --version: Show the version number.
  • -s, --sample: Copy example files (materials, plies, laminates, etc.) to the current directory.

Citation

If you use this library in your research or work, please cite it as follows:

APA Format:

Rastogi, N., & Seresta, O. (2026). 3pc-lamfail: Python library for ply-wise stress, strain, and failure analysis of anisotropic laminates. PyPI. https://pypi.org/project/3pc-lamfail/

BibTeX:

@software{3pc_lamfail,
  author = {Rastogi, Naveen and Seresta, Omprakash},
  title = {3pc-lamfail: Python library for ply-wise stress, strain, and failure analysis of anisotropic laminates},
  year = {2026},
  url = {https://pypi.org/project/3pc-lamfail/}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

3pc_lamfail-1.0.3.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

3pc_lamfail-1.0.3-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file 3pc_lamfail-1.0.3.tar.gz.

File metadata

  • Download URL: 3pc_lamfail-1.0.3.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for 3pc_lamfail-1.0.3.tar.gz
Algorithm Hash digest
SHA256 6b6e0769cdea270a390163712f0c656dd99ce602ef6474bf471e14f1f7d050f5
MD5 d78263386771ab045fc8398bf2e45272
BLAKE2b-256 495e772de9ecd13a91e7f535221fb0f78f25992fa38818c7ef462d9d7d472786

See more details on using hashes here.

File details

Details for the file 3pc_lamfail-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: 3pc_lamfail-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for 3pc_lamfail-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8e6b1bebbde814e1446d82cd1cc28b39eecaa83cb31683d09020a4f10c62501f
MD5 50e466c33eb8dfb3f0b073e3d22d503a
BLAKE2b-256 8473dd716cb87f353a282e70c86605da803016e60ab79d4c95318eeea59372b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page