Open
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the handling of rotations and local frames across several modules by consistently adopting the
simcoon.Rotationclass for all rotation-related operations. This change improves code maintainability, accuracy, and clarity, replacing previous manual implementations with standardized rotation utilities. Additionally, theLocalFrameclass and related utilities are modernized and better documented.Rotation handling modernization:
simcoon.Rotationand its methods (such asfrom_euler,from_matrix,as_voigt_stress_rotation,apply_strain,apply_stress) infedoo/constitutivelaw/composite_ud.py,fedoo/core/mechanical3d.py,fedoo/util/localframe.py, andfedoo/weakform/stress_equilibrium.py. [1] [2] [3] [4] [5] [6] [7]Refactoring and code simplification:
LocalFrameclass to usesimcoon.Rotationfor rotation operations, removed legacy/manual rotation code, and improved the documentation and structure of the class and its methods.local2global_Hmethod inMechanical3Dto usesimcoon.Rotationfor Voigt stress rotation, simplifying the logic and ensuring consistent frame transformations.Documentation and utility improvements:
LocalFrameand 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.