jaxdem.forces.facet_contact#

Facet contact force model.

Functions

get_facet_indices(idx, state)

Get the sphere indices of the facet clump that contains idx.

point_segment_distance(p, a, b, system)

Compute the distance from point p to the segment a-b.

point_triangle_distance(p, a, b, c, system)

Compute the distance from point p to the triangle with vertices a, b, c.

segment_segment_distance(p1, q1, p2, q2, system)

Compute the shortest distance between the segments p1-q1 and p2-q2.

triangle_triangle_distance(t1_a, t1_b, t1_c, ...)

Compute the shortest distance between two triangles.

jaxdem.forces.facet_contact.point_triangle_distance(p: jax.Array, a: jax.Array, b: jax.Array, c: jax.Array, system: System) tuple[jax.Array, jax.Array, jax.Array][source]#

Compute the distance from point p to the triangle with vertices a, b, c.

Also return the closest point on the triangle and its barycentric 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-q1 and p2-q2.

Also return the closest point on each segment and its interpolation weights.

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) tuple[jax.Array, jax.Array, jax.Array, jax.Array, jax.Array][source]#

Compute the shortest distance between two triangles.

Also return the closest point on each triangle and its barycentric coordinates.

jaxdem.forces.facet_contact.point_segment_distance(p: jax.Array, a: jax.Array, b: jax.Array, system: System) tuple[jax.Array, jax.Array, jax.Array][source]#

Compute the distance from point p to the segment a-b.

Also return the closest point on the segment and its interpolation weights.

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).