Skip to content

Commit

Permalink
Merge branch 'main' into docs-touchup
Browse files Browse the repository at this point in the history
  • Loading branch information
Patol75 authored Sep 24, 2024
2 parents 4ae97ef + fb3628c commit c622610
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Handling of enstatite in Voigt averaging
- Handling of optional keyword args in some visualisation functions
- Zero-division error for some grain orientations under uniaxial compression

### Removed
- Access to `io` symbols in global `pydrex` namespace (use `pydrex.io` instead)
Expand Down
6 changes: 6 additions & 0 deletions src/pydrex/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,12 @@ def _get_rotation_and_strain(
"""
crss = get_crss(phase, fabric)
slip_invariants = _get_slip_invariants(strain_rate, orientation)
# Handle the case where all slip invariants are zero,
# thus no slip is possible (occurs for a few specific orientations and strain rates,
# for example in the case of uniaxial compression and an identity orientation
# i.e. grain orientation aligned to the coordinate system).
if np.all(slip_invariants == 0):
return np.zeros((3, 3)), 0.0
if phase == MineralPhase.olivine:
slip_indices = np.argsort(np.abs(slip_invariants / crss))
slip_rates = _get_slip_rates_olivine(
Expand Down

0 comments on commit c622610

Please sign in to comment.