jaxdem.forces.facet_contact#
Facet contact force model.
Functions
|
Return a facet's unit normal, or zero for collapsed geometry. |
|
Bound each contact primitive from its current search-key position. |
|
Get the sphere indices of the facet clump that contains |
|
Compute the distance from point |
|
Return point-triangle separation, closest point and barycentric weights. |
|
Compute the shortest distance between the segments |
|
Return triangle separation, closest points and barycentric coordinates. |
- jaxdem.forces.facet_contact.point_triangle_distance(p: jax.Array, a: jax.Array, b: jax.Array, c: jax.Array, system: System, *, face: bool = True, edge: bool = True, vertex: bool = True) tuple[jax.Array, jax.Array, jax.Array][source]#
Return point-triangle separation, closest point and barycentric weights.
Static feature switches omit contacts whose closest point lies in a disabled Voronoi region; they do not select a farther feature. Face and edge interiors exclude their boundaries. Collapsed triangles reduce to their segments or vertices. Rejected queries return infinite distance and finite placeholder points and coordinates.
- jaxdem.forces.facet_contact.segment_segment_distance(p1: jax.Array, q1: jax.Array, p2: jax.Array, q2: jax.Array, system: System) tuple[jax.Array, jax.Array, jax.Array, jax.Array, jax.Array][source]#
Compute the shortest distance between the segments
p1-q1andp2-q2.Also return the closest point on each segment and its interpolation weights. Collapsed segments reduce to point-segment or point-point queries.
- jaxdem.forces.facet_contact.triangle_triangle_distance(t1_a: jax.Array, t1_b: jax.Array, t1_c: jax.Array, t2_a: jax.Array, t2_b: jax.Array, t2_c: jax.Array, system: System, *, vertex_triangle: bool = True, edge_edge: bool = True, edge_triangle: bool = True) tuple[jax.Array, jax.Array, jax.Array, jax.Array, jax.Array][source]#
Return triangle separation, closest points and barycentric coordinates.
Vertex-face and edge-edge candidates cover disjoint and coplanar triangles; edge-face piercings also detect interior crossings. Zero-area triangles reduce to their edges or vertices. At nonunique contacts, vertex order deterministically selects one valid closest point.
The static switches select computational query families, rather than disjoint geometric contact types.
vertex_triangleincludes a triangle’s boundary,edge_edgeincludes segment endpoints, andedge_triangletests piercings only. Disabled families are omitted during tracing. With all families disabled, the distance is infinite and the other outputs are finite placeholders.
- jaxdem.forces.facet_contact.facet_normal(a: jax.Array, b: jax.Array, c: jax.Array | None, system: System) jax.Array[source]#
Return a facet’s unit normal, or zero for collapsed geometry.
- jaxdem.forces.facet_contact.point_segment_distance(p: jax.Array, a: jax.Array, b: jax.Array, system: System, *, edge: bool = True, vertex: bool = True) tuple[jax.Array, jax.Array, jax.Array][source]#
Compute the distance from point
pto the segmenta-b.Also return the closest point on the segment and its interpolation weights.
edgecontrols the open segment interior andvertexits endpoints, including collapsed segments. A disabled closest feature returns infinite distance and finite placeholders without substituting another feature. The switches are static and specialize the query.
- jaxdem.forces.facet_contact.get_facet_indices(idx: jax.Array, state: State) tuple[jax.Array, jax.Array, jax.Array][source]#
Get the sphere indices of the facet clump that contains
idx.Returns
(is_facet, indices, is_primary).
- jaxdem.forces.facet_contact.facet_search_radii(state: State, system: System) jax.Array[source]#
Bound each contact primitive from its current search-key position.
Recompute the union of all incident flexible facets from their vertices.
_radremains a conservative user-supplied lower bound on search extent, not thickness. Shared nodes can have facets only in the extra slots.