Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FMC-contact

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.

Overview

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

Features

🐟 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''

Installation

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_contact

then install the package locally:

pip install -e .

Examples

Small-strain: Indentation by a wedge

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.

Finite-strain: Collision of two elastic bodies

The model setup: geometry and boundary conditions.

Change to the cloned directory and run

python -m examples.dynamics.main

Dynamic evolution of von mises stress during collision.

Others

📣 Coming soon!

License

This project is licensed under the GNU General Public License v3 - see the LICENSE for details.

Citations

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}
}

About

Contact simulation based on Fiber Monte Carlo within FEM framework

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages