lamkit 0.1.2__tar.gz → 0.1.4__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 (97) hide show
  1. {lamkit-0.1.2 → lamkit-0.1.4}/.gitignore +36 -33
  2. {lamkit-0.1.2 → lamkit-0.1.4}/LICENSE +21 -21
  3. {lamkit-0.1.2 → lamkit-0.1.4}/MANIFEST.in +3 -3
  4. {lamkit-0.1.2 → lamkit-0.1.4}/PKG-INFO +20 -2
  5. {lamkit-0.1.2 → lamkit-0.1.4}/README.md +115 -98
  6. {lamkit-0.1.2 → lamkit-0.1.4}/docs/Makefile +16 -16
  7. {lamkit-0.1.2 → lamkit-0.1.4}/docs/_static/.gitkeep +1 -1
  8. {lamkit-0.1.2 → lamkit-0.1.4}/docs/_templates/.gitkeep +1 -1
  9. {lamkit-0.1.2 → lamkit-0.1.4}/docs/api.rst +77 -69
  10. lamkit-0.1.4/docs/conf.py +60 -0
  11. {lamkit-0.1.2 → lamkit-0.1.4}/docs/examples.rst +46 -40
  12. {lamkit-0.1.2 → lamkit-0.1.4}/docs/index.rst +20 -19
  13. lamkit-0.1.4/docs/installation.rst +52 -0
  14. {lamkit-0.1.2 → lamkit-0.1.4}/docs/make.bat +20 -20
  15. lamkit-0.1.4/docs/quickstart.rst +103 -0
  16. lamkit-0.1.4/docs/requirements.txt +8 -0
  17. {lamkit-0.1.2 → lamkit-0.1.4}/example/1-laminate/example_laminate.py +316 -316
  18. lamkit-0.1.4/example/2-lekhnitskii-solution/example_loaded_hole.py +288 -0
  19. {lamkit-0.1.2 → lamkit-0.1.4}/example/2-lekhnitskii-solution/example_unloaded_hole.py +287 -283
  20. lamkit-0.1.4/example/2-lekhnitskii-solution/images/loaded_hole_1.png +0 -0
  21. lamkit-0.1.4/example/2-lekhnitskii-solution/images/loaded_hole_2.png +0 -0
  22. lamkit-0.1.4/example/2-lekhnitskii-solution/images/loaded_hole_3.png +0 -0
  23. lamkit-0.1.4/example/2-lekhnitskii-solution/images/loaded_hole_4.png +0 -0
  24. lamkit-0.1.4/example/2-lekhnitskii-solution/images/loaded_hole_5.png +0 -0
  25. {lamkit-0.1.2 → lamkit-0.1.4}/example/3-open-hole/example_open_hole.py +381 -395
  26. {lamkit-0.1.2 → lamkit-0.1.4}/example/4-effective-stiffness/example_effective_stiffness.py +318 -318
  27. {lamkit-0.1.2 → lamkit-0.1.4}/example/5-laminate-buckling/example_buckling.py +65 -65
  28. {lamkit-0.1.2 → lamkit-0.1.4}/example/6-laminate-optimization-task/example_laminate_opt_function.py +253 -246
  29. {lamkit-0.1.2 → lamkit-0.1.4}/example/6-laminate-optimization-task/output.txt +38 -38
  30. {lamkit-0.1.2 → lamkit-0.1.4}/example/7-layup-feasibility/example_layup_feasibility.py +47 -47
  31. {lamkit-0.1.2 → lamkit-0.1.4}/example/7-layup-feasibility/output.txt +12 -12
  32. lamkit-0.1.4/example/8-loaded-hole/example_loaded_hole.py +407 -0
  33. lamkit-0.1.4/example/8-loaded-hole/images/loaded_hole_face.png +0 -0
  34. lamkit-0.1.4/example/8-loaded-hole/images/loaded_hole_field.png +0 -0
  35. lamkit-0.1.4/example/9-combined-loading/example_combined_loading.py +522 -0
  36. lamkit-0.1.4/example/9-combined-loading/images/combined_boundary_face.png +0 -0
  37. lamkit-0.1.4/example/9-combined-loading/images/combined_fi_field.png +0 -0
  38. lamkit-0.1.4/example/9-combined-loading/images/combined_midplane_field.png +0 -0
  39. {lamkit-0.1.2 → lamkit-0.1.4}/pyproject.toml +62 -61
  40. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/__init__.py +20 -20
  41. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/analysis/buckling.py +406 -406
  42. lamkit-0.1.4/src/lamkit/analysis/failure.py +34 -0
  43. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/analysis/laminate.py +22 -12
  44. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/analysis/larc05.py +106 -188
  45. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/analysis/material.py +333 -325
  46. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/components/_S.py +2563 -2563
  47. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/components/_ii_F.py +5429 -5429
  48. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/components/build_k.py +192 -192
  49. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/components/build_layup_database.py +336 -336
  50. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/components/functions.py +68 -68
  51. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/components/write_pre_integrated_terms.py +118 -118
  52. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/components/write_shape_function.py +95 -95
  53. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/layup/feasibility.py +161 -133
  54. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/layup/requirements.py +1 -1
  55. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/lekhnitskii/__init__.py +22 -22
  56. lamkit-0.1.4/src/lamkit/lekhnitskii/combined_load.py +154 -0
  57. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/lekhnitskii/hole.py +511 -400
  58. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/lekhnitskii/homogenisation.py +237 -237
  59. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/lekhnitskii/loaded_hole.py +378 -405
  60. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/lekhnitskii/unloaded_hole.py +239 -258
  61. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/lekhnitskii/utils.py +162 -162
  62. lamkit-0.1.4/src/lamkit/utils.py +216 -0
  63. {lamkit-0.1.2 → lamkit-0.1.4}/tests/conftest.py +5 -5
  64. {lamkit-0.1.2 → lamkit-0.1.4}/tests/test_additional_coverage.py +203 -197
  65. {lamkit-0.1.2 → lamkit-0.1.4}/tests/test_buckling.py +64 -64
  66. {lamkit-0.1.2 → lamkit-0.1.4}/tests/test_laminate.py +147 -147
  67. {lamkit-0.1.2 → lamkit-0.1.4}/tests/test_larc05.py +19 -19
  68. {lamkit-0.1.2 → lamkit-0.1.4}/tests/test_lekhnitskii.py +76 -73
  69. {lamkit-0.1.2 → lamkit-0.1.4}/tests/test_material.py +39 -39
  70. lamkit-0.1.2/docs/conf.py +0 -31
  71. lamkit-0.1.2/docs/installation.rst +0 -39
  72. lamkit-0.1.2/docs/quickstart.rst +0 -55
  73. lamkit-0.1.2/docs/requirements.txt +0 -3
  74. lamkit-0.1.2/src/lamkit/utils.py +0 -207
  75. {lamkit-0.1.2 → lamkit-0.1.4}/example/1-laminate/images/laminate_bending_0-90-90-0.png +0 -0
  76. {lamkit-0.1.2 → lamkit-0.1.4}/example/1-laminate/images/laminate_membrane_0-90-90-0.png +0 -0
  77. {lamkit-0.1.2 → lamkit-0.1.4}/example/1-laminate/images/laminate_membrane_45-pm45-symmetric.png +0 -0
  78. {lamkit-0.1.2 → lamkit-0.1.4}/example/2-lekhnitskii-solution/images/open_hole_1.png +0 -0
  79. {lamkit-0.1.2 → lamkit-0.1.4}/example/2-lekhnitskii-solution/images/open_hole_2.png +0 -0
  80. {lamkit-0.1.2 → lamkit-0.1.4}/example/2-lekhnitskii-solution/images/open_hole_3.png +0 -0
  81. {lamkit-0.1.2 → lamkit-0.1.4}/example/2-lekhnitskii-solution/images/open_hole_4.png +0 -0
  82. {lamkit-0.1.2 → lamkit-0.1.4}/example/2-lekhnitskii-solution/images/open_hole_5.png +0 -0
  83. {lamkit-0.1.2 → lamkit-0.1.4}/example/2-lekhnitskii-solution/images/open_hole_6.png +0 -0
  84. {lamkit-0.1.2 → lamkit-0.1.4}/example/3-open-hole/images/open_hole_face.png +0 -0
  85. {lamkit-0.1.2 → lamkit-0.1.4}/example/3-open-hole/images/open_hole_field.png +0 -0
  86. {lamkit-0.1.2 → lamkit-0.1.4}/example/4-effective-stiffness/images/open_hole_displacements-1.png +0 -0
  87. {lamkit-0.1.2 → lamkit-0.1.4}/example/4-effective-stiffness/images/open_hole_displacements-2.png +0 -0
  88. {lamkit-0.1.2 → lamkit-0.1.4}/example/4-effective-stiffness/images/open_hole_displacements-3.png +0 -0
  89. {lamkit-0.1.2 → lamkit-0.1.4}/example/4-effective-stiffness/images/open_hole_displacements-4.png +0 -0
  90. {lamkit-0.1.2 → lamkit-0.1.4}/example/4-effective-stiffness/images/open_hole_homogenisation-1.png +0 -0
  91. {lamkit-0.1.2 → lamkit-0.1.4}/example/4-effective-stiffness/images/open_hole_homogenisation-2.png +0 -0
  92. {lamkit-0.1.2 → lamkit-0.1.4}/example/4-effective-stiffness/images/open_hole_homogenisation-3.png +0 -0
  93. {lamkit-0.1.2 → lamkit-0.1.4}/example/4-effective-stiffness/images/open_hole_homogenisation-4.png +0 -0
  94. {lamkit-0.1.2 → lamkit-0.1.4}/example/5-laminate-buckling/images/buckling_modes.png +0 -0
  95. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/analysis/__init__.py +0 -0
  96. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/components/__init__.py +0 -0
  97. {lamkit-0.1.2 → lamkit-0.1.4}/src/lamkit/layup/__init__.py +0 -0
@@ -1,33 +1,36 @@
1
- # Python cache and bytecode
2
- __pycache__/
3
- *.py[cod]
4
- *.pyo
5
-
6
- # Packaging artifacts
7
- build/
8
- dist/
9
- *.egg-info/
10
- .eggs/
11
-
12
- # Virtual environments
13
- .venv/
14
- venv/
15
- env/
16
-
17
- # Test and tooling cache
18
- .pytest_cache/
19
- .mypy_cache/
20
- .ruff_cache/
21
- .coverage
22
- htmlcov/
23
-
24
- # Sphinx docs build output
25
- docs/_build/
26
-
27
- # IDE
28
- .idea/
29
- .vscode/
30
-
31
- # Data
32
-
33
- data/
1
+ # Python cache and bytecode
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.pyo
5
+
6
+ # Packaging artifacts
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ .eggs/
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ venv/
15
+ env/
16
+
17
+ # Test and tooling cache
18
+ .pytest_cache/
19
+ .mypy_cache/
20
+ .ruff_cache/
21
+ .coverage
22
+ htmlcov/
23
+
24
+ # Sphinx docs build output
25
+ docs/_build/
26
+
27
+ # IDE
28
+ .idea/
29
+ .vscode/
30
+
31
+ # Data
32
+
33
+ data/
34
+
35
+ # For coding/testing purposes
36
+ old/
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Runze LI
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Runze LI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,3 +1,3 @@
1
- include README.md
2
- include LICENSE
3
- recursive-include docs *.rst *.md *.py *.txt
1
+ include README.md
2
+ include LICENSE
3
+ recursive-include docs *.rst *.md *.py *.txt
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lamkit
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Toolkit for stress analysis and failure prediction of composite laminates with holes and joints.
5
5
  Project-URL: Homepage, https://github.com/swayli94/lamkit
6
6
  Project-URL: Documentation, https://swayli94.github.io/lamkit/
@@ -52,6 +52,7 @@ Requires-Dist: twine>=5.1; extra == 'dev'
52
52
  Provides-Extra: docs
53
53
  Requires-Dist: furo>=2024.8.6; extra == 'docs'
54
54
  Requires-Dist: myst-parser>=4.0; extra == 'docs'
55
+ Requires-Dist: scipy>=1.10; extra == 'docs'
55
56
  Requires-Dist: sphinx>=8.0; extra == 'docs'
56
57
  Description-Content-Type: text/markdown
57
58
 
@@ -61,10 +62,14 @@ Description-Content-Type: text/markdown
61
62
 
62
63
  - Laminate stress/strain response based on Classical Lamination Theory (CLT)
63
64
  - LaRC05 failure index evaluation
64
- - Lekhnitskii open-hole infinite-plate analytical solution
65
+ - Lekhnitskii analytical solutions for infinite anisotropic plates with a hole:
66
+ - Unloaded hole (bypass far-field stresses)
67
+ - Loaded hole (cosine bearing-load distribution)
68
+ - Combined loading (`CombinedLoadHole`): superposition of bypass and bearing
65
69
  - Open-hole plate's effective (homogenisation) properties
66
70
  - Linear buckling analysis of laminates
67
71
  - Objective/constraint evaluation for laminate optimization tasks
72
+ - Layup engineering-requirement checks and feasibility rating against a layup attribute database
68
73
 
69
74
  ## Installation
70
75
 
@@ -72,6 +77,7 @@ Description-Content-Type: text/markdown
72
77
 
73
78
  - Python `>=3.9`
74
79
  - Core dependencies: `numpy`, `pandas`, `matplotlib`
80
+ - Optional: `scipy` (linear buckling and layup feasibility rating)
75
81
 
76
82
  ### Install from PyPI
77
83
 
@@ -133,6 +139,18 @@ The `example/` directory contains runnable scripts:
133
139
  `example/6-laminate-optimization-task/example_laminate_opt_function.py`
134
140
  Demonstrates combined displacement, failure, and buckling constraint evaluation for design tasks.
135
141
 
142
+ 7. **Layup feasibility rating**
143
+ `example/7-layup-feasibility/example_layup_feasibility.py`
144
+ Scores a candidate stacking (ply counts, bending lamination parameters) by distance to the nearest layups in a CSV database.
145
+
146
+ 8. **Loaded-hole (bearing) field analysis**
147
+ `example/8-loaded-hole/example_loaded_hole.py`
148
+ Computes ply-level stress/strain and LaRC05 failure indices around a bearing-loaded hole using `CombinedLoadHole` with zero bypass stresses. Plots mid-plane strains, ply-enveloped failure index fields, and hole-boundary FI maps.
149
+
150
+ 9. **Combined bearing and bypass loading**
151
+ `example/9-combined-loading/example_combined_loading.py`
152
+ Superimposes an `UnloadedHole` (far-field bypass) and a `LoadedHole` (cosine bearing distribution) via `CombinedLoadHole`. Generates mid-plane stress contour plots, ply-enveloped LaRC05 failure index maps, and a hole-boundary FI distribution across angle and thickness.
153
+
136
154
  ## Common Development Commands
137
155
 
138
156
  ### Run tests
@@ -1,98 +1,115 @@
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
- ```
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 analytical solutions for infinite anisotropic plates with a hole:
8
+ - Unloaded hole (bypass far-field stresses)
9
+ - Loaded hole (cosine bearing-load distribution)
10
+ - Combined loading (`CombinedLoadHole`): superposition of bypass and bearing
11
+ - Open-hole plate's effective (homogenisation) properties
12
+ - Linear buckling analysis of laminates
13
+ - Objective/constraint evaluation for laminate optimization tasks
14
+ - Layup engineering-requirement checks and feasibility rating against a layup attribute database
15
+
16
+ ## Installation
17
+
18
+ ### Requirements
19
+
20
+ - Python `>=3.9`
21
+ - Core dependencies: `numpy`, `pandas`, `matplotlib`
22
+ - Optional: `scipy` (linear buckling and layup feasibility rating)
23
+
24
+ ### Install from PyPI
25
+
26
+ ```bash
27
+ pip install lamkit
28
+ ```
29
+
30
+ ### Install for local development
31
+
32
+ ```bash
33
+ pip install -e .[dev,docs]
34
+ ```
35
+
36
+ ## Quick Start
37
+
38
+ The following example creates a laminate and evaluates ply-surface fields under membrane loading:
39
+
40
+ ```python
41
+ import numpy as np
42
+ from lamkit import Laminate, Ply
43
+ from lamkit.analysis.material import IM7_8551_7
44
+
45
+ ply = Ply(IM7_8551_7, thickness=0.125) # mm
46
+ stacking = [45, -45, 0, 90, 90, 0, -45, 45]
47
+ laminate = Laminate(stacking=stacking, plies=ply)
48
+
49
+ # N = [Nxx, Nyy, Nxy, Mxx, Myy, Mxy]
50
+ N = np.array([80.0, 0.0, 0.0, 0.0, 0.0, 0.0])
51
+ field = laminate.evaluate_laminate(N)
52
+
53
+ print(field[["index_ply", "index_surface", "z", "sigma_1", "sigma_2", "tau_12", "FI_max"]].head())
54
+ ```
55
+
56
+ ## Examples
57
+
58
+ The `example/` directory contains runnable scripts:
59
+
60
+ 1. **Laminate response (CLT + LaRC05)**
61
+ `example/1-laminate/example_laminate.py`
62
+ Computes through-thickness stress/strain and LaRC05 index distributions with plots.
63
+
64
+ 2. **Lekhnitskii unloaded-hole solution**
65
+ `example/2-lekhnitskii-solution/example_unloaded_hole.py`
66
+ Solves and visualizes open-hole stress fields.
67
+
68
+ 3. **Laminate open-hole field analysis**
69
+ `example/3-open-hole/example_open_hole.py`
70
+ Couples laminate equivalent compliance with open-hole fields and generates failure envelopes/boundary maps.
71
+
72
+ 4. **Effective stiffness with hole homogenization**
73
+ `example/4-effective-stiffness/example_effective_stiffness.py`
74
+ Compares laminate stiffness `A` (without hole) and homogenized stiffness `A_eff` (with hole).
75
+
76
+ 5. **Laminate linear buckling**
77
+ `example/5-laminate-buckling/example_buckling.py`
78
+ Computes buckling eigenvalues and saves buckling mode plots.
79
+
80
+ 6. **Optimization objective/constraint evaluation**
81
+ `example/6-laminate-optimization-task/example_laminate_opt_function.py`
82
+ Demonstrates combined displacement, failure, and buckling constraint evaluation for design tasks.
83
+
84
+ 7. **Layup feasibility rating**
85
+ `example/7-layup-feasibility/example_layup_feasibility.py`
86
+ Scores a candidate stacking (ply counts, bending lamination parameters) by distance to the nearest layups in a CSV database.
87
+
88
+ 8. **Loaded-hole (bearing) field analysis**
89
+ `example/8-loaded-hole/example_loaded_hole.py`
90
+ Computes ply-level stress/strain and LaRC05 failure indices around a bearing-loaded hole using `CombinedLoadHole` with zero bypass stresses. Plots mid-plane strains, ply-enveloped failure index fields, and hole-boundary FI maps.
91
+
92
+ 9. **Combined bearing and bypass loading**
93
+ `example/9-combined-loading/example_combined_loading.py`
94
+ Superimposes an `UnloadedHole` (far-field bypass) and a `LoadedHole` (cosine bearing distribution) via `CombinedLoadHole`. Generates mid-plane stress contour plots, ply-enveloped LaRC05 failure index maps, and a hole-boundary FI distribution across angle and thickness.
95
+
96
+ ## Common Development Commands
97
+
98
+ ### Run tests
99
+
100
+ ```bash
101
+ pytest
102
+ ```
103
+
104
+ ### Build distribution package
105
+
106
+ ```bash
107
+ python -m build
108
+ ```
109
+
110
+ ### Build documentation
111
+
112
+ ```bash
113
+ cd docs
114
+ sphinx-build -b html . _build/html
115
+ ```
@@ -1,16 +1,16 @@
1
- # Minimal makefile for Sphinx docs.
2
-
3
- SPHINXBUILD ?= sphinx-build
4
- SOURCEDIR = .
5
- BUILDDIR = _build
6
-
7
- .PHONY: help clean html
8
-
9
- help:
10
- $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)"
11
-
12
- clean:
13
- rm -rf "$(BUILDDIR)"
14
-
15
- html:
16
- $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)"
1
+ # Minimal makefile for Sphinx docs.
2
+
3
+ SPHINXBUILD ?= sphinx-build
4
+ SOURCEDIR = .
5
+ BUILDDIR = _build
6
+
7
+ .PHONY: help clean html
8
+
9
+ help:
10
+ $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)"
11
+
12
+ clean:
13
+ rm -rf "$(BUILDDIR)"
14
+
15
+ html:
16
+ $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)"
@@ -1 +1 @@
1
-
1
+
@@ -1,69 +1,77 @@
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:
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
+ Layup utilities
59
+ ---------------
60
+
61
+ .. automodule:: lamkit.layup.requirements
62
+ :members:
63
+ :undoc-members:
64
+ :show-inheritance:
65
+
66
+ .. automodule:: lamkit.layup.feasibility
67
+ :members:
68
+ :undoc-members:
69
+ :show-inheritance:
70
+
71
+ Utilities
72
+ ---------
73
+
74
+ .. automodule:: lamkit.utils
75
+ :members:
76
+ :undoc-members:
77
+ :show-inheritance:
@@ -0,0 +1,60 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ import re
5
+ import sys
6
+ import warnings
7
+ from datetime import datetime
8
+ from importlib.util import find_spec
9
+
10
+ # Anchor paths to this file so builds work from any cwd (e.g. repo root:
11
+ # ``sphinx-build -b html docs docs/_build/html``).
12
+ _CONF_DIR = os.path.dirname(os.path.abspath(__file__))
13
+ PROJECT_ROOT = os.path.dirname(_CONF_DIR)
14
+ SRC_ROOT = os.path.join(PROJECT_ROOT, "src")
15
+ sys.path.insert(0, SRC_ROOT)
16
+
17
+ _INIT_PY = os.path.join(SRC_ROOT, "lamkit", "__init__.py")
18
+ with open(_INIT_PY, encoding="utf-8") as _f:
19
+ _init_src = _f.read()
20
+ _match = re.search(
21
+ r'^__version__\s*=\s*[\'"]([^\'"]+)[\'"]',
22
+ _init_src,
23
+ re.MULTILINE,
24
+ )
25
+ release = _match.group(1) if _match else "0.0.0"
26
+ version = release.rpartition(".")[0] if release.count(".") >= 2 else release
27
+
28
+ project = "lamkit"
29
+ author = "Runze Li"
30
+ copyright = f"{datetime.now().year}, {author}"
31
+
32
+ extensions = [
33
+ "sphinx.ext.autodoc",
34
+ "sphinx.ext.napoleon",
35
+ "sphinx.ext.viewcode",
36
+ "myst_parser",
37
+ ]
38
+
39
+ templates_path = ["_templates"]
40
+ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
41
+
42
+ language = "en"
43
+ # Furo is optional at parse time: editors may analyze conf.py without docs extras installed.
44
+ if find_spec("furo") is not None:
45
+ html_theme = "furo"
46
+ else:
47
+ html_theme = "alabaster"
48
+ warnings.warn(
49
+ "Sphinx theme 'furo' is not installed; using bundled 'alabaster'. "
50
+ 'Install docs extras: pip install -e ".[docs]" or pip install furo',
51
+ UserWarning,
52
+ stacklevel=1,
53
+ )
54
+ html_static_path = ["_static"]
55
+
56
+ autodoc_member_order = "bysource"
57
+ autodoc_typehints = "description"
58
+
59
+ # Autodoc imports lamkit modules, which require NumPy, pandas, Matplotlib, SciPy, etc.
60
+ # Install with: pip install -e ".[docs]" (see docs/installation.rst).