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

[error] constraintVal = 0 when evaluating constraints #19

Closed kmindspark closed 3 years ago

kmindspark commented 3 years ago

I get this error when trying to run IPC on a custom rope mesh.

       0  8.90364 0.155414
      0 8.83411  0.1542
       0  8.80866 0.153756
       0  8.99863 0.157072

A friend is able to run the same .txt file with the same mesh on a different computer. Do you have any suggestions on what the root cause may be? The tutorials run fine for me.

liminchen commented 3 years ago

I think this can be floating-point arithmetic issue. The error means that 0 distance primitive pairs on the input are detected. It could be that the compiler over-optimized floating-point arithmetic so that it is fast but not accurate? Eliminate extremely tiny edges or gaps in the input should also help.

kmindspark commented 3 years ago

Hmm...I've tried varying meshes but the issue seems to remain. Do you know if there is a way to turn off this "over-optimization" of floating point arithmetic?

zfergus commented 3 years ago

You can try to build in Debug mode to remove all optimizations. This should help rule this out.

kmindspark commented 3 years ago

I actually just ran the cmake and make commands once more and the error disappeared. Not sure why, but it works now :)

Thanks for the help.