Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid zero-division under uniaxial compression #217

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Conversation

adigitoleo
Copy link
Member

This fixes a zero-division for some orientations under uniaxial compression, by catching the problematic values for slip invariants and returning null-values for orientation change and grain growth. There are some conditions where slip is simply not possible at all, and it is worth adding this check even though most Real World Problems are unlikely to hit this issue (strain rates would normally have pure shear, simple shear and compressional components combined).

Copy link
Member

@Patol75 Patol75 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Might just change the condition. Up to you.

src/pydrex/core.py Outdated Show resolved Hide resolved
This fixes a zero-division for some orientations under uniaxial
compression, by catching the problematic values for slip invariants and
returning null-values for orientation change and grain growth. There are
some conditions where slip is simply not possible at all, and it is
worth adding this check even though most Real World Problems are
unlikely to hit this issue (strain rates would normally have pure shear,
simple shear and compressional components combined).
@adigitoleo adigitoleo merged commit fb3628c into main Sep 17, 2024
11 checks passed
@adigitoleo adigitoleo deleted the fix-uniaxial-strain branch September 23, 2024 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants