ipc-sim / IPC

Incremental Potential Contact (IPC) is for robust and accurate time stepping of nonlinear elastodynamics. IPC guarantees intersection- and inversion-free trajectories regardless of materials, time-step sizes, velocities, or deformation severity.
https://ipc-sim.github.io/
MIT License
558 stars 73 forks source link
barrier-method computer-animation computer-graphics constrained-optimization elastodynamics interior-point-method numerical-optimization optimization-time-integrator physical-simulation physics-based-animation siggraph

Build License

IPC

This is the opensource reference implementation of the SIGGRAPH 2020 paper Incremental Potential Contact: Intersection- and Inversion-free Large Deformation Dynamics.

Files

Build

You can either use python build.py or

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4

gcc 7 or later is recommended.

Dependencies

Optional Dependencies

Without OpenGL

If your system does not have the required OpenGL libraries, you can disable the viewer using the CMake argument -DIPC_WITH_OPENGL=OFF. It is important to then run IPC in offline mode (see below).

2D?

IPC is only implemented for 3D simulation.

HPC

If your system uses Slurm like our cluster does, then you can take advantage of our scripts to build IPC as a batch job.

From the IPC root directory use sbatch build.sh to compile IPC via a batch job. You can check the status of the job using squeue -u $USER -n IPC_build.

It is important to not build on the login node because while it supports AVX2, the compute nodes may not. Building on the login node will enable AVX2 support which may cause an Illegal instruction error when run on a compute node. Alternatively, this can be fixed by using Intel's compilers, icc and icpc, with the flag -axCORE-AVX2. This enables executables to run on compute nodes with or without AVX2 instructions. If the compute nodes support AVX2 instructions, executables will run AVX2 instructions, otherwise it will use other available instructions such as AVX or SSE4.2.

Sub-Projects

IPC contains two optional sub-projects for unit tests, debug, and file processing. To enable them use the CMake flag -DIPC_BUILD_<sub-project-name>_PROJECT=On where sub-project-name is the name of the sub-project (e.g. DIAGNOSTIC or MESH_PROCESSING). You can also set these interactively using ccmake.

Run

Please see our quick start guide for a hello world example with various settings. The output of each script will be saved into a separate folder in output/.

Offline Mode

It is possible to run IPC with and without the viewer. By default, the batch.py script runs IPC with the viewer. If you provide the argument --offline to batch.py then it will run IPC in offline mode (i.e. without the viewer).

If you are running the IPC_bin executable directly then the first argument controls the mode. Mode 10 runs IPC with the viewer and is the default in the batch.py. Mode 100 runs IPC in offline mode (without the viewer). See IPC_bin --help for more detail.

HPC

From the IPC root directory use sbatch run.sh to processes all the input files in input/12/ using 12 CPU cores.

This will process all input scenes in series. I am currently, working on a script to process all scenes in parallel via separate batch jobs.

Sub-Projects

The executables for the sub-projects are placed in their respective directory in src/Projects/.

Output Files

Script Settings

See our quick start guide for detailed examples of minimal settings needed for a simulation.

Legacy Settings

Some of our settings are legacy settings or the ones that are not usually used/recommended. We include them here for completeness as they have been used by our paper examples or tests.

QP/SQP Settings

The following settings only affect the QP and SQP contact constraint solvers we use for comparisons.

Comparisons

We conducted a lengthy comparison of our method and several other commercial and open-source software, and "vanilla" implementations of other methods. You can read the full details in Supplement B.

You can find the scenes, meshes, and other files used in these comparisons in input/paperExamples/supplementB.

Tests

The tests directory contains a very limited number of unit-tests. These tests use Catch2 which is downloaded through CMake unless the option -DIPC_WITH_TESTS=OFF is provided. Currently, these test contain test the collision constraints used by the SQP solver.

Tools

The tools directory contains several tools for generating meshes, running scenes, and processing results.