lamkit 0.1.0__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. {lamkit-0.1.0 → lamkit-0.1.2}/.gitignore +4 -0
  2. lamkit-0.1.2/PKG-INFO +155 -0
  3. lamkit-0.1.2/README.md +98 -0
  4. lamkit-0.1.2/docs/api.rst +69 -0
  5. lamkit-0.1.2/docs/examples.rst +40 -0
  6. lamkit-0.1.2/docs/index.rst +19 -0
  7. lamkit-0.1.2/docs/installation.rst +39 -0
  8. lamkit-0.1.2/docs/quickstart.rst +55 -0
  9. {lamkit-0.1.0 → lamkit-0.1.2}/example/4-effective-stiffness/example_effective_stiffness.py +100 -15
  10. lamkit-0.1.2/example/4-effective-stiffness/images/open_hole_displacements-1.png +0 -0
  11. lamkit-0.1.2/example/4-effective-stiffness/images/open_hole_displacements-2.png +0 -0
  12. lamkit-0.1.2/example/4-effective-stiffness/images/open_hole_displacements-3.png +0 -0
  13. lamkit-0.1.2/example/4-effective-stiffness/images/open_hole_displacements-4.png +0 -0
  14. lamkit-0.1.2/example/4-effective-stiffness/images/open_hole_homogenisation-1.png +0 -0
  15. lamkit-0.1.2/example/4-effective-stiffness/images/open_hole_homogenisation-2.png +0 -0
  16. lamkit-0.1.2/example/4-effective-stiffness/images/open_hole_homogenisation-3.png +0 -0
  17. lamkit-0.1.2/example/4-effective-stiffness/images/open_hole_homogenisation-4.png +0 -0
  18. {lamkit-0.1.0 → lamkit-0.1.2}/example/6-laminate-optimization-task/example_laminate_opt_function.py +57 -5
  19. {lamkit-0.1.0 → lamkit-0.1.2}/example/6-laminate-optimization-task/output.txt +18 -4
  20. lamkit-0.1.2/example/7-layup-feasibility/example_layup_feasibility.py +48 -0
  21. lamkit-0.1.2/example/7-layup-feasibility/output.txt +12 -0
  22. {lamkit-0.1.0 → lamkit-0.1.2}/pyproject.toml +10 -7
  23. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/__init__.py +5 -3
  24. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/analysis/laminate.py +61 -0
  25. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/analysis/material.py +15 -9
  26. lamkit-0.1.2/src/lamkit/components/build_layup_database.py +337 -0
  27. lamkit-0.1.2/src/lamkit/layup/__init__.py +0 -0
  28. lamkit-0.1.2/src/lamkit/layup/feasibility.py +133 -0
  29. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/lekhnitskii/homogenisation.py +40 -18
  30. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/utils.py +17 -0
  31. {lamkit-0.1.0 → lamkit-0.1.2}/tests/test_laminate.py +1 -0
  32. lamkit-0.1.0/PKG-INFO +0 -80
  33. lamkit-0.1.0/README.md +0 -23
  34. lamkit-0.1.0/docs/api.rst +0 -7
  35. lamkit-0.1.0/docs/index.rst +0 -12
  36. lamkit-0.1.0/docs/installation.rst +0 -16
  37. lamkit-0.1.0/docs/quickstart.rst +0 -8
  38. lamkit-0.1.0/example/4-effective-stiffness/images/open_hole_homogenisation-1.png +0 -0
  39. lamkit-0.1.0/example/4-effective-stiffness/images/open_hole_homogenisation-2.png +0 -0
  40. lamkit-0.1.0/example/4-effective-stiffness/images/open_hole_homogenisation-3.png +0 -0
  41. lamkit-0.1.0/example/4-effective-stiffness/images/open_hole_homogenisation-4.png +0 -0
  42. {lamkit-0.1.0 → lamkit-0.1.2}/LICENSE +0 -0
  43. {lamkit-0.1.0 → lamkit-0.1.2}/MANIFEST.in +0 -0
  44. {lamkit-0.1.0 → lamkit-0.1.2}/docs/Makefile +0 -0
  45. {lamkit-0.1.0 → lamkit-0.1.2}/docs/_static/.gitkeep +0 -0
  46. {lamkit-0.1.0 → lamkit-0.1.2}/docs/_templates/.gitkeep +0 -0
  47. {lamkit-0.1.0 → lamkit-0.1.2}/docs/conf.py +0 -0
  48. {lamkit-0.1.0 → lamkit-0.1.2}/docs/make.bat +0 -0
  49. {lamkit-0.1.0 → lamkit-0.1.2}/docs/requirements.txt +0 -0
  50. {lamkit-0.1.0 → lamkit-0.1.2}/example/1-laminate/example_laminate.py +0 -0
  51. {lamkit-0.1.0 → lamkit-0.1.2}/example/1-laminate/images/laminate_bending_0-90-90-0.png +0 -0
  52. {lamkit-0.1.0 → lamkit-0.1.2}/example/1-laminate/images/laminate_membrane_0-90-90-0.png +0 -0
  53. {lamkit-0.1.0 → lamkit-0.1.2}/example/1-laminate/images/laminate_membrane_45-pm45-symmetric.png +0 -0
  54. {lamkit-0.1.0 → lamkit-0.1.2}/example/2-lekhnitskii-solution/example_unloaded_hole.py +0 -0
  55. {lamkit-0.1.0 → lamkit-0.1.2}/example/2-lekhnitskii-solution/images/open_hole_1.png +0 -0
  56. {lamkit-0.1.0 → lamkit-0.1.2}/example/2-lekhnitskii-solution/images/open_hole_2.png +0 -0
  57. {lamkit-0.1.0 → lamkit-0.1.2}/example/2-lekhnitskii-solution/images/open_hole_3.png +0 -0
  58. {lamkit-0.1.0 → lamkit-0.1.2}/example/2-lekhnitskii-solution/images/open_hole_4.png +0 -0
  59. {lamkit-0.1.0 → lamkit-0.1.2}/example/2-lekhnitskii-solution/images/open_hole_5.png +0 -0
  60. {lamkit-0.1.0 → lamkit-0.1.2}/example/2-lekhnitskii-solution/images/open_hole_6.png +0 -0
  61. {lamkit-0.1.0 → lamkit-0.1.2}/example/3-open-hole/example_open_hole.py +0 -0
  62. {lamkit-0.1.0 → lamkit-0.1.2}/example/3-open-hole/images/open_hole_face.png +0 -0
  63. {lamkit-0.1.0 → lamkit-0.1.2}/example/3-open-hole/images/open_hole_field.png +0 -0
  64. {lamkit-0.1.0 → lamkit-0.1.2}/example/5-laminate-buckling/example_buckling.py +0 -0
  65. {lamkit-0.1.0 → lamkit-0.1.2}/example/5-laminate-buckling/images/buckling_modes.png +0 -0
  66. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/analysis/__init__.py +0 -0
  67. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/analysis/buckling.py +0 -0
  68. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/analysis/larc05.py +0 -0
  69. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/components/_S.py +0 -0
  70. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/components/__init__.py +0 -0
  71. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/components/_ii_F.py +0 -0
  72. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/components/build_k.py +0 -0
  73. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/components/functions.py +0 -0
  74. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/components/write_pre_integrated_terms.py +0 -0
  75. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/components/write_shape_function.py +0 -0
  76. {lamkit-0.1.0/src/lamkit → lamkit-0.1.2/src/lamkit/layup}/requirements.py +0 -0
  77. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/lekhnitskii/__init__.py +0 -0
  78. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/lekhnitskii/hole.py +0 -0
  79. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/lekhnitskii/loaded_hole.py +0 -0
  80. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/lekhnitskii/unloaded_hole.py +0 -0
  81. {lamkit-0.1.0 → lamkit-0.1.2}/src/lamkit/lekhnitskii/utils.py +0 -0
  82. {lamkit-0.1.0 → lamkit-0.1.2}/tests/conftest.py +0 -0
  83. {lamkit-0.1.0 → lamkit-0.1.2}/tests/test_additional_coverage.py +0 -0
  84. {lamkit-0.1.0 → lamkit-0.1.2}/tests/test_buckling.py +0 -0
  85. {lamkit-0.1.0 → lamkit-0.1.2}/tests/test_larc05.py +0 -0
  86. {lamkit-0.1.0 → lamkit-0.1.2}/tests/test_lekhnitskii.py +0 -0
  87. {lamkit-0.1.0 → lamkit-0.1.2}/tests/test_material.py +0 -0
@@ -27,3 +27,7 @@ docs/_build/
27
27
  # IDE
28
28
  .idea/
29
29
  .vscode/
30
+
31
+ # Data
32
+
33
+ data/
lamkit-0.1.2/PKG-INFO ADDED
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.4
2
+ Name: lamkit
3
+ Version: 0.1.2
4
+ Summary: Toolkit for stress analysis and failure prediction of composite laminates with holes and joints.
5
+ Project-URL: Homepage, https://github.com/swayli94/lamkit
6
+ Project-URL: Documentation, https://swayli94.github.io/lamkit/
7
+ Project-URL: Repository, https://github.com/swayli94/lamkit
8
+ Project-URL: Issues, https://github.com/swayli94/lamkit/issues
9
+ Author: Runze Li
10
+ License: MIT License
11
+
12
+ Copyright (c) 2026 Runze LI
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ License-File: LICENSE
32
+ Keywords: bjsfm,buckling,composite,engineering,laminate,open-hole,stress analysis
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: Intended Audience :: Science/Research
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3 :: Only
39
+ Classifier: Programming Language :: Python :: 3.9
40
+ Classifier: Programming Language :: Python :: 3.10
41
+ Classifier: Programming Language :: Python :: 3.11
42
+ Classifier: Programming Language :: Python :: 3.12
43
+ Classifier: Topic :: Scientific/Engineering
44
+ Requires-Python: >=3.9
45
+ Requires-Dist: matplotlib>=3.7
46
+ Requires-Dist: numpy>=1.24
47
+ Requires-Dist: pandas>=2.0
48
+ Provides-Extra: dev
49
+ Requires-Dist: build>=1.2; extra == 'dev'
50
+ Requires-Dist: pytest>=8.0; extra == 'dev'
51
+ Requires-Dist: twine>=5.1; extra == 'dev'
52
+ Provides-Extra: docs
53
+ Requires-Dist: furo>=2024.8.6; extra == 'docs'
54
+ Requires-Dist: myst-parser>=4.0; extra == 'docs'
55
+ Requires-Dist: sphinx>=8.0; extra == 'docs'
56
+ Description-Content-Type: text/markdown
57
+
58
+ # lamkit
59
+
60
+ `lamkit` is a Python toolkit for composite laminate analysis, focused on:
61
+
62
+ - Laminate stress/strain response based on Classical Lamination Theory (CLT)
63
+ - LaRC05 failure index evaluation
64
+ - Lekhnitskii open-hole infinite-plate analytical solution
65
+ - Open-hole plate's effective (homogenisation) properties
66
+ - Linear buckling analysis of laminates
67
+ - Objective/constraint evaluation for laminate optimization tasks
68
+
69
+ ## Installation
70
+
71
+ ### Requirements
72
+
73
+ - Python `>=3.9`
74
+ - Core dependencies: `numpy`, `pandas`, `matplotlib`
75
+
76
+ ### Install from PyPI
77
+
78
+ ```bash
79
+ pip install lamkit
80
+ ```
81
+
82
+ ### Install for local development
83
+
84
+ ```bash
85
+ pip install -e .[dev,docs]
86
+ ```
87
+
88
+ ## Quick Start
89
+
90
+ The following example creates a laminate and evaluates ply-surface fields under membrane loading:
91
+
92
+ ```python
93
+ import numpy as np
94
+ from lamkit import Laminate, Ply
95
+ from lamkit.analysis.material import IM7_8551_7
96
+
97
+ ply = Ply(IM7_8551_7, thickness=0.125) # mm
98
+ stacking = [45, -45, 0, 90, 90, 0, -45, 45]
99
+ laminate = Laminate(stacking=stacking, plies=ply)
100
+
101
+ # N = [Nxx, Nyy, Nxy, Mxx, Myy, Mxy]
102
+ N = np.array([80.0, 0.0, 0.0, 0.0, 0.0, 0.0])
103
+ field = laminate.evaluate_laminate(N)
104
+
105
+ print(field[["index_ply", "index_surface", "z", "sigma_1", "sigma_2", "tau_12", "FI_max"]].head())
106
+ ```
107
+
108
+ ## Examples
109
+
110
+ The `example/` directory contains runnable scripts:
111
+
112
+ 1. **Laminate response (CLT + LaRC05)**
113
+ `example/1-laminate/example_laminate.py`
114
+ Computes through-thickness stress/strain and LaRC05 index distributions with plots.
115
+
116
+ 2. **Lekhnitskii unloaded-hole solution**
117
+ `example/2-lekhnitskii-solution/example_unloaded_hole.py`
118
+ Solves and visualizes open-hole stress fields.
119
+
120
+ 3. **Laminate open-hole field analysis**
121
+ `example/3-open-hole/example_open_hole.py`
122
+ Couples laminate equivalent compliance with open-hole fields and generates failure envelopes/boundary maps.
123
+
124
+ 4. **Effective stiffness with hole homogenization**
125
+ `example/4-effective-stiffness/example_effective_stiffness.py`
126
+ Compares laminate stiffness `A` (without hole) and homogenized stiffness `A_eff` (with hole).
127
+
128
+ 5. **Laminate linear buckling**
129
+ `example/5-laminate-buckling/example_buckling.py`
130
+ Computes buckling eigenvalues and saves buckling mode plots.
131
+
132
+ 6. **Optimization objective/constraint evaluation**
133
+ `example/6-laminate-optimization-task/example_laminate_opt_function.py`
134
+ Demonstrates combined displacement, failure, and buckling constraint evaluation for design tasks.
135
+
136
+ ## Common Development Commands
137
+
138
+ ### Run tests
139
+
140
+ ```bash
141
+ pytest
142
+ ```
143
+
144
+ ### Build distribution package
145
+
146
+ ```bash
147
+ python -m build
148
+ ```
149
+
150
+ ### Build documentation
151
+
152
+ ```bash
153
+ cd docs
154
+ sphinx-build -b html . _build/html
155
+ ```
lamkit-0.1.2/README.md ADDED
@@ -0,0 +1,98 @@
1
+ # lamkit
2
+
3
+ `lamkit` is a Python toolkit for composite laminate analysis, focused on:
4
+
5
+ - Laminate stress/strain response based on Classical Lamination Theory (CLT)
6
+ - LaRC05 failure index evaluation
7
+ - Lekhnitskii open-hole infinite-plate analytical solution
8
+ - Open-hole plate's effective (homogenisation) properties
9
+ - Linear buckling analysis of laminates
10
+ - Objective/constraint evaluation for laminate optimization tasks
11
+
12
+ ## Installation
13
+
14
+ ### Requirements
15
+
16
+ - Python `>=3.9`
17
+ - Core dependencies: `numpy`, `pandas`, `matplotlib`
18
+
19
+ ### Install from PyPI
20
+
21
+ ```bash
22
+ pip install lamkit
23
+ ```
24
+
25
+ ### Install for local development
26
+
27
+ ```bash
28
+ pip install -e .[dev,docs]
29
+ ```
30
+
31
+ ## Quick Start
32
+
33
+ The following example creates a laminate and evaluates ply-surface fields under membrane loading:
34
+
35
+ ```python
36
+ import numpy as np
37
+ from lamkit import Laminate, Ply
38
+ from lamkit.analysis.material import IM7_8551_7
39
+
40
+ ply = Ply(IM7_8551_7, thickness=0.125) # mm
41
+ stacking = [45, -45, 0, 90, 90, 0, -45, 45]
42
+ laminate = Laminate(stacking=stacking, plies=ply)
43
+
44
+ # N = [Nxx, Nyy, Nxy, Mxx, Myy, Mxy]
45
+ N = np.array([80.0, 0.0, 0.0, 0.0, 0.0, 0.0])
46
+ field = laminate.evaluate_laminate(N)
47
+
48
+ print(field[["index_ply", "index_surface", "z", "sigma_1", "sigma_2", "tau_12", "FI_max"]].head())
49
+ ```
50
+
51
+ ## Examples
52
+
53
+ The `example/` directory contains runnable scripts:
54
+
55
+ 1. **Laminate response (CLT + LaRC05)**
56
+ `example/1-laminate/example_laminate.py`
57
+ Computes through-thickness stress/strain and LaRC05 index distributions with plots.
58
+
59
+ 2. **Lekhnitskii unloaded-hole solution**
60
+ `example/2-lekhnitskii-solution/example_unloaded_hole.py`
61
+ Solves and visualizes open-hole stress fields.
62
+
63
+ 3. **Laminate open-hole field analysis**
64
+ `example/3-open-hole/example_open_hole.py`
65
+ Couples laminate equivalent compliance with open-hole fields and generates failure envelopes/boundary maps.
66
+
67
+ 4. **Effective stiffness with hole homogenization**
68
+ `example/4-effective-stiffness/example_effective_stiffness.py`
69
+ Compares laminate stiffness `A` (without hole) and homogenized stiffness `A_eff` (with hole).
70
+
71
+ 5. **Laminate linear buckling**
72
+ `example/5-laminate-buckling/example_buckling.py`
73
+ Computes buckling eigenvalues and saves buckling mode plots.
74
+
75
+ 6. **Optimization objective/constraint evaluation**
76
+ `example/6-laminate-optimization-task/example_laminate_opt_function.py`
77
+ Demonstrates combined displacement, failure, and buckling constraint evaluation for design tasks.
78
+
79
+ ## Common Development Commands
80
+
81
+ ### Run tests
82
+
83
+ ```bash
84
+ pytest
85
+ ```
86
+
87
+ ### Build distribution package
88
+
89
+ ```bash
90
+ python -m build
91
+ ```
92
+
93
+ ### Build documentation
94
+
95
+ ```bash
96
+ cd docs
97
+ sphinx-build -b html . _build/html
98
+ ```
@@ -0,0 +1,69 @@
1
+ API reference
2
+ =============
3
+
4
+ Top-level package
5
+ -----------------
6
+
7
+ .. automodule:: lamkit
8
+ :members:
9
+ :undoc-members:
10
+ :show-inheritance:
11
+
12
+ Analysis
13
+ --------
14
+
15
+ .. automodule:: lamkit.analysis.material
16
+ :members:
17
+ :undoc-members:
18
+ :show-inheritance:
19
+
20
+ .. automodule:: lamkit.analysis.laminate
21
+ :members:
22
+ :undoc-members:
23
+ :show-inheritance:
24
+
25
+ .. automodule:: lamkit.analysis.larc05
26
+ :members:
27
+ :undoc-members:
28
+ :show-inheritance:
29
+
30
+ .. automodule:: lamkit.analysis.buckling
31
+ :members:
32
+ :undoc-members:
33
+ :show-inheritance:
34
+
35
+ Lekhnitskii
36
+ -----------
37
+
38
+ .. automodule:: lamkit.lekhnitskii.hole
39
+ :members:
40
+ :undoc-members:
41
+ :show-inheritance:
42
+
43
+ .. automodule:: lamkit.lekhnitskii.unloaded_hole
44
+ :members:
45
+ :undoc-members:
46
+ :show-inheritance:
47
+
48
+ .. automodule:: lamkit.lekhnitskii.loaded_hole
49
+ :members:
50
+ :undoc-members:
51
+ :show-inheritance:
52
+
53
+ .. automodule:: lamkit.lekhnitskii.homogenisation
54
+ :members:
55
+ :undoc-members:
56
+ :show-inheritance:
57
+
58
+ Utilities and requirements
59
+ --------------------------
60
+
61
+ .. automodule:: lamkit.utils
62
+ :members:
63
+ :undoc-members:
64
+ :show-inheritance:
65
+
66
+ .. automodule:: lamkit.requirements
67
+ :members:
68
+ :undoc-members:
69
+ :show-inheritance:
@@ -0,0 +1,40 @@
1
+ Examples
2
+ ========
3
+
4
+ The repository contains runnable examples in the ``example/`` directory.
5
+
6
+ 1. Laminate response (CLT + LaRC05)
7
+ -----------------------------------
8
+
9
+ - Path: ``example/1-laminate/example_laminate.py``
10
+ - Computes laminate response through thickness and plots strain/stress/FI profiles.
11
+
12
+ 2. Lekhnitskii unloaded-hole solution
13
+ -------------------------------------
14
+
15
+ - Path: ``example/2-lekhnitskii-solution/example_unloaded_hole.py``
16
+ - Solves open-hole stress and displacement fields for a homogeneous equivalent plate.
17
+
18
+ 3. Open-hole laminate field
19
+ ---------------------------
20
+
21
+ - Path: ``example/3-open-hole/example_open_hole.py``
22
+ - Couples laminate equivalent compliance with open-hole field and LaRC05 envelopes.
23
+
24
+ 4. Effective stiffness with hole homogenisation
25
+ -----------------------------------------------
26
+
27
+ - Path: ``example/4-effective-stiffness/example_effective_stiffness.py``
28
+ - Compares laminate in-plane properties with homogenized open-hole effective properties.
29
+
30
+ 5. Laminate buckling
31
+ --------------------
32
+
33
+ - Path: ``example/5-laminate-buckling/example_buckling.py``
34
+ - Runs linear buckling eigenvalue analysis and saves mode-shape plots.
35
+
36
+ 6. Laminate optimization objective/constraints
37
+ ----------------------------------------------
38
+
39
+ - Path: ``example/6-laminate-optimization-task/example_laminate_opt_function.py``
40
+ - Demonstrates combined displacement/failure/buckling constraint evaluation.
@@ -0,0 +1,19 @@
1
+ lamkit documentation
2
+ ====================
3
+
4
+ `lamkit` is a Python toolkit for composite laminate analysis, including:
5
+
6
+ - classical laminate theory (CLT) stiffness and ply-level response
7
+ - LaRC05 failure index evaluation
8
+ - open-hole field prediction (Lekhnitskii solution)
9
+ - laminate plate linear buckling analysis
10
+ - layup engineering requirement checks
11
+
12
+ .. toctree::
13
+ :maxdepth: 2
14
+ :caption: Contents
15
+
16
+ installation
17
+ quickstart
18
+ examples
19
+ api
@@ -0,0 +1,39 @@
1
+ Installation
2
+ ============
3
+
4
+ Requirements
5
+ ------------
6
+
7
+ - Python 3.9+
8
+ - pip
9
+
10
+ Install from source
11
+ -------------------
12
+
13
+ .. code-block:: bash
14
+
15
+ pip install -e .[dev,docs]
16
+
17
+ Install from PyPI
18
+ -----------------
19
+
20
+ .. code-block:: bash
21
+
22
+ pip install lamkit
23
+
24
+ Optional runtime dependencies
25
+ -----------------------------
26
+
27
+ - Buckling analysis uses SciPy:
28
+
29
+ .. code-block:: bash
30
+
31
+ pip install scipy
32
+
33
+ Build documentation locally
34
+ ---------------------------
35
+
36
+ .. code-block:: bash
37
+
38
+ cd docs
39
+ sphinx-build -b html . _build/html
@@ -0,0 +1,55 @@
1
+ Quickstart
2
+ ==========
3
+
4
+ The package exports the main classes directly from ``lamkit``:
5
+
6
+ .. code-block:: python
7
+
8
+ from lamkit import Material, Ply, Laminate, LaRC05, Hole, UnloadedHole
9
+
10
+ Build a simple laminate and evaluate ply-level response:
11
+
12
+ .. code-block:: python
13
+
14
+ import numpy as np
15
+ from lamkit import Laminate, Ply
16
+ from lamkit.analysis.material import IM7_8551_7
17
+
18
+ ply = Ply(IM7_8551_7, thickness=0.125)
19
+ stacking = [0.0, 45.0, -45.0, 90.0, 90.0, -45.0, 45.0, 0.0]
20
+ lam = Laminate(stacking=stacking, plies=ply)
21
+
22
+ # [Nxx, Nyy, Nxy, Mxx, Myy, Mxy]
23
+ N = np.array([80.0, 0.0, 0.0, 0.0, 0.0, 0.0])
24
+ field = lam.evaluate_laminate(N)
25
+
26
+ print(field[["index_ply", "index_surface", "sigma_1", "FI_max"]].head())
27
+ print("global FI_max =", field.attrs["global_FI_max"])
28
+
29
+ Evaluate an open-hole plate for the same laminate:
30
+
31
+ .. code-block:: python
32
+
33
+ import numpy as np
34
+ from lamkit.utils import evaluate_unloaded_hole_plate
35
+ from lamkit.lekhnitskii.utils import generate_meshgrid
36
+
37
+ mesh = generate_meshgrid(
38
+ hole_radius=1.0,
39
+ plate_radius=8.0,
40
+ n_points_radial=121,
41
+ n_points_angular=121,
42
+ )
43
+
44
+ results_by_plies, mid_plane = evaluate_unloaded_hole_plate(
45
+ laminate=lam,
46
+ hole_radius=1.0,
47
+ sigma_xx_inf=100.0,
48
+ sigma_yy_inf=0.0,
49
+ tau_xy_inf=0.0,
50
+ x=mesh["X"],
51
+ y=mesh["Y"],
52
+ )
53
+
54
+ print("mid-plane sigma_x max =", np.max(mid_plane["sigma_x"]))
55
+ print("ply-surface FI_max max =", max(np.max(p["FI_max"]) for p in results_by_plies))
@@ -96,6 +96,10 @@ def calculate_effective_properties(laminate: Laminate,
96
96
  'A_eff': properties_eff['A_eff'],
97
97
  'S_lam': S_lam,
98
98
  'S_eff': properties_eff['S_eff'],
99
+ 'disp_right_list': properties_eff['disp_right_list'],
100
+ 'disp_left_list': properties_eff['disp_left_list'],
101
+ 'disp_top_list': properties_eff['disp_top_list'],
102
+ 'disp_bottom_list': properties_eff['disp_bottom_list'],
99
103
  }
100
104
 
101
105
  for key in ['E11', 'E22', 'G12', 'nu12']:
@@ -153,26 +157,30 @@ def print_comparison(results: Dict[str, Any]) -> None:
153
157
  def main() -> None:
154
158
 
155
159
  # Example laminate (quasi-isotropic).
160
+ layup = [0]
161
+ layup = [90]
162
+ layup = [45, -45, 0, 90, 90, 0, -45, 45]
156
163
  layup = [45, -45, 0, -45, 45, 0, 0, 90, 90, 0, 0, 45, -45, 0, -45, 45]
157
- ply_thickness_mm = 0.125
158
-
159
- ply = Ply(material=IM7_8551_7, thickness=ply_thickness_mm)
160
- laminate = Laminate(stacking=layup, plies=ply)
161
164
 
162
165
  # Plot ratio curves of effective properties vs. laminate reference.
163
166
  # {prop}_eff / {prop}_lam, where prop in [E11, E22, G12, nu12].
164
167
  properties = ["E11", "E22", "G12", "nu12"]
165
168
 
166
- r_list = [1, 10] # mm
167
- w_r_ratios = [2.2, 2.4, 2.6, 2.8, 3.0, 3.5, 4, 5] + [i for i in range(6, 21, 2)] # w/r ratio
169
+ case_list = [(1, 0.1), (2, 1.0)] # (r_mm, ply_thickness_mm)
170
+ w_r_ratios = [2.1, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5,
171
+ 5, 6, 7, 8, 10, 12, 14, 16, 18, 20, 25, 30, 35, 40, 45, 50] # w/r ratio
168
172
 
169
- # ratios[prop][i_r, i_wr] = prop_eff / prop_lam
173
+ # ratios[prop][i_curve, i_wr] = prop_eff / prop_lam
170
174
  ratios: Dict[str, np.ndarray] = {
171
- prop: np.zeros((len(r_list), len(w_r_ratios)), dtype=float)
175
+ prop: np.zeros((len(case_list), len(w_r_ratios)), dtype=float)
172
176
  for prop in properties
173
177
  }
174
178
 
175
- for i_r, r_mm in enumerate(r_list):
179
+ for i_curve, (r_mm, ply_thickness_mm) in enumerate(case_list):
180
+
181
+ ply = Ply(material=IM7_8551_7, thickness=ply_thickness_mm)
182
+ laminate = Laminate(stacking=layup, plies=ply)
183
+
176
184
  for i_wr, w_r_ratio in enumerate(w_r_ratios):
177
185
  w_plate_mm = float(w_r_ratio) * float(r_mm)
178
186
 
@@ -189,26 +197,26 @@ def main() -> None:
189
197
  for prop in properties:
190
198
  lam_val = float(results[f"{prop}_lam"])
191
199
  eff_val = float(results[f"{prop}_eff"])
192
- ratios[prop][i_r, i_wr] = eff_val / (lam_val + 1e-30) # avoid division-by-zero
200
+ ratios[prop][i_curve, i_wr] = eff_val / (lam_val + 1e-30) # avoid division-by-zero
193
201
 
194
202
  # --- Plot (2x2 subplots) ---
195
203
  fig, axes = plt.subplots(2, 2, figsize=(12, 9), sharex=True)
196
204
  axes_flat = axes.ravel()
197
205
 
198
206
  for ax, prop in zip(axes_flat, properties):
199
- for i_r, r_mm in enumerate(r_list):
207
+ for i_curve, (r_mm, ply_thickness_mm) in enumerate(case_list):
200
208
  ax.plot(
201
209
  w_r_ratios,
202
- ratios[prop][i_r, :],
210
+ ratios[prop][i_curve, :],
203
211
  marker="o",
204
212
  linewidth=1.8,
205
- label=f"r={r_mm} mm",
213
+ label=f"r={r_mm} mm, t_ply={ply_thickness_mm} mm",
206
214
  )
207
215
 
208
216
  ax.set_title(prop)
209
217
  ax.set_xlabel("w/r")
210
218
  ax.set_ylabel(f"Ratio of {prop}")
211
- ax.set_xlim(2, 21)
219
+ ax.set_xlim(2, 51)
212
220
  ax.grid(True, alpha=0.3)
213
221
  ax.legend(fontsize="small")
214
222
 
@@ -221,9 +229,86 @@ def main() -> None:
221
229
 
222
230
  out_path = os.path.join(path, "images", "open_hole_homogenisation.png")
223
231
  fig.savefig(out_path, dpi=200)
224
- print(f"Saved plot: {out_path}")
232
+
233
+ # Plot ratio curves of displacements at the boundaries vs. laminate reference.
234
+
235
+ w_r_ratios = [2.1, 2.5, 3, 5, 10] # w/r ratio
236
+ r_mm = 1.0
237
+ colors = ['red', 'orange', 'green', 'blue', 'purple']
238
+ n_points_boundary = 101
239
+ magnitude_factor = 1e4
240
+
241
+ ply = Ply(material=IM7_8551_7, thickness=1.0)
242
+ laminate = Laminate(stacking=layup, plies=ply)
243
+
244
+ fig, axes = plt.subplots(1, 3, figsize=(12, 6), sharex=True)
245
+ axes_flat = axes.ravel()
225
246
 
247
+ for i_wr, w_r_ratio in enumerate(w_r_ratios):
248
+
249
+ w_plate_mm = float(w_r_ratio) * float(r_mm)
250
+ coords = w_plate_mm*0.5*np.linspace(-1, 1, n_points_boundary)
251
+
252
+ results = calculate_effective_properties(
253
+ laminate=laminate,
254
+ lx_plate_mm=w_plate_mm,
255
+ ly_plate_mm=w_plate_mm,
256
+ hole_radius_mm=float(r_mm),
257
+ n_points_boundary=n_points_boundary,
258
+ )
259
+
260
+ # Displacements (u,v) at the boundaries (right, left, top, bottom)
261
+ # for 3 unit stress states [sigma_xx_inf, sigma_yy_inf, tau_xy_inf].
262
+ disp_right_list = results['disp_right_list'] # [3][n_points_boundary, 2]
263
+ disp_left_list = results['disp_left_list']
264
+ disp_top_list = results['disp_top_list']
265
+ disp_bottom_list = results['disp_bottom_list']
266
+
267
+ # Plot displacements: each stress state in one subplot.
268
+ for i_stress, stress_state in enumerate([r'$\sigma_{xx}^{\infty}$', r'$\sigma_{yy}^{\infty}$', r'$\tau_{xy}^{\infty}$']):
269
+
270
+ if i_wr == 0:
271
+ axes_flat[i_stress].add_patch(plt.Circle((0, 0), r_mm, color='black', linewidth=1.8, fill=False))
272
+
273
+ axes_flat[i_stress].plot(-0.5*w_plate_mm+disp_left_list[i_stress][:, 0]*magnitude_factor,
274
+ coords+disp_left_list[i_stress][:, 1]*magnitude_factor,
275
+ color=colors[i_wr], linewidth=1.0)
276
+
277
+ axes_flat[i_stress].plot( 0.5*w_plate_mm+disp_right_list[i_stress][:, 0]*magnitude_factor,
278
+ coords+disp_right_list[i_stress][:, 1]*magnitude_factor,
279
+ color=colors[i_wr], linewidth=1.0)
280
+
281
+ axes_flat[i_stress].plot(coords+disp_bottom_list[i_stress][:, 0]*magnitude_factor,
282
+ -0.5*w_plate_mm+disp_bottom_list[i_stress][:, 1]*magnitude_factor,
283
+ color=colors[i_wr], linewidth=1.0)
284
+
285
+ axes_flat[i_stress].plot(coords+disp_top_list[i_stress][:, 0]*magnitude_factor,
286
+ 0.5*w_plate_mm+disp_top_list[i_stress][:, 1]*magnitude_factor,
287
+ color=colors[i_wr], linewidth=1.0,
288
+ label=f"w/r={w_r_ratio:.1f}")
289
+
290
+ if i_wr == len(w_r_ratios) - 1:
291
+
292
+ axes_flat[i_stress].set_xlabel('x')
293
+ axes_flat[i_stress].set_ylabel('y')
294
+ axes_flat[i_stress].set_title(stress_state)
295
+ axes_flat[i_stress].grid(True, alpha=0.3)
296
+
297
+ axes_flat[i_stress].set_xlim(-0.8*w_plate_mm, 0.8*w_plate_mm)
298
+ axes_flat[i_stress].set_ylim(-0.8*w_plate_mm, 0.8*w_plate_mm)
299
+ axes_flat[i_stress].axis('equal')
300
+ axes_flat[i_stress].legend(fontsize="small")
226
301
 
302
+ fig.suptitle(
303
+ f"Open Hole Plate: Displacements at the boundaries\n"+ \
304
+ f"Layup: {layup}\n"+ \
305
+ f"Magnify factor: {magnitude_factor:.1e}",
306
+ fontsize=14,
307
+ )
308
+ fig.tight_layout(rect=[0, 0, 1, 1])
309
+
310
+ out_path = os.path.join(path, "images", "open_hole_displacements.png")
311
+ fig.savefig(out_path, dpi=200)
227
312
 
228
313
 
229
314
  if __name__ == "__main__":