-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistency in normal force magnitudes when varying 1) timestep size or 2) material properties #23
Comments
Hi Chung Min, Thanks a lot for your interest in our project! Your tests are very interesting and there are certainly some bugs for calculating the normal forces. We will look into it. |
The I will have to think more about why the density of the pad affects the normal force, but I think Minchen is right to try to refine the mesh and see if this improves the accuracy when the density is smaller. |
Based on your recommendation ("summing up the contact force vector on all nodes and then calculate the norm of this sum"), I wrote up a simple python-based contact-force calculator as shown below:
However, I am still getting numbers similar to my previous reply (the config files are kept the same, with timestep=1, so lambda = lambda/h^2).
I also re-ran the calculator without the lines
Also, a side question, but is IPC deterministic? So far, when I re-run scenes, the contact forces appear to stay the same. |
Based on your feedback from last time, I believe that you were referring to the IPC/src/TimeStepper/Optimizer.cpp Lines 3430 to 3452 in 62cf829
IPC/src/TimeStepper/Optimizer.cpp Lines 3480 to 3522 in 62cf829
gradient , I exported this vector along the friction data atIPC/src/TimeStepper/Optimizer.cpp Line 3524 in 62cf829
total_gradient in the json file ("total", as it incorporates friction and deformation effects, unlike the pre-existing gradient vector storing friction gradient data).
Reading this, I ran the following lines to retrieve the gradient sum for the first-object DOFs:
The sphere mesh (consisting of 1760 nodes) was placed before the mat40x40 mesh (3200 nodes), and since the barrier energy gradient vector consisted of all the vertices, I summed up the 3D DOF vectors for the first 1760 vertices as shown below:
, and found that
|
I think you only want the contact part of the gradient, and look at only the sphere. The total_gradient should be everywhere nearly 0 as the scene becomes static. |
First, I wanted to say that this is an amazing project, and I really appreciate the work you have put into this project. I’m currently trying to see if there is a way to calculate the total force acting on a mesh (i.e., for each mesh inputted in with
shapes input
configuration), and I was hoping that the friction information export update in 24ab245 would be sufficient to do this task.For some initial testing, I placed a cube on top of a 20x20 pad as shown below. Here, I expected that normal forces should be approximately aligned with the y-axis, so a sum of the normal force magnitudes (from lambda terms as saved by the last call of
save_friction_data
within the simulation) should equal the force applied by the cube onto the pad by its weight.When I run the script above, the normal force applied by the cube is calculated to be 9948.064, which similar to the expected value 9810 (1000 kg cube presses into pad with force of 1000*9.81 newtons).
For a more extensive study, I tried repeating the above test, while:
Is there something I’m missing? I would have expected all of these tests to return the same normal force values, but this does not appear to be the case.
The text was updated successfully, but these errors were encountered: