Incremental Potential Contact (IPC) is for robust and accurate time stepping of nonlinear elastodynamics. IPC guarantees intersection- and inversion-free trajec
Incremental Potential Contact (IPC) is for robust and accurate time stepping of nonlinear elastodynamics. IPC guarantees intersection- and inversion-free trajec
This is the opensource reference implementation of the SIGGRAPH 2020 paper Incremental Potential Contact: Intersection- and Inversion-free Large Deformation Dynamics.
src/: source code
cmake/ and CMakeLists.txt: CMake files
Format/: automatic code formatting (requires clang-format)
input/: input data and scripts needed to rerun all examples in our paper, together with some tutorial examples
output/: output data (will be created)
tests/: unit-tests
tools/: Python and Bash scripts for generating and processing results
wiki/: images used in Github wiki page
build.py: a python script to automatically build IPC with default compiler
batch.py: a python script to automatically run a batch of examples (in input/n/ by default) with n threads for each linear solver in the program
batch_tetgen.py: a python script to automatically tetrahedralize a batch of closed surface meshes using Tetgen
You can either use python build.py or
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4gcc 7 or later is recommended.
-DIPC_WITH_CHOLMOD=OFFbrew install suite-sparseSuiteSparse/include and SuiteSparse/lib to /usr/local/include and
/usr/local/lib respectively.sudo apt-get install libsuitesparse-dev libmetis-devmake library BLAS='-lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -lpthread -lm -lmkl_blas95_lp64 -liomp5' LAPACK='-lmkl_lapack95_lp64' -j 8IPC_LINSYSSOLVER in CMakeLists.txt. To use custom linear solvers, you can implement a new interface (subclass) to our LinSysSolver class.-DIPC_WITH_AMGCL=OFFIf 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).
IPC is only implemented for 3D simulation.
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.
IPC contains two optional sub-projects for unit tests, debug, and file processing. To enable them use the CMake
flag -DIPC_BUILD__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.
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/.
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.
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.
The executables for the sub-projects are placed in their respective directory
in src/Projects/.
.obj: surface mesh of the simulated objects and volumetric/surface kinematic collision objects in n-th time stepn.seg: mesh file of the segment kinematic collision objects if any in n-th time steppt.obj: vertex coordinates of the point cloud kinematic collision objects if any in n-th time stepstatus: saved information of n-th time step that can be used to restart simulation fromACO_.obj: mesh file of m-th analytical plane if any in n-th (and the following if unchanged) time stepsBC_.txt: node index of Dirichlet nodes if any in n-th (and the following if unchanged) time steps0.png: snapshot of initial time stepfinalResult.png: snapshot of last time stepfinalResult_mesh.msh: rest shape of simulated objectanim.gif: animation preview of the simulationconfig.txt: the config file containing all simulation settings that can be used to rerun the simulationiterStats.txt: simulation/optimization statistics of each iterationinfo.txt: timing informationlog.txt: debug informationsysE.txt: total energy (kinematic, gravity, and elasticity) of each simulated objectsysL.txt: linear momentum of each simulated objectsysM.txt: angular momentum of each simulated objectSee our quick start guide for detailed examples of minimal settings needed for a simulation.
energy {FCR | NH}NH: Neo-Hookean elasticity energy (default)FCR: Fixed Co-rotational elasticity energytimeIntegration {BE | NM} BE: Backward Euler (default)NM: Newmark (optional: add β and γ to change from default of 0.25 and 0.5)dampingStiff dampingStiff or not if dampingStiff is zero or not specifieddampingStiff must be greater than or equal to zerodampingRatio dampingStiff to be 0.75 * dampingRatio * h^3 or 0 if dampingRatio is zero or not specifieddampingRatio must be greater than or equal to zerotime density stiffness turnOffGravityshapes input ...material initVel DBC [] []NBC [] []linearVelocity angularVelocity DBCTimeRange shapes command during (t_begin, t_end], by default (0, +inf]NBCTimeRange shapes command during (t_begin, t_end], by default (0, +inf]ground halfSpace stiffness is unusedselfCollisionOffselfFric : specify the friction coefficient of self-contact, by default 0 (no friction)selfFricCoeff must be larger or equal to 0, setting it larger than 1 is alloweddHat : set the distance that IPC sees objects as attaching and exert contact forces, by default it is 1e-3 that of the diagonal length of the bounding box of the scenedHat must be larger than 0epsv : set the relative tangent velocity that IPC sees the attached objects as not sliding and exert static friction forces, by default it is 1e-3 that of the diagonal length of the bounding box of the scene per secondepsv must be larger than 0fricIterAmt : set the maximal friction iterations that IPC updates friction tangent and normal forces, by default it is 10 or negative, IPC will update friction tangent and normal forces until convergence (not guaranteed so not recommended)tol positiveIntegerpositiveInteger is also a relative value on the bounding box diagonal lengthconstraintSolver {interiorPoint | QP | SQP}interiorPoint: IPC (default)QP: solve elasticity as a single QP with nonlinear contact constraintsSQP: solve elasticity as a sequence of quadratic programs with nonlinear contact constraintsrestart view {orthographic | perspective}zoom cameraTrackingplayBackSpeed anim.gif, which also controls how many frame data will be output (smaller value results in more output (at most output every frame))appendStr disableCoutsection {interiorPoint | QP | penalty}No open issues yet, or sync has not completed.