Separate Static and Kinetic Coefficients of Friction#177
Merged
Conversation
- Added `smooth_mu`, `smooth_mu_derivative`, `smooth_mu_f0`, `smooth_mu_f1`, `smooth_mu_f2`, `smooth_mu_f1_over_x`, and `smooth_mu_f2_x_minus_f1_over_x3` functions in `smooth_mu.cpp` and `smooth_mu.hpp` to handle the transition between static and kinetic friction smoothly. - Implemented unit tests for the smooth friction functions in `test_smooth_mu.cpp`, including gradient and Hessian checks using finite difference methods. - Ensured proper assertions and edge case handling for the friction coefficient calculations.
TODO: * Add separate coeff. in TangentialCollision * Implement smooth_mu for adhesion
- Introduced smooth friction mollifier functions: smooth_mu_a0, smooth_mu_a1, smooth_mu_a2, smooth_mu_a1_over_x, and smooth_mu_a2_x_minus_mu_a1_over_x3 in adhesion.cpp and adhesion.hpp. - Updated tangential adhesion potential methods to utilize smooth friction functions instead of direct calculations. - Refactored existing friction mollifier functions for improved clarity and performance. - Added unit tests for the new smooth friction mollifier functions to ensure correctness and stability.
… tangential collisions
zfergus
commented
Jul 17, 2025
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #177 +/- ##
==========================================
+ Coverage 96.42% 96.47% +0.05%
==========================================
Files 102 103 +1
Lines 7766 7856 +90
==========================================
+ Hits 7488 7579 +91
+ Misses 278 277 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ntation - Enhance documentation for adhesion and friction modules with new smooth_mu functions. - Update bindings to include new smooth_mu functionalities.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances tangential collision handling by separating static (mu_s) and kinetic (mu_k) friction coefficients and implementing smooth transitions between them using new smooth_mu functions.
- Replaced single friction coefficient
muwith separatemu_sandmu_kthroughout the codebase - Added new
smooth_mumodule with functions for smooth friction coefficient transitions - Updated potential calculations to handle distinct static/kinetic coefficients with fallback behavior
Reviewed Changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/ipc/friction/smooth_mu.hpp/.cpp |
New module implementing smooth static-to-kinetic friction transitions |
src/ipc/collisions/tangential/tangential_collision.hpp |
Updated collision struct to use mu_s and mu_k instead of single mu |
src/ipc/potentials/tangential_potential.hpp/.cpp |
Refactored potential interface to accept separate friction coefficients |
src/ipc/potentials/friction_potential.cpp |
Updated to use new smooth mu functions |
tests/src/tests/friction/test_smooth_mu.cpp |
Comprehensive finite difference tests for new smooth mu functions |
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.
Description
This pull request introduces enhancements to tangential collision handling by distinguishing between static and kinetic friction coefficients (
mu_sandmu_k) and implementing smooth transitions between them.Tangential Collision Enhancements:
Distinction between static and kinetic friction coefficients: Updated
TangentialCollisionclass to replacemuwith separatemu_s(static friction coefficient) andmu_k(kinetic friction coefficient). This change applies to the class definition and all related methods.Updated
TangentialCollisions::buildmethod: Modified the method to handle separatemu_sandmu_kcoefficients, ensuring that all calculations account for the distinction between static and kinetic friction.Smooth Friction Coefficient Implementation:
New
smooth_mufunctions: Added functions to compute smooth transitions between static and kinetic friction coefficients, including derivatives and related mathematical formulations. These functions improve the modeling of friction forces at varying tangential velocities.Integration with adhesion module: Incorporated smooth friction coefficient calculations into the adhesion module.
Type of change
How Has This Been Tested?
smooth_muChecklist