simkit.energies.contact_springs_sphere#
Penalty contact springs against a sphere.
A one-sided quadratic penalty: points that fall inside the sphere are pushed
back out along the (per-point) contact normal, leaving the tangential component
free. This is an external potential, not a per-element material energy, so there
is no element / F tier; the functions take vertex positions directly and
detect the active (penetrating) set internally.
Functions#
|
Penalty energy for contact with a sphere. |
|
Penalty gradient for contact with a sphere. |
|
Penalty Hessian for contact with a sphere. |
Module Contents#
- simkit.energies.contact_springs_sphere.contact_springs_sphere_energy(X: numpy.ndarray, k: float, p: numpy.ndarray, r: float, M: scipy.sparse.spmatrix | None = None) float#
Penalty energy for contact with a sphere.
- Parameters:
- Returns:
energy – Total contact energy.
- Return type:
- simkit.energies.contact_springs_sphere.contact_springs_sphere_gradient(X: numpy.ndarray, k: float, p: numpy.ndarray, r: float, M: scipy.sparse.spmatrix | None = None) numpy.ndarray#
Penalty gradient for contact with a sphere.
- Parameters:
- Returns:
gradient – Assembled gradient.
- Return type:
np.ndarray (num_verts*dim, 1)
- simkit.energies.contact_springs_sphere.contact_springs_sphere_hessian(X: numpy.ndarray, k: float, p: numpy.ndarray, r: float, M: scipy.sparse.spmatrix | None = None) scipy.sparse.spmatrix#
Penalty Hessian for contact with a sphere.
- Parameters:
- Returns:
H – Assembled Hessian. PSD by construction.
- Return type:
scipy.sparse matrix (num_verts*dim, num_verts*dim)