sgio 0.3.1__py3-none-any.whl → 0.3.2__py3-none-any.whl
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.
- sgio/_version.py +1 -1
- sgio/core/builder.py +2 -1
- sgio/iofunc/gmsh/_gmsh41_refactored.py +1115 -0
- sgio/model/failure.py +7 -9
- sgio/model/solid.py +405 -440
- {sgio-0.3.1.dist-info → sgio-0.3.2.dist-info}/METADATA +1 -1
- {sgio-0.3.1.dist-info → sgio-0.3.2.dist-info}/RECORD +10 -9
- {sgio-0.3.1.dist-info → sgio-0.3.2.dist-info}/WHEEL +0 -0
- {sgio-0.3.1.dist-info → sgio-0.3.2.dist-info}/entry_points.txt +0 -0
- {sgio-0.3.1.dist-info → sgio-0.3.2.dist-info}/licenses/LICENSE +0 -0
sgio/model/failure.py
CHANGED
|
@@ -172,20 +172,18 @@ class TsaiWuFailureCriterion:
|
|
|
172
172
|
# We take the positive root
|
|
173
173
|
discriminant = b**2 - 4*a*c
|
|
174
174
|
|
|
175
|
-
# Handle edge cases
|
|
176
|
-
strength_ratio = np.
|
|
175
|
+
# Handle edge cases - initialize with infinity
|
|
176
|
+
strength_ratio = np.full_like(a, np.inf)
|
|
177
177
|
|
|
178
178
|
# For valid discriminant (should always be >= 0 for physical problems)
|
|
179
|
-
|
|
179
|
+
valid_discriminant = discriminant >= 0
|
|
180
180
|
|
|
181
181
|
# Calculate strength ratio using the positive root
|
|
182
|
-
|
|
182
|
+
temp_sr = (-b[valid_discriminant] + np.sqrt(discriminant[valid_discriminant])) / (2*a[valid_discriminant])
|
|
183
183
|
|
|
184
|
-
#
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
if np.any(small_a):
|
|
188
|
-
strength_ratio[small_a] = 1.0 / b[small_a]
|
|
184
|
+
# Only keep positive strength ratios, set others to infinity
|
|
185
|
+
valid_sr = temp_sr > 0
|
|
186
|
+
strength_ratio[valid_discriminant] = np.where(valid_sr, temp_sr, np.inf)
|
|
189
187
|
|
|
190
188
|
# Return scalar if input was 1D
|
|
191
189
|
if strength_ratio.shape[0] == 1:
|