Skip to content

Feature/rotation#26

Open
chemiskyy wants to merge 3 commits intomasterfrom
feature/rotation
Open

Feature/rotation#26
chemiskyy wants to merge 3 commits intomasterfrom
feature/rotation

Conversation

@chemiskyy
Copy link
Member

This pull request refactors the handling of rotations and local frames across several modules by consistently adopting the simcoon.Rotation class for all rotation-related operations. This change improves code maintainability, accuracy, and clarity, replacing previous manual implementations with standardized rotation utilities. Additionally, the LocalFrame class and related utilities are modernized and better documented.

Rotation handling modernization:

  • Replaced all manual construction of rotation matrices and Voigt transformations with the use of simcoon.Rotation and its methods (such as from_euler, from_matrix, as_voigt_stress_rotation, apply_strain, apply_stress) in fedoo/constitutivelaw/composite_ud.py, fedoo/core/mechanical3d.py, fedoo/util/localframe.py, and fedoo/weakform/stress_equilibrium.py. [1] [2] [3] [4] [5] [6] [7]

Refactoring and code simplification:

  • Refactored the LocalFrame class to use simcoon.Rotation for rotation operations, removed legacy/manual rotation code, and improved the documentation and structure of the class and its methods.
  • Updated the local2global_H method in Mechanical3D to use simcoon.Rotation for Voigt stress rotation, simplifying the logic and ensuring consistent frame transformations.

Documentation and utility improvements:

  • Improved docstrings and parameter explanations for LocalFrame and related utility functions, clarifying their usage and expected input/output formats. [1] [2] [3] [4]

These changes make the codebase more robust, readable, and maintainable by centralizing rotation logic and improving documentation.

Replace handwritten rotation and Voigt transformation logic with simcoon.Rotation utilities across the codebase. composite_ud now uses Rotation.from_euler().as_voigt_stress_rotation() to rotate stiffness tensors and handles batched/single H shapes robustly. Mechanical3D.local2global_H was refactored to use Rotation.from_matrix(...) and simcoon voigt rotations, with clearer shape handling and docstring. LocalFrame was modernized: constructor signature fixed, Rotate uses Rotation.from_euler, added as_rotation(), improved docstrings, and GenerateCylindricalLocalFrame/global_local_frame implementations simplified. Overall this simplifies rotation code, fixes batching/shape issues, and centralizes rotation math into simcoon for correctness and clarity.
Update simcoon requirement to >=1.11.0 across packaging and environment files (conda.recipe/meta.yaml, environment.yml, environment_doc.yml, pyproject.toml). In pyproject.toml simcoon was moved into the main dependencies and the separate simcoon optional group was removed; the 'all' extra no longer includes simcoon. Code fixes: replace identity check 'is not 0' with proper inequality '!= 0' in fedoo/util/localframe.py to avoid an unintended identity comparison, and minor line-wrapping/style cleanups in fedoo/weakform/stress_equilibrium.py (no behavioral changes).
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.

1 participant