Skip to content

Commit

Permalink
Update damage.py with paged arrays 5
Browse files Browse the repository at this point in the history
  • Loading branch information
pschaugule committed Aug 30, 2023
1 parent fa1d760 commit 6fbee85
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions srlife/damage.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ def _calculate_surface_flaw_stresses(
# Zero initialization of surface stresses
surf_stress = np.zeros_like(full_stress.shape)

# If surface stresses do not have the number of surfaces as a dimensions add a new axis for them
# If surface stresses do not have the number of surfaces as a dimensions
# add a new axis for them
if surf_stress.ndim == 4:
surf_stress = surf_stress[..., np.newaxis, :]

# If surface normals do not have the number of surfaces as a dimensions add a new axis for them
# If surface normals do not have the number of surfaces as a dimensions
# add a new axis for them
if surface_normals.ndim == 2:
nx = surface_normals[..., np.newaxis, 0]
ny = surface_normals[..., np.newaxis, 1]
Expand Down Expand Up @@ -2232,11 +2234,6 @@ def calculate_surface_flaw_eq_stress(
Calculate the equivalent stresses from the normal and shear stresses in surface elements
"""

# Principal stresses in surface elements
surf_pstress = self.calculate_surface_principal_stress(
mandel_stress, surface, normals
)

# Normal stress
sigma_n = self.calculate_surface_flaw_normal_stress(
mandel_stress, surface, normals
Expand Down

0 comments on commit 6fbee85

Please sign in to comment.