Open
Conversation
…tter readability.
… handling numerical edge cases.
This commit introduces a new example script demonstrating the use of anisotropic friction in the IPC Toolkit. The script showcases the setup of a simple collision scenario, building normal and tangential collisions, assigning anisotropic friction coefficients, and computing effective friction for various velocity directions. Additionally, it compares the results with isotropic friction to highlight the differences in behavior.
… of effective friction coefficients and ensure finite results. Update documentation to reflect changes in function name and return values.
…nd improve clarity. Update documentation and tests to reflect changes from `anisotropic_mu_eff_sqrt_mu0_t0_sq_plus_mu1_t1_sq` to `anisotropic_mu_eff_f` and related functions.
…ility by consolidating function calls into single lines. This change enhances clarity without altering the test logic.
… and consistency. Convert markdown cells to code cells in the notebook, enhance symbolic variable definitions, and streamline friction force visualization. Update test cases to ensure consistent function calls and improve readability.
…move backward compatibility section from the tutorial, update execution counts in the notebook, and streamline function definitions in the C++ code. Enhance test cases for consistency and readability.
This commit introduces the Matchstick model for anisotropic friction, enhancing the IPC Toolkit's capabilities. Key changes include: - Addition of the Matchstick model reference in `references.bib`. - Updates to the C++ and Python API documentation to include anisotropic friction helpers and their usage. - Enhancements in the `advanced_friction` tutorial to cover anisotropic friction features and their implementation. - New tests for anisotropic friction transitions and effective coefficient calculations. Documentation now references Erleben et al. (2019) for the model's derivation and implementation details.
…2/ipc-toolkit into anisotropic_friction
…prove code comments for clarity in tangential collision and potential implementations.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #210 +/- ##
==========================================
- Coverage 96.96% 96.92% -0.05%
==========================================
Files 161 161
Lines 24747 24878 +131
Branches 893 908 +15
==========================================
+ Hits 23997 24114 +117
- Misses 750 764 +14
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:
|
Member
|
Woooow! This is really awesome. Thanks for the contribution. The matchstick method for anisotropic friction was something I was interested in implementing, so I am super excited you did it already. 😄 I'll review the changes in depth when I have some free time. 🚀 |
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 PR adds anisotropic friction support to IPC Toolkit’s tangential contact model, including full derivative support (energy/gradient/Hessian, friction force, and force Jacobians) with backward-compatible defaults.
Summary of changes
Per-collision anisotropy parameters
mu_aniso(tangent-space velocity scaling) and optional direction-dependent ellipse axesmu_s_aniso/mu_k_anisoonTangentialCollision.mu_aniso = (1,1)andmu_s_aniso = mu_k_aniso = (0,0)(isotropic fallback).Core friction model updates (high impact area)
tau_aniso).mu_s/mu_kfrom the (scaled) direction using an elliptical L2 / matchstick formulation; otherwise uses scalarmu_s/mu_k.New friction helpers
anisotropic_mu_eff_f,anisotropic_mu_eff_f_dtau,anisotropic_mu_eff_from_tau_aniso, etc.).Tests
Docs
Motivation & context
Real materials often exhibit direction-dependent friction (wood grain, brushed/rolled metal, textiles). This PR adds a practical anisotropic model that:
Dependencies required
notebooks/anisotropic_friction_math.ipynb(if you want to reproduce the derivations/plots).Fixes #4
Type of change
How Has This Been Tested?
Reproduction steps
Test Configuration:
Checklist
Note
High Risk
Touches core friction force/Jacobian/Hessian code paths used by solvers, so mistakes can affect stability and convergence across simulations. While defaults are backward-compatible and tests were added, the new derivative logic increases numerical/edge-case risk.
Overview
Adds anisotropic friction support to tangential contact by introducing per-collision parameters
mu_aniso(tangent-space velocity scaling) and optional direction-dependent ellipse axesmu_s_aniso/mu_k_aniso, with zero/default values preserving existing isotropic behavior.Updates tangential friction energy/force/gradient/Hessian and force Jacobians to evaluate friction using scaled tangential velocity (
tau_aniso) and, when ellipse axes are provided, an effective friction coefficient via an elliptical L2 ("matchstick") model; includes new helper functions (and Python bindings) for effective-μ evaluation and derivatives.Extends documentation (C++/Python API pages and
advanced_frictiontutorial), adds theErleben2019Matchstickreference plus a derivation notebook, and adds/updates unit tests covering the new helpers and anisotropic force/Jacobian correctness.