A finite element framework for solving contact problems using the Fiber Monte Carlo (FMC), enabling differentiable estimation of volume-based contact energy for contact forces.
Backend support: 1. modern automatic differentiation and finite element libraries, including JAX and JAX-FEM. 2. repository of FMC.
Contact forces are derived as the gradient of a a volume-based energy function. FMC enables this approach by providing differentiable volume estimation, in contrast to the non-differentiable estimation by standard MC.
Standard Monte Carlo: Point sampling |
Fiber Monte Carlo: Line segment sampling |
Standard Monte Carlo: non-differentiable estimates |
Fiber Monte Carlo: differentiable estimates |
🐟 Complex geometry handling: Derive contact forces from energy gradients, avoiding projection issues at corners and edges.
⭐ Non-matching mesh support: Remove contact pair search, master–slave setup, and projection iterations for non-matching meshes.
❄️ Easy solver integration: Incorporate contact forces directly into discretized weak forms like an ``add-on''
First install JAX (see JAX installation guide), then follow the JAX-FEM instructions to install JAX-FEM, which will create a new conda environment. Activate the environment and clone the repository:
git clone https://github.com/CMSL-HKUST/FMC_contact.git
cd FMC_contactthen install the package locally:
pip install -e .The model setup: geometry and boundary conditions.
Change to the cloned directory and run
python -m examples.static.main
Distribution of von mises stress , represented by colormap.
The model setup: geometry and boundary conditions.
Change to the cloned directory and run
python -m examples.dynamics.mainDynamic evolution of von mises stress during collision.
📣 Coming soon!
This project is licensed under the GNU General Public License v3 - see the LICENSE for details.
If you find this work useful, please consider citing the following paper:
@article{wang2025sovling,
title={Solving contact problems using Fiber Monte Carlo},
author={Wang, Xinyu and Xu, Weipeng and Xue, Tianju},
journal={arXiv preprint arXiv:2509.08609},
year={2025},
url={https://arxiv.org/abs/2509.08609}
}





