Codim-IPC icon indicating copy to clipboard operation
Codim-IPC copied to clipboard

Export physical parameters like contact forces

Open Shamp0o opened this issue 1 year ago • 1 comments

Thank you for this amazing piece of software and for open sourcing it.

I'm planning to use your software in an engineering research context. After playing around with it for a bit I was wondering if there is any way to get contact forces and other values like torques, internal foces, positions and velocities resulting from the simulation with the python bindings. I guess latter two can be calculated from the resulting obj files.

Shamp0o avatar Sep 15 '22 06:09 Shamp0o

Thanks for your interest in our work! Unfortunately we didn't expose these to the python binding. But all these information should be able to be obtained via certain C++ functions. For example, the contact forces can be obtained by first computing the barrier gradient using Compute_IncPotential_Gradient() in https://github.com/ipc-sim/Codim-IPC/blob/main/Library/FEM/Energy/IPC_ENERGY.h and then divide it by -dt^2.

liminchen avatar Sep 16 '22 03:09 liminchen