Potentials

Normal Potentials

class ipctk.NormalPotential

Bases: pybind11_object

Public Methods:

__init__(*args, **kwargs)

__call__(*args, **kwargs)

Overloaded function.

gradient(*args, **kwargs)

Overloaded function.

hessian(*args, **kwargs)

Overloaded function.

shape_derivative(*args, **kwargs)

Overloaded function.

force_magnitude(self, distance_squared, ...)

Compute the force magnitude for a collision.

force_magnitude_gradient(self, ...)

Compute the gradient of the force magnitude for a collision.

Inherited from pybind11_object

__annotations__ = {}
__call__(*args, **kwargs)

Overloaded function.

  1. __call__(self: ipctk.NormalPotential, collisions: ipctk.NormalCollisions, mesh: ipc::CollisionMesh, X: numpy.ndarray[numpy.float64[m, n]]) -> float

    Compute the potential for a set of collisions.

    Parameters:

    collisions: The set of collisions. mesh: The collision mesh. X: Degrees of freedom of the collision mesh (e.g., vertices or velocities).

    Returns:

    The potential for a set of collisions.

  2. __call__(self: ipctk.NormalPotential, collision: ipctk.NormalCollision, x: numpy.ndarray[numpy.float64[m, 1]]) -> float

    Compute the potential for a single collision.

    Parameters:

    collision: The collision. x: The collision stencil’s degrees of freedom.

    Returns:

    The potential.

__init__(*args, **kwargs)
__module__ = 'ipctk'
force_magnitude(self, distance_squared: float, dmin: float, barrier_stiffness: float) float

Compute the force magnitude for a collision.

Parameters:
distance_squared: float

The squared distance between elements.

dmin: float

The minimum distance offset to the barrier.

barrier_stiffness: float

The barrier stiffness.

Returns:

The force magnitude.

force_magnitude_gradient(self, distance_squared: float, distance_squared_gradient: numpy.ndarray[numpy.float64[m, 1]], dmin: float, barrier_stiffness: float) numpy.ndarray[numpy.float64[m, 1]]

Compute the gradient of the force magnitude for a collision.

Parameters:
distance_squared: float

The squared distance between elements.

distance_squared_gradient: numpy.ndarray[numpy.float64[m, 1]]

The gradient of the squared distance.

dmin: float

The minimum distance offset to the barrier.

barrier_stiffness: float

The stiffness of the barrier.

Returns:

The gradient of the force.

gradient(*args, **kwargs)

Overloaded function.

  1. gradient(self: ipctk.NormalPotential, collisions: ipctk.NormalCollisions, mesh: ipc::CollisionMesh, X: numpy.ndarray[numpy.float64[m, n]]) -> numpy.ndarray[numpy.float64[m, 1]]

    Compute the gradient of the potential.

    Parameters:

    collisions: The set of collisions. mesh: The collision mesh. X: Degrees of freedom of the collision mesh (e.g., vertices or velocities).

    Returns:

    The gradient of the potential w.r.t. X. This will have a size of |X|.

  2. gradient(self: ipctk.NormalPotential, collision: ipctk.NormalCollision, x: numpy.ndarray[numpy.float64[m, 1]]) -> numpy.ndarray[numpy.float64[m, 1]]

    Compute the gradient of the potential for a single collision.

    Parameters:

    collision: The collision. x: The collision stencil’s degrees of freedom.

    Returns:

    The gradient of the potential.

hessian(*args, **kwargs)

Overloaded function.

  1. hessian(self: ipctk.NormalPotential, collisions: ipctk.NormalCollisions, mesh: ipc::CollisionMesh, X: numpy.ndarray[numpy.float64[m, n]], project_hessian_to_psd: ipctk.PSDProjectionMethod = <PSDProjectionMethod.NONE: 0>) -> scipy.sparse.csc_matrix[numpy.float64]

    Compute the hessian of the potential.

    Parameters:

    collisions: The set of collisions. mesh: The collision mesh. X: Degrees of freedom of the collision mesh (e.g., vertices or velocities). project_hessian_to_psd: Make sure the hessian is positive semi-definite.

    Returns:

    The Hessian of the potential w.r.t. X. This will have a size of |X|×|X|.

  2. hessian(self: ipctk.NormalPotential, collision: ipctk.NormalCollision, x: numpy.ndarray[numpy.float64[m, 1]], project_hessian_to_psd: ipctk.PSDProjectionMethod = <PSDProjectionMethod.NONE: 0>) -> numpy.ndarray[numpy.float64[m, n]]

    Compute the hessian of the potential for a single collision.

    Parameters:

    collision: The collision. x: The collision stencil’s degrees of freedom.

    Returns:

    The hessian of the potential.

shape_derivative(*args, **kwargs)

Overloaded function.

  1. shape_derivative(self: ipctk.NormalPotential, collisions: ipctk.NormalCollisions, mesh: ipc::CollisionMesh, vertices: numpy.ndarray[numpy.float64[m, n]]) -> scipy.sparse.csc_matrix[numpy.float64]

    Compute the shape derivative of the potential.

    std::runtime_error If the collision collisions were not built with shape derivatives enabled.

    Parameters:

    collisions: The set of collisions. mesh: The collision mesh. vertices: Vertices of the collision mesh.

    Returns:

    The derivative of the force with respect to X, the rest vertices.

  2. shape_derivative(self: ipctk.NormalPotential, collision: ipctk.NormalCollision, vertex_ids: Annotated[list[int], FixedSize(4)], rest_positions: numpy.ndarray[numpy.float64[m, 1]], positions: numpy.ndarray[numpy.float64[m, 1]]) -> list[Eigen::Triplet<double, int>]

    Compute the shape derivative of the potential for a single collision.

    Parameters:

    collision: The collision. vertex_ids: The collision stencil’s vertex ids. rest_positions: The collision stencil’s rest positions. positions: The collision stencil’s positions. ,out]: out Store the triplets of the shape derivative here.

Barrier Potential

class ipctk.BarrierPotential

Bases: NormalPotential

Public Data Attributes:

dhat

Barrier activation distance.

barrier

Barrier function used to compute the potential.

Public Methods:

__init__(*args, **kwargs)

Overloaded function.

Inherited from NormalPotential

__init__(*args, **kwargs)

__call__(*args, **kwargs)

Overloaded function.

gradient(*args, **kwargs)

Overloaded function.

hessian(*args, **kwargs)

Overloaded function.

shape_derivative(*args, **kwargs)

Overloaded function.

force_magnitude(self, distance_squared, ...)

Compute the force magnitude for a collision.

force_magnitude_gradient(self, ...)

Compute the gradient of the force magnitude for a collision.

Inherited from pybind11_object

__annotations__ = {}
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: ipctk.BarrierPotential, dhat: float, use_physical_barrier: bool = False) -> None

    Construct a barrier potential.

    Parameters:

    dhat: The activation distance of the barrier.

  2. __init__(self: ipctk.BarrierPotential, barrier: ipctk.Barrier, dhat: float, use_physical_barrier: bool = False) -> None

    Construct a barrier potential.

    Parameters:

    barrier: The barrier function. dhat: The activation distance of the barrier.

__module__ = 'ipctk'
property barrier : ipctk.Barrier

Barrier function used to compute the potential.

property dhat : float

Barrier activation distance.

Normal Adhesion Potential

class ipctk.NormalAdhesionPotential

Bases: NormalPotential

Public Data Attributes:

dhat_p

The distance of largest adhesion force (\(\hat{d}_{p}\)) (\(0 < \hat{d}_{p} < \hat{d}_{a}\)).

dhat_a

The adhesion activation distance (\(\hat{d}_{a}\).

Y

The Young's modulus (\(Y\))).

eps_c

The critical strain (\(\varepsilon_{c}\))).

Public Methods:

__init__(self, dhat_p, dhat_a, Y, eps_c)

Inherited from NormalPotential

__init__(*args, **kwargs)

__call__(*args, **kwargs)

Overloaded function.

gradient(*args, **kwargs)

Overloaded function.

hessian(*args, **kwargs)

Overloaded function.

shape_derivative(*args, **kwargs)

Overloaded function.

force_magnitude(self, distance_squared, ...)

Compute the force magnitude for a collision.

force_magnitude_gradient(self, ...)

Compute the gradient of the force magnitude for a collision.

Inherited from pybind11_object

property Y : float

The Young’s modulus (\(Y\))).

__annotations__ = {}
__init__(self, dhat_p: float, dhat_a: float, Y: float, eps_c: float)
__module__ = 'ipctk'
property dhat_a : float

The adhesion activation distance (\(\hat{d}_{a}\).

property dhat_p : float

The distance of largest adhesion force (\(\hat{d}_{p}\)) (\(0 < \hat{d}_{p} < \hat{d}_{a}\)).

property eps_c : float

The critical strain (\(\varepsilon_{c}\))).

Tangential Potentials

class ipctk.TangentialPotential

Bases: pybind11_object

Public Methods:

__init__(*args, **kwargs)

__call__(*args, **kwargs)

Overloaded function.

gradient(*args, **kwargs)

Overloaded function.

hessian(*args, **kwargs)

Overloaded function.

force(*args, **kwargs)

Overloaded function.

force_jacobian(*args, **kwargs)

Overloaded function.

Inherited from pybind11_object

class DiffWRT

Bases: pybind11_object

Members:

REST_POSITIONS : Differentiate w.r.t. rest positions

LAGGED_DISPLACEMENTS : Differentiate w.r.t. lagged displacements

VELOCITIES : Differentiate w.r.t. current velocities

LAGGED_DISPLACEMENTS = <DiffWRT.LAGGED_DISPLACEMENTS: 1>
REST_POSITIONS = <DiffWRT.REST_POSITIONS: 0>
VELOCITIES = <DiffWRT.VELOCITIES: 2>
__annotations__ = {}
__eq__(self, other: object) bool
__getstate__(self) int
__hash__(self) int
__index__(self) int
__init__(self, value: int)
__int__(self) int
__members__ = {'LAGGED_DISPLACEMENTS': <DiffWRT.LAGGED_DISPLACEMENTS: 1>, 'REST_POSITIONS': <DiffWRT.REST_POSITIONS: 0>, 'VELOCITIES': <DiffWRT.VELOCITIES: 2>}
__module__ = 'ipctk'
__ne__(self, other: object) bool
__repr__(self) str
__setstate__(self, state: int) None
__str__(self) str
property name : str
property value : int
LAGGED_DISPLACEMENTS = <DiffWRT.LAGGED_DISPLACEMENTS: 1>
REST_POSITIONS = <DiffWRT.REST_POSITIONS: 0>
VELOCITIES = <DiffWRT.VELOCITIES: 2>
__annotations__ = {}
__call__(*args, **kwargs)

Overloaded function.

  1. __call__(self: ipctk.TangentialPotential, collisions: ipctk.TangentialCollisions, mesh: ipc::CollisionMesh, X: numpy.ndarray[numpy.float64[m, n]]) -> float

    Compute the potential for a set of collisions.

    Parameters:

    collisions: The set of collisions. mesh: The collision mesh. X: Degrees of freedom of the collision mesh (e.g., vertices or velocities).

    Returns:

    The potential for a set of collisions.

  2. __call__(self: ipctk.TangentialPotential, collision: ipctk.TangentialCollision, x: numpy.ndarray[numpy.float64[m, 1]]) -> float

    Compute the potential for a single collision.

    Parameters:

    collision: The collision. x: The collision stencil’s degrees of freedom.

    Returns:

    The potential.

__init__(*args, **kwargs)
__module__ = 'ipctk'
force(*args, **kwargs)

Overloaded function.

  1. force(self: ipctk.TangentialPotential, collisions: ipctk.TangentialCollisions, mesh: ipc::CollisionMesh, rest_positions: numpy.ndarray[numpy.float64[m, n]], lagged_displacements: numpy.ndarray[numpy.float64[m, n]], velocities: numpy.ndarray[numpy.float64[m, n]], normal_potential: ipctk.NormalPotential, normal_stiffness: float, dmin: float = 0, no_mu: bool = False) -> numpy.ndarray[numpy.float64[m, 1]]

    Compute the friction force from the given velocities.

    Parameters:

    collisions: The set of collisions. mesh: The collision mesh. rest_positions: Rest positions of the vertices (rowwise). lagged_displacements: Previous displacements of the vertices (rowwise). velocities: Current displacements of the vertices (rowwise). normal_potential: Normal potential (used for normal force magnitude). normal_stiffness: Normal stiffness (used for normal force magnitude). dmin: Minimum distance (used for normal force magnitude). no_mu: whether to not multiply by mu

    Returns:

    The friction force.

  2. force(self: ipctk.TangentialPotential, collision: ipctk.TangentialCollision, rest_positions: numpy.ndarray[numpy.float64[m, 1]], lagged_displacements: numpy.ndarray[numpy.float64[m, 1]], velocities: numpy.ndarray[numpy.float64[m, 1]], normal_potential: ipctk.NormalPotential, normal_stiffness: float, dmin: float = 0, no_mu: bool = False) -> numpy.ndarray[numpy.float64[m, 1]]

    Compute the friction force.

    Parameters:

    collision: The collision rest_positions: Rest positions of the vertices (rowwise). lagged_displacements: Previous displacements of the vertices (rowwise). velocities: Current displacements of the vertices (rowwise). normal_potential: Normal potential (used for normal force magnitude). normal_stiffness: Normal stiffness (used for normal force magnitude). dmin: Minimum distance (used for normal force magnitude). no_mu: Whether to not multiply by mu

    Returns:

    Friction force

force_jacobian(*args, **kwargs)

Overloaded function.

  1. force_jacobian(self: ipctk.TangentialPotential, collisions: ipctk.TangentialCollisions, mesh: ipc::CollisionMesh, rest_positions: numpy.ndarray[numpy.float64[m, n]], lagged_displacements: numpy.ndarray[numpy.float64[m, n]], velocities: numpy.ndarray[numpy.float64[m, n]], normal_potential: ipctk.NormalPotential, normal_stiffness: float, wrt: ipctk.TangentialPotential.DiffWRT, dmin: float = 0) -> scipy.sparse.csc_matrix[numpy.float64]

    Compute the Jacobian of the friction force wrt the velocities.

    Parameters:

    collisions: The set of collisions. mesh: The collision mesh. rest_positions: Rest positions of the vertices (rowwise). lagged_displacements: Previous displacements of the vertices (rowwise). velocities: Current displacements of the vertices (rowwise). normal_potential: Normal potential (used for normal force magnitude). normal_stiffness: Normal stiffness (used for normal force magnitude). wrt: The variable to take the derivative with respect to. dmin: Minimum distance (used for normal force magnitude).

    Returns:

    The Jacobian of the friction force wrt the velocities.

  2. force_jacobian(self: ipctk.TangentialPotential, collision: ipctk.TangentialCollision, rest_positions: numpy.ndarray[numpy.float64[m, 1]], lagged_displacements: numpy.ndarray[numpy.float64[m, 1]], velocities: numpy.ndarray[numpy.float64[m, 1]], normal_potential: ipctk.NormalPotential, normal_stiffness: float, wrt: ipctk.TangentialPotential.DiffWRT, dmin: float = 0) -> numpy.ndarray[numpy.float64[m, n]]

    Compute the friction force Jacobian.

    Parameters:

    collision: The collision rest_positions: Rest positions of the vertices (rowwise). lagged_displacements: Previous displacements of the vertices (rowwise). velocities: Current displacements of the vertices (rowwise). normal_potential: Normal potential (used for normal force magnitude). normal_stiffness: Normal stiffness (used for normal force magnitude). wrt: Variable to differentiate the friction force with respect to. dmin: Minimum distance (used for normal force magnitude).

    Returns:

    Friction force Jacobian

gradient(*args, **kwargs)

Overloaded function.

  1. gradient(self: ipctk.TangentialPotential, collisions: ipctk.TangentialCollisions, mesh: ipc::CollisionMesh, X: numpy.ndarray[numpy.float64[m, n]]) -> numpy.ndarray[numpy.float64[m, 1]]

    Compute the gradient of the potential.

    Parameters:

    collisions: The set of collisions. mesh: The collision mesh. X: Degrees of freedom of the collision mesh (e.g., vertices or velocities).

    Returns:

    The gradient of the potential w.r.t. X. This will have a size of |X|.

  2. gradient(self: ipctk.TangentialPotential, collision: ipctk.TangentialCollision, x: numpy.ndarray[numpy.float64[m, 1]]) -> numpy.ndarray[numpy.float64[m, 1]]

    Compute the gradient of the potential for a single collision.

    Parameters:

    collision: The collision. x: The collision stencil’s degrees of freedom.

    Returns:

    The gradient of the potential.

hessian(*args, **kwargs)

Overloaded function.

  1. hessian(self: ipctk.TangentialPotential, collisions: ipctk.TangentialCollisions, mesh: ipc::CollisionMesh, X: numpy.ndarray[numpy.float64[m, n]], project_hessian_to_psd: ipctk.PSDProjectionMethod = <PSDProjectionMethod.NONE: 0>) -> scipy.sparse.csc_matrix[numpy.float64]

    Compute the hessian of the potential.

    Parameters:

    collisions: The set of collisions. mesh: The collision mesh. X: Degrees of freedom of the collision mesh (e.g., vertices or velocities). project_hessian_to_psd: Make sure the hessian is positive semi-definite.

    Returns:

    The Hessian of the potential w.r.t. X. This will have a size of |X|×|X|.

  2. hessian(self: ipctk.TangentialPotential, collision: ipctk.TangentialCollision, x: numpy.ndarray[numpy.float64[m, 1]], project_hessian_to_psd: ipctk.PSDProjectionMethod = <PSDProjectionMethod.NONE: 0>) -> numpy.ndarray[numpy.float64[m, n]]

    Compute the hessian of the potential for a single collision.

    Parameters:

    collision: The collision. x: The collision stencil’s degrees of freedom.

    Returns:

    The hessian of the potential.

Friction Potential

class ipctk.FrictionPotential

Bases: TangentialPotential

Public Data Attributes:

eps_v

The smooth friction mollifier parameter \(\epsilon_{v}\).

Inherited from TangentialPotential

REST_POSITIONS

LAGGED_DISPLACEMENTS

VELOCITIES

Public Methods:

__init__(self, eps_v)

Construct a friction potential.

Inherited from TangentialPotential

__init__(*args, **kwargs)

__call__(*args, **kwargs)

Overloaded function.

gradient(*args, **kwargs)

Overloaded function.

hessian(*args, **kwargs)

Overloaded function.

force(*args, **kwargs)

Overloaded function.

force_jacobian(*args, **kwargs)

Overloaded function.

Inherited from pybind11_object

__annotations__ = {}
__init__(self, eps_v: float)

Construct a friction potential.

Parameters:
eps_v: float

The smooth friction mollifier parameter \(\\epsilon_{v}\).

__module__ = 'ipctk'
property eps_v : float

The smooth friction mollifier parameter \(\epsilon_{v}\).

Tangential Adhesion Potential

class ipctk.TangentialAdhesionPotential

Bases: TangentialPotential

Public Data Attributes:

eps_a

Get the tangential adhesion mollifier parameter \(psilon_a\).

Inherited from TangentialPotential

REST_POSITIONS

LAGGED_DISPLACEMENTS

VELOCITIES

Public Methods:

__init__(self, eps_a)

Construct a tangential adhesion potential.

Inherited from TangentialPotential

__init__(*args, **kwargs)

__call__(*args, **kwargs)

Overloaded function.

gradient(*args, **kwargs)

Overloaded function.

hessian(*args, **kwargs)

Overloaded function.

force(*args, **kwargs)

Overloaded function.

force_jacobian(*args, **kwargs)

Overloaded function.

Inherited from pybind11_object

__annotations__ = {}
__init__(self, eps_a: float)

Construct a tangential adhesion potential.

Parameters:
eps_a: float

The tangential adhesion mollifier parameter \(\epsilon_a\).

__module__ = 'ipctk'
property eps_a : float

Get the tangential adhesion mollifier parameter \(psilon_a\).


Last update: Dec 12, 2024