3pc-sandfail 1.0.0__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.
@@ -0,0 +1,192 @@
1
+ Metadata-Version: 2.4
2
+ Name: 3pc-sandfail
3
+ Version: 1.0.0
4
+ Summary: Python library for stress / strain analysis of shear deformable anisotropic sandwich plates under hygrothermal and mechanical loads.
5
+ Author: Omprakash Seresta
6
+ Author-email: oseresta@gmail.com
7
+ License: MIT
8
+ Project-URL: Blog, https://3pcomposites.com/blogs-1/f/3pcsolver005-hygrothermomechanical-analyses-of-sandwich-panels
9
+ Project-URL: Analysis Tools, https://3pcomposites.com/analysis-tools
10
+ Project-URL: Documentation, https://drive.google.com/drive/folders/1jDb-P5BOgJ-moVU20B7D8oVeHjHLAHTm
11
+ Keywords: sandwich-plates failure-analysis stress-analysis composites anisotropic aerospace-engineering mechanics fsdt clt hygrothermal
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Requires-Python: >=3.6
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: 3pc-material
19
+ Requires-Dist: 3pc-ply
20
+ Requires-Dist: 3pc-laminate
21
+ Requires-Dist: 3pc-panel
22
+ Requires-Dist: 3pc-sandwich
23
+ Requires-Dist: 3pc-loads
24
+ Requires-Dist: 3pc-utils
25
+ Requires-Dist: numpy
26
+ Requires-Dist: scipy
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: keywords
33
+ Dynamic: license
34
+ Dynamic: license-file
35
+ Dynamic: project-url
36
+ Dynamic: requires-dist
37
+ Dynamic: requires-python
38
+ Dynamic: summary
39
+
40
+ # 3pc-sandfail
41
+
42
+ `3pc-sandfail` is a Python library for stress / strain analysis of shear deformable anisotropic sandwich plates under hygrothermal and mechanical loads. It provides a `Sandfail` class to perform ply-by-ply stress, strain, and margin of safety calculations, evaluating sandwich-specific failure modes such as intracellular buckling (dimpling), wrinkling, core shear crimping, core shear, core crush, and facesheet disbond.
43
+
44
+ ## Installation
45
+
46
+ Use the package manager [pip](https://pip.pypa.io/en/stable/) to install `3pc-sandfail`. Since the package and its dependencies are available on PyPI, you can install them directly:
47
+
48
+ ```bash
49
+ pip install 3pc-sandfail
50
+ ```
51
+
52
+ ## API Reference
53
+
54
+ ### `Sandfail` Class
55
+
56
+ The primary component of this package is the `Sandfail` class, which takes a panel, a load case, and core properties to compute stress, strain, and margins of safety against various failure modes.
57
+
58
+ ```python
59
+ from sandfail.sandfail import Sandfail
60
+ ```
61
+
62
+ #### Required Parameters
63
+
64
+ When initializing `Sandfail`, the following parameters are required:
65
+
66
+ * **`panel`** *(Panel)*: An instance of the `Panel` class (from `3pc-panel`) containing the face sheet laminates and sandwich core definition.
67
+ * **`loads`** *(Loads)*: An instance of the `Loads` class (from `3pc-loads`) containing the load case and environmental conditions.
68
+ * **`core_properties`** *(dict)*: Dictionary of core-specific configuration properties (e.g., `type` - `"isotropic"` or `"orthotropic"`, `Ec`, `Gc`, `k1`, `delta0`, `FwT`).
69
+
70
+ #### Calculated Properties
71
+
72
+ The class calculates the following properties:
73
+
74
+ * **`NT`, `NC`**: Thermal and hygral in-plane load vectors.
75
+ * **`MT`, `MC`**: Thermal and hygral in-plane moment vectors.
76
+ * **`ek0`**: Reference/midplane strain and curvatures.
77
+ * **`stress`, `strain`**: Stresses and strains for the face sheets and core.
78
+ * **`msCoreShear`**: Margin of safety for core shear.
79
+ * **`msICBTopLaminate`, `msICBBottomLaminate`**: Margin of safety for intracellular buckling (dimpling) on the top/bottom laminates.
80
+ * **`msWrinklingTopLaminate`, `msWrinklingBottomLaminate`**: Margin of safety for wrinkling on the top/bottom laminates.
81
+
82
+ ### Methods
83
+
84
+ #### `Sandfail.fromDict(**kwargs)`
85
+
86
+ Initializes a `Sandfail` instance using a dictionary of keyword arguments.
87
+
88
+ ---
89
+
90
+ ## Usage Examples
91
+
92
+ ### Basic Initialization
93
+
94
+ Below is an example of performing a sandwich failure analysis.
95
+
96
+ ```python
97
+ from panel.panel import Panel
98
+ from loads.loads import Loads
99
+ from sandfail.sandfail import Sandfail
100
+
101
+ # Assuming pnl (Panel) and ld (Loads) are already defined
102
+ core_props = {
103
+ "type": "isotropic",
104
+ "Ec": 1000.0,
105
+ "k1": 0.5,
106
+ "Gc": 400.0
107
+ }
108
+
109
+ sf = Sandfail(
110
+ panel=pnl,
111
+ loads=ld,
112
+ core_properties=core_props
113
+ )
114
+
115
+ # Access calculations and margins of safety
116
+ print("Mid-plane strains/curvatures:", sf.ek0)
117
+ print("Core Shear Margin of Safety:", sf.msCoreShear)
118
+ ```
119
+
120
+ ## Commands
121
+
122
+ The package provides a command-line interface entry point. After installing, you can run the application using:
123
+
124
+ ```bash
125
+ sandfail input.cfg
126
+ ```
127
+
128
+ *(This entry point is defined in `sandfail.__main__:main`)*
129
+
130
+ ### Options
131
+
132
+ * **`config`** *(positional)*: Specify the configuration file (`.cfg`) to run the analysis.
133
+ * **`-h, --help`**: Show the help message and exit.
134
+ * **`-v, --version`**: Show the version number.
135
+ * **`-s, --sample`**: Copy example files (materials, plies, cores, laminates, panels, loads, config) to the current directory.
136
+
137
+ ### Configuration File (`sandfail.cfg`)
138
+
139
+ The `sandfail` command requires a configuration file (typically named `sandfail.cfg`). Below is an example based on `sandfail/examples/sandfail.cfg`:
140
+
141
+ ```ini
142
+ [files]
143
+ materials = materials.json
144
+ plies = plies.json
145
+ cores = cores.json
146
+ laminates = laminates.json
147
+ panels = panels.json
148
+ loads = loads.json
149
+ output = output.txt
150
+
151
+ [analysis]
152
+ analysis_type = MECHANICAL
153
+ failure_theory = MAX STRAIN
154
+ sandwich_failure = yes
155
+ ```
156
+
157
+ #### `[files]` Section
158
+
159
+ This section defines the paths to the required input JSON files and the desired output file:
160
+
161
+ * **`materials`**: Path to the materials JSON file. Follows the format expected by [`3pc-material`](https://pypi.org/project/3pc-material/).
162
+ * **`plies`**: Path to the plies JSON file. Follows the format expected by [`3pc-ply`](https://pypi.org/project/3pc-ply/).
163
+ * **`cores`**: Path to the cores JSON file.
164
+ * **`laminates`**: Path to the laminates JSON file. Follows the format expected by [`3pc-laminate`](https://pypi.org/project/3pc-laminate/).
165
+ * **`panels`**: Path to the panels JSON file. Follows the format expected by [`3pc-panel`](https://pypi.org/project/3pc-panel/).
166
+ * **`loads`**: Path to the loads JSON file. Follows the format expected by [`3pc-loads`](https://pypi.org/project/3pc-loads/).
167
+ * **`output`**: Path to the text file where the sandwich failure analysis results will be written.
168
+
169
+ #### `[analysis]` Section
170
+
171
+ This section specifies the analysis settings:
172
+
173
+ * **`analysis_type`**: Type of analysis (e.g. `MECHANICAL`, `HYGROTHERMAL`, `HYGROTHERMOMECHANICAL`).
174
+ * **`failure_theory`**: Theory used for laminate strength evaluation (e.g. `MAX STRAIN`, `TSAI-WU`, `TSAI-HILL`, `MAX STRESS`).
175
+ * **`sandwich_failure`**: Flag to enable/disable sandwich failure analysis (e.g., `yes`, `no`).
176
+
177
+ ## Citation
178
+
179
+ If you use this library in your research or work, please cite it as follows:
180
+
181
+ **APA Format:**
182
+ > Rastogi, N., & Seresta, O. (2026). *3pc-sandfail: Python library for stress / strain analysis of shear deformable anisotropic sandwich plates under hygrothermal and mechanical loads*. PyPI. https://pypi.org/project/3pc-sandfail/
183
+
184
+ **BibTeX:**
185
+ ```bibtex
186
+ @software{3pc_sandfail,
187
+ author = {Rastogi, Naveen and Seresta, Omprakash},
188
+ title = {3pc-sandfail: Python library for stress / strain analysis of shear deformable anisotropic sandwich plates under hygrothermal and mechanical loads},
189
+ year = {2026},
190
+ url = {https://pypi.org/project/3pc-sandfail/}
191
+ }
192
+ ```
@@ -0,0 +1,20 @@
1
+ LICENSE
2
+ README.md
3
+ setup.py
4
+ 3pc_sandfail.egg-info/PKG-INFO
5
+ 3pc_sandfail.egg-info/SOURCES.txt
6
+ 3pc_sandfail.egg-info/dependency_links.txt
7
+ 3pc_sandfail.egg-info/entry_points.txt
8
+ 3pc_sandfail.egg-info/not-zip-safe
9
+ 3pc_sandfail.egg-info/requires.txt
10
+ 3pc_sandfail.egg-info/top_level.txt
11
+ sandfail/CONSTANTS.py
12
+ sandfail/__init__.py
13
+ sandfail/__main__.py
14
+ sandfail/__version__.py
15
+ sandfail/expiry_wrapper.py
16
+ sandfail/main.py
17
+ sandfail/sandfail.py
18
+ sandfail/sandfailIO.py
19
+ sandfail/tests/__init__.py
20
+ sandfail/tests/test_sandfail.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ sandfail = sandfail.__main__:main
@@ -0,0 +1,9 @@
1
+ 3pc-material
2
+ 3pc-ply
3
+ 3pc-laminate
4
+ 3pc-panel
5
+ 3pc-sandwich
6
+ 3pc-loads
7
+ 3pc-utils
8
+ numpy
9
+ scipy
@@ -0,0 +1 @@
1
+ sandfail
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Omprakash Seresta
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.
@@ -0,0 +1,192 @@
1
+ Metadata-Version: 2.4
2
+ Name: 3pc-sandfail
3
+ Version: 1.0.0
4
+ Summary: Python library for stress / strain analysis of shear deformable anisotropic sandwich plates under hygrothermal and mechanical loads.
5
+ Author: Omprakash Seresta
6
+ Author-email: oseresta@gmail.com
7
+ License: MIT
8
+ Project-URL: Blog, https://3pcomposites.com/blogs-1/f/3pcsolver005-hygrothermomechanical-analyses-of-sandwich-panels
9
+ Project-URL: Analysis Tools, https://3pcomposites.com/analysis-tools
10
+ Project-URL: Documentation, https://drive.google.com/drive/folders/1jDb-P5BOgJ-moVU20B7D8oVeHjHLAHTm
11
+ Keywords: sandwich-plates failure-analysis stress-analysis composites anisotropic aerospace-engineering mechanics fsdt clt hygrothermal
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Requires-Python: >=3.6
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: 3pc-material
19
+ Requires-Dist: 3pc-ply
20
+ Requires-Dist: 3pc-laminate
21
+ Requires-Dist: 3pc-panel
22
+ Requires-Dist: 3pc-sandwich
23
+ Requires-Dist: 3pc-loads
24
+ Requires-Dist: 3pc-utils
25
+ Requires-Dist: numpy
26
+ Requires-Dist: scipy
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: keywords
33
+ Dynamic: license
34
+ Dynamic: license-file
35
+ Dynamic: project-url
36
+ Dynamic: requires-dist
37
+ Dynamic: requires-python
38
+ Dynamic: summary
39
+
40
+ # 3pc-sandfail
41
+
42
+ `3pc-sandfail` is a Python library for stress / strain analysis of shear deformable anisotropic sandwich plates under hygrothermal and mechanical loads. It provides a `Sandfail` class to perform ply-by-ply stress, strain, and margin of safety calculations, evaluating sandwich-specific failure modes such as intracellular buckling (dimpling), wrinkling, core shear crimping, core shear, core crush, and facesheet disbond.
43
+
44
+ ## Installation
45
+
46
+ Use the package manager [pip](https://pip.pypa.io/en/stable/) to install `3pc-sandfail`. Since the package and its dependencies are available on PyPI, you can install them directly:
47
+
48
+ ```bash
49
+ pip install 3pc-sandfail
50
+ ```
51
+
52
+ ## API Reference
53
+
54
+ ### `Sandfail` Class
55
+
56
+ The primary component of this package is the `Sandfail` class, which takes a panel, a load case, and core properties to compute stress, strain, and margins of safety against various failure modes.
57
+
58
+ ```python
59
+ from sandfail.sandfail import Sandfail
60
+ ```
61
+
62
+ #### Required Parameters
63
+
64
+ When initializing `Sandfail`, the following parameters are required:
65
+
66
+ * **`panel`** *(Panel)*: An instance of the `Panel` class (from `3pc-panel`) containing the face sheet laminates and sandwich core definition.
67
+ * **`loads`** *(Loads)*: An instance of the `Loads` class (from `3pc-loads`) containing the load case and environmental conditions.
68
+ * **`core_properties`** *(dict)*: Dictionary of core-specific configuration properties (e.g., `type` - `"isotropic"` or `"orthotropic"`, `Ec`, `Gc`, `k1`, `delta0`, `FwT`).
69
+
70
+ #### Calculated Properties
71
+
72
+ The class calculates the following properties:
73
+
74
+ * **`NT`, `NC`**: Thermal and hygral in-plane load vectors.
75
+ * **`MT`, `MC`**: Thermal and hygral in-plane moment vectors.
76
+ * **`ek0`**: Reference/midplane strain and curvatures.
77
+ * **`stress`, `strain`**: Stresses and strains for the face sheets and core.
78
+ * **`msCoreShear`**: Margin of safety for core shear.
79
+ * **`msICBTopLaminate`, `msICBBottomLaminate`**: Margin of safety for intracellular buckling (dimpling) on the top/bottom laminates.
80
+ * **`msWrinklingTopLaminate`, `msWrinklingBottomLaminate`**: Margin of safety for wrinkling on the top/bottom laminates.
81
+
82
+ ### Methods
83
+
84
+ #### `Sandfail.fromDict(**kwargs)`
85
+
86
+ Initializes a `Sandfail` instance using a dictionary of keyword arguments.
87
+
88
+ ---
89
+
90
+ ## Usage Examples
91
+
92
+ ### Basic Initialization
93
+
94
+ Below is an example of performing a sandwich failure analysis.
95
+
96
+ ```python
97
+ from panel.panel import Panel
98
+ from loads.loads import Loads
99
+ from sandfail.sandfail import Sandfail
100
+
101
+ # Assuming pnl (Panel) and ld (Loads) are already defined
102
+ core_props = {
103
+ "type": "isotropic",
104
+ "Ec": 1000.0,
105
+ "k1": 0.5,
106
+ "Gc": 400.0
107
+ }
108
+
109
+ sf = Sandfail(
110
+ panel=pnl,
111
+ loads=ld,
112
+ core_properties=core_props
113
+ )
114
+
115
+ # Access calculations and margins of safety
116
+ print("Mid-plane strains/curvatures:", sf.ek0)
117
+ print("Core Shear Margin of Safety:", sf.msCoreShear)
118
+ ```
119
+
120
+ ## Commands
121
+
122
+ The package provides a command-line interface entry point. After installing, you can run the application using:
123
+
124
+ ```bash
125
+ sandfail input.cfg
126
+ ```
127
+
128
+ *(This entry point is defined in `sandfail.__main__:main`)*
129
+
130
+ ### Options
131
+
132
+ * **`config`** *(positional)*: Specify the configuration file (`.cfg`) to run the analysis.
133
+ * **`-h, --help`**: Show the help message and exit.
134
+ * **`-v, --version`**: Show the version number.
135
+ * **`-s, --sample`**: Copy example files (materials, plies, cores, laminates, panels, loads, config) to the current directory.
136
+
137
+ ### Configuration File (`sandfail.cfg`)
138
+
139
+ The `sandfail` command requires a configuration file (typically named `sandfail.cfg`). Below is an example based on `sandfail/examples/sandfail.cfg`:
140
+
141
+ ```ini
142
+ [files]
143
+ materials = materials.json
144
+ plies = plies.json
145
+ cores = cores.json
146
+ laminates = laminates.json
147
+ panels = panels.json
148
+ loads = loads.json
149
+ output = output.txt
150
+
151
+ [analysis]
152
+ analysis_type = MECHANICAL
153
+ failure_theory = MAX STRAIN
154
+ sandwich_failure = yes
155
+ ```
156
+
157
+ #### `[files]` Section
158
+
159
+ This section defines the paths to the required input JSON files and the desired output file:
160
+
161
+ * **`materials`**: Path to the materials JSON file. Follows the format expected by [`3pc-material`](https://pypi.org/project/3pc-material/).
162
+ * **`plies`**: Path to the plies JSON file. Follows the format expected by [`3pc-ply`](https://pypi.org/project/3pc-ply/).
163
+ * **`cores`**: Path to the cores JSON file.
164
+ * **`laminates`**: Path to the laminates JSON file. Follows the format expected by [`3pc-laminate`](https://pypi.org/project/3pc-laminate/).
165
+ * **`panels`**: Path to the panels JSON file. Follows the format expected by [`3pc-panel`](https://pypi.org/project/3pc-panel/).
166
+ * **`loads`**: Path to the loads JSON file. Follows the format expected by [`3pc-loads`](https://pypi.org/project/3pc-loads/).
167
+ * **`output`**: Path to the text file where the sandwich failure analysis results will be written.
168
+
169
+ #### `[analysis]` Section
170
+
171
+ This section specifies the analysis settings:
172
+
173
+ * **`analysis_type`**: Type of analysis (e.g. `MECHANICAL`, `HYGROTHERMAL`, `HYGROTHERMOMECHANICAL`).
174
+ * **`failure_theory`**: Theory used for laminate strength evaluation (e.g. `MAX STRAIN`, `TSAI-WU`, `TSAI-HILL`, `MAX STRESS`).
175
+ * **`sandwich_failure`**: Flag to enable/disable sandwich failure analysis (e.g., `yes`, `no`).
176
+
177
+ ## Citation
178
+
179
+ If you use this library in your research or work, please cite it as follows:
180
+
181
+ **APA Format:**
182
+ > Rastogi, N., & Seresta, O. (2026). *3pc-sandfail: Python library for stress / strain analysis of shear deformable anisotropic sandwich plates under hygrothermal and mechanical loads*. PyPI. https://pypi.org/project/3pc-sandfail/
183
+
184
+ **BibTeX:**
185
+ ```bibtex
186
+ @software{3pc_sandfail,
187
+ author = {Rastogi, Naveen and Seresta, Omprakash},
188
+ title = {3pc-sandfail: Python library for stress / strain analysis of shear deformable anisotropic sandwich plates under hygrothermal and mechanical loads},
189
+ year = {2026},
190
+ url = {https://pypi.org/project/3pc-sandfail/}
191
+ }
192
+ ```
@@ -0,0 +1,153 @@
1
+ # 3pc-sandfail
2
+
3
+ `3pc-sandfail` is a Python library for stress / strain analysis of shear deformable anisotropic sandwich plates under hygrothermal and mechanical loads. It provides a `Sandfail` class to perform ply-by-ply stress, strain, and margin of safety calculations, evaluating sandwich-specific failure modes such as intracellular buckling (dimpling), wrinkling, core shear crimping, core shear, core crush, and facesheet disbond.
4
+
5
+ ## Installation
6
+
7
+ Use the package manager [pip](https://pip.pypa.io/en/stable/) to install `3pc-sandfail`. Since the package and its dependencies are available on PyPI, you can install them directly:
8
+
9
+ ```bash
10
+ pip install 3pc-sandfail
11
+ ```
12
+
13
+ ## API Reference
14
+
15
+ ### `Sandfail` Class
16
+
17
+ The primary component of this package is the `Sandfail` class, which takes a panel, a load case, and core properties to compute stress, strain, and margins of safety against various failure modes.
18
+
19
+ ```python
20
+ from sandfail.sandfail import Sandfail
21
+ ```
22
+
23
+ #### Required Parameters
24
+
25
+ When initializing `Sandfail`, the following parameters are required:
26
+
27
+ * **`panel`** *(Panel)*: An instance of the `Panel` class (from `3pc-panel`) containing the face sheet laminates and sandwich core definition.
28
+ * **`loads`** *(Loads)*: An instance of the `Loads` class (from `3pc-loads`) containing the load case and environmental conditions.
29
+ * **`core_properties`** *(dict)*: Dictionary of core-specific configuration properties (e.g., `type` - `"isotropic"` or `"orthotropic"`, `Ec`, `Gc`, `k1`, `delta0`, `FwT`).
30
+
31
+ #### Calculated Properties
32
+
33
+ The class calculates the following properties:
34
+
35
+ * **`NT`, `NC`**: Thermal and hygral in-plane load vectors.
36
+ * **`MT`, `MC`**: Thermal and hygral in-plane moment vectors.
37
+ * **`ek0`**: Reference/midplane strain and curvatures.
38
+ * **`stress`, `strain`**: Stresses and strains for the face sheets and core.
39
+ * **`msCoreShear`**: Margin of safety for core shear.
40
+ * **`msICBTopLaminate`, `msICBBottomLaminate`**: Margin of safety for intracellular buckling (dimpling) on the top/bottom laminates.
41
+ * **`msWrinklingTopLaminate`, `msWrinklingBottomLaminate`**: Margin of safety for wrinkling on the top/bottom laminates.
42
+
43
+ ### Methods
44
+
45
+ #### `Sandfail.fromDict(**kwargs)`
46
+
47
+ Initializes a `Sandfail` instance using a dictionary of keyword arguments.
48
+
49
+ ---
50
+
51
+ ## Usage Examples
52
+
53
+ ### Basic Initialization
54
+
55
+ Below is an example of performing a sandwich failure analysis.
56
+
57
+ ```python
58
+ from panel.panel import Panel
59
+ from loads.loads import Loads
60
+ from sandfail.sandfail import Sandfail
61
+
62
+ # Assuming pnl (Panel) and ld (Loads) are already defined
63
+ core_props = {
64
+ "type": "isotropic",
65
+ "Ec": 1000.0,
66
+ "k1": 0.5,
67
+ "Gc": 400.0
68
+ }
69
+
70
+ sf = Sandfail(
71
+ panel=pnl,
72
+ loads=ld,
73
+ core_properties=core_props
74
+ )
75
+
76
+ # Access calculations and margins of safety
77
+ print("Mid-plane strains/curvatures:", sf.ek0)
78
+ print("Core Shear Margin of Safety:", sf.msCoreShear)
79
+ ```
80
+
81
+ ## Commands
82
+
83
+ The package provides a command-line interface entry point. After installing, you can run the application using:
84
+
85
+ ```bash
86
+ sandfail input.cfg
87
+ ```
88
+
89
+ *(This entry point is defined in `sandfail.__main__:main`)*
90
+
91
+ ### Options
92
+
93
+ * **`config`** *(positional)*: Specify the configuration file (`.cfg`) to run the analysis.
94
+ * **`-h, --help`**: Show the help message and exit.
95
+ * **`-v, --version`**: Show the version number.
96
+ * **`-s, --sample`**: Copy example files (materials, plies, cores, laminates, panels, loads, config) to the current directory.
97
+
98
+ ### Configuration File (`sandfail.cfg`)
99
+
100
+ The `sandfail` command requires a configuration file (typically named `sandfail.cfg`). Below is an example based on `sandfail/examples/sandfail.cfg`:
101
+
102
+ ```ini
103
+ [files]
104
+ materials = materials.json
105
+ plies = plies.json
106
+ cores = cores.json
107
+ laminates = laminates.json
108
+ panels = panels.json
109
+ loads = loads.json
110
+ output = output.txt
111
+
112
+ [analysis]
113
+ analysis_type = MECHANICAL
114
+ failure_theory = MAX STRAIN
115
+ sandwich_failure = yes
116
+ ```
117
+
118
+ #### `[files]` Section
119
+
120
+ This section defines the paths to the required input JSON files and the desired output file:
121
+
122
+ * **`materials`**: Path to the materials JSON file. Follows the format expected by [`3pc-material`](https://pypi.org/project/3pc-material/).
123
+ * **`plies`**: Path to the plies JSON file. Follows the format expected by [`3pc-ply`](https://pypi.org/project/3pc-ply/).
124
+ * **`cores`**: Path to the cores JSON file.
125
+ * **`laminates`**: Path to the laminates JSON file. Follows the format expected by [`3pc-laminate`](https://pypi.org/project/3pc-laminate/).
126
+ * **`panels`**: Path to the panels JSON file. Follows the format expected by [`3pc-panel`](https://pypi.org/project/3pc-panel/).
127
+ * **`loads`**: Path to the loads JSON file. Follows the format expected by [`3pc-loads`](https://pypi.org/project/3pc-loads/).
128
+ * **`output`**: Path to the text file where the sandwich failure analysis results will be written.
129
+
130
+ #### `[analysis]` Section
131
+
132
+ This section specifies the analysis settings:
133
+
134
+ * **`analysis_type`**: Type of analysis (e.g. `MECHANICAL`, `HYGROTHERMAL`, `HYGROTHERMOMECHANICAL`).
135
+ * **`failure_theory`**: Theory used for laminate strength evaluation (e.g. `MAX STRAIN`, `TSAI-WU`, `TSAI-HILL`, `MAX STRESS`).
136
+ * **`sandwich_failure`**: Flag to enable/disable sandwich failure analysis (e.g., `yes`, `no`).
137
+
138
+ ## Citation
139
+
140
+ If you use this library in your research or work, please cite it as follows:
141
+
142
+ **APA Format:**
143
+ > Rastogi, N., & Seresta, O. (2026). *3pc-sandfail: Python library for stress / strain analysis of shear deformable anisotropic sandwich plates under hygrothermal and mechanical loads*. PyPI. https://pypi.org/project/3pc-sandfail/
144
+
145
+ **BibTeX:**
146
+ ```bibtex
147
+ @software{3pc_sandfail,
148
+ author = {Rastogi, Naveen and Seresta, Omprakash},
149
+ title = {3pc-sandfail: Python library for stress / strain analysis of shear deformable anisotropic sandwich plates under hygrothermal and mechanical loads},
150
+ year = {2026},
151
+ url = {https://pypi.org/project/3pc-sandfail/}
152
+ }
153
+ ```
@@ -0,0 +1,3 @@
1
+ STRESSMIN = 0.01
2
+ STRAINMIN = 1e-6
3
+ TOL = 0.001
File without changes
@@ -0,0 +1,6 @@
1
+ from sandfail.main import main
2
+
3
+ if __name__ == '__main__':
4
+ """Main entry point of the command line application - sandfail"""
5
+
6
+ main()
@@ -0,0 +1 @@
1
+ __version__ = "1.0.0"
@@ -0,0 +1,8 @@
1
+ from datetime import datetime
2
+ import sys
3
+
4
+ def check_expiry():
5
+ expiry_date = datetime(2025, 12, 31)
6
+ if datetime.now() > expiry_date:
7
+ print("This application has expired.")
8
+ sys.exit(1)