Coder Social home page Coder Social logo

huangzizhou / diffipc-data Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 0.0 39.29 MB

Differentiable solver for time-dependent deformation problems with contact

Home Page: https://cims.nyu.edu/~zh1476/research/diffipc.html

License: MIT License

Jupyter Notebook 64.61% Python 35.39%
collision differentiable-simulation optimization physics-simulation soft-body-simulation inverse-problems shape-opt trajectory-optimization

diffipc-data's Introduction

[Siggraph 2024] Differentiable solver for time-dependent deformation problems with contact

This is the caption\label{mylabel}

A repository of the data and script used in our work, "Differentiable solver for time-dependent deformation problems with contact" [Huang et al. 2024]. See page for the video of examples in this repository.

Usage

The source code is integrated in the open-source library PolyFEM. To reproduce examples in this repository, minor changes were made in the branch diffIPC to support specific features. See PolyFEM Documentation for compilation of PolyFEM and its JSON interface.

Environment

The PolyFEM library automatically downloads its dependencies with cmake. The default linear solver in simulations is Eigen::PardisoLDLT, which requires MKL, it's not available on MacOS with Apple silicon, in which case Eigen::AccelerateLDLT or Eigen::CholmodSimplicialLDLT are recommended.

For shape optimizations, jupyter notebooks are provided to manage the optimizations with remeshing. The dependencies used in python are available in anaconda, with the only non-default library meshio.

Tutorial

Please refer to the IPC guide for setting up a simulation of soft bodies with frictional contact in PolyFEM, and Trajectory Optimization page for setting up a trajectory optimization using the JSON interface.

Run examples with JSON

Each example folder in ./json_scripts includes one optimization JSON file for the configuration of the optimization, and one or more simulation JSON files for the configuration of the physics simulations.

For non-shape optimizations, cd to the example folder and use the command

~/polyfem/build/PolyFEM_bin -j opt.json --ns

to run the code.

Since shape optimizations (Fig 6 - 12) need remeshing when the mesh quality gets bad, a jupyter notebook is provided in each folder to organize the optimization. The python script calls the polyfem binary to run the shape optimization iteratively: Once the mesh quality reaches a low threshold (e.g. scaled Jacobian is 1e-7), the optimization program stops and the remeshing tool (Gmsh for 2D, MMG for 3D) generates a volumetric mesh with better quality while preserving the surface shape.

Run examples with Python

Examples in ./python_scripts show how to use the Python binding of PolyFEM to set up an optimization problem. The Python binding of PolyFEM can be found on this page.

The differentiable simulator is wrapped into a Pytorch autograd class, which can be integrated into a training pipeline and be used as a differentiable computing block to construct your own loss functions.

The four examples of running optimization with python binding include shape optimization, material optimization, initial velocity optimization, and friction coefficient optimization. The Python binding of PolyFEM is under construction, more examples are coming soon!

Output

The objective and its gradient norm at each iteration are reported in the log. The simulation results are exported as VTK format and can be visualized in Paraview. The transient result files have the format of step_{t}, where t is the time step; optimization result files have the format of opt_state_{i}_iter_{j}, where i is the ID of the simulation (in the case where multiple simulations are included), j is the iteration number of the optimization.

Citation

If you use this work/data. Please cite our paper:

@article{10.1145/3657648,
author = {Huang, Zizhou and Tozoni, Davi Colli and Gjoka, Arvi and Ferguson, Zachary and Schneider, Teseo and Panozzo, Daniele and Zorin, Denis},
title = {Differentiable solver for time-dependent deformation problems with contact},
year = {2024},
issue_date = {June 2024},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
volume = {43},
number = {3},
issn = {0730-0301},
url = {https://doi.org/10.1145/3657648},
doi = {10.1145/3657648},
abstract = {We introduce a general differentiable solver for time-dependent deformation problems with contact and friction. Our approach uses a finite element discretization with a high-order time integrator coupled with the recently proposed incremental potential contact method for handling contact and friction forces to solve ODE- and PDE-constrained optimization problems on scenes with complex geometry. It supports static and dynamic problems and differentiation with respect to all physical parameters involved in the physical problem description, which include shape, material parameters, friction parameters, and initial conditions. Our analytically derived adjoint formulation is efficient, with a small overhead (typically less than 10\% for nonlinear problems) over the forward simulation, and shares many similarities with the forward problem, allowing the reuse of large parts of existing forward simulator code.We implement our approach on top of the open-source PolyFEM library and demonstrate the applicability of our solver to shape design, initial condition optimization, and material estimation on both simulated results and physical validations.},
journal = {ACM Trans. Graph.},
month = {may},
articleno = {31},
numpages = {30},
keywords = {Differentiable simulation, finite element method, elastodynamics, frictional contact}
}

diffipc-data's People

Contributors

huangzizhou avatar

Stargazers

星吧唧 avatar Minseong Kim avatar  avatar HamiltonHuaji avatar Zherui Yang avatar Tao Du avatar oshimeiko avatar Dakri Abdelmouttaleb avatar Zu Wang avatar ARessegetes Stery avatar onion avatar JaeHyun Lee avatar summ avatar Chang Yu avatar

Watchers

swq0553 avatar Arvi Gjoka avatar  avatar

diffipc-data's Issues

report a bug

Dear author,

Thanks for sharing your amazing work!
When I try to run the case, I encountered a bug as follow:
[2024-06-09 11:59:13.954] [adjoint-polyfem] [info] Saving adjoint output to [2024-06-09 11:59:13.970] [polyfem] [error] Can't find json for State 0 terminate called after throwing an instance of 'std::runtime_error' what(): Can't find json for State 0 Aborted (core dumped)
So, any good advices to fix this bug, looking forward to your reply!
Best.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.