Skip to content

Conversation

@haakon-e
Copy link
Member

@haakon-e haakon-e commented Oct 24, 2025

This pull request refactors the computation of strain rate tensors throughout the codebase to clarify the distinction between vertical-only and full (vertical + horizontal) strain rate calculations. It introduces new, more explicit utility functions for these computations, updates all relevant usages to call the appropriate function, and adds improved documentation to guide future development.

Key changes include:

Refactoring and API Improvements:

  • Introduced compute_strain_rate_center_vertical and compute_strain_rate_face_vertical functions to explicitly compute strain rate tensors using only vertical gradients, replacing the more generic compute_strain_rate_center and compute_strain_rate_face in all relevant locations. [1] [2] [3] [4] [5] [6] [7]

  • Added new functions compute_strain_rate_center_full! and compute_strain_rate_face_full! to compute the full strain rate tensor (including both vertical and horizontal gradients) at cell centers and faces, respectively, with detailed documentation and guidance for use.

Documentation and Usability:

  • Expanded and clarified docstrings for all strain rate computation functions, making it clear which functions use only vertical gradients and which compute the full tensor, and providing usage notes and references for future developers.

  • Added a new strain_rate_norm utility function to compute the norm of the strain rate tensor, with optional projection onto specific axes.

These changes improve code clarity, ensure correct usage of strain rate computations, and provide a stronger foundation for future development and maintenance.

@haakon-e
Copy link
Member Author

haakon-e commented Oct 24, 2025

Copy link
Member

@szy21 szy21 left a comment

Choose a reason for hiding this comment

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

Thanks! It would be good to add tests for the full strain rate too.

@haakon-e haakon-e force-pushed the he/rft-vert-full-strain branch from 706a428 to c8317c7 Compare October 27, 2025 18:20
@haakon-e haakon-e force-pushed the he/rft-vert-full-strain branch from c8317c7 to e5987ed Compare October 27, 2025 21:13
@haakon-e haakon-e enabled auto-merge October 27, 2025 21:13
@haakon-e haakon-e added this pull request to the merge queue Oct 27, 2025
Merged via the queue into main with commit 6552cfe Oct 28, 2025
19 checks passed
@haakon-e haakon-e deleted the he/rft-vert-full-strain branch October 28, 2025 00:39
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.

4 participants