RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.18k stars 1.24k forks source link

Increase the number of quadrature points used to sample external forces in FEM deformable simulation #21496

Open chen-tianjian opened 1 month ago

chen-tianjian commented 1 month ago

Is your feature request related to a problem? Please describe. We (Amazon) are leveraging the external force field for FEM to simulate picking deformables with suction cups. However, we are limited to coarse meshes because of real time rate, so the tetrahedron sizes are roughly same as our suction cups, but this create problems for us.

To recreate our problem using the deformable_torus example:

Change this falloff_distance from 0.1 to 0.01 or smaller here (more realistic to a suction cup affecting volume size), and then no matter how much force density we use here(we tried 10X ~ 1e10X), the torus cannot be picked up.

If we increase the mesh resolution (using the torus_fine.vtk attached), this problem will be gone, but the real time rate is not acceptable for us. torus_fine.zip

Based on a Slack dicussion, @xuchenhan-tri suggested that this is because the external force is only integrated at the quadrature points, and there’s only one quadrature point at the barycenter of each tetrahedron at this moment. If no quadrature points are inside the force field, no force can be generated.

Describe the solution you'd like Increase the number of quadrature points in a tetrahedron used to sample external forces, to better deal with the coarse mesh and small force field case.

xuchenhan-tri commented 3 weeks ago

Right now, we are using the same set of quadrature points for both internal (elastic) forces and external forces.

To increase the number of quadrature points for external forces, we need to create a new set of quadrature points exclusively for external forces instead of keeping the single set of quadrature points serving dual purposes. This is because the amount of computation we perform on external force quadrature points is small (evaluating the external force and computing the determinant of the deformation gradient if necessary) compared to that on internal force quadrature points (often requiring an SVD).

Right now, we only support linear, quadratic, and cubic Gaussian quadrature, with the cube one providing the most number of quadrature points (five). Ideally, we should have a knob for the user to select the density of quadrature points for them to find the ideal number of quadrature density for their use case. That would require extending the set of quadrature rules we support.