Extremum-Sum Potential¶
ESP Parameters¶
- class ipctk.ESPParameters¶
Bases:
pybind11_objectPublic Data Attributes:
Public Methods:
__init__(self, dhat, dbar_factor, ...)Construct parameter set for ESP contact.
Inherited from
pybind11_objectPrivate Methods:
- class IntegrationType¶
Bases:
pybind11_objectMembers:
BRUTE_FORCE : Integrate all pairs with no obstacle filtering
NORMAL : Filter obstacle-obstacle pairs; skip primitives with only obstacle candidates
NO_OBST : Skip obstacle sources entirely, may miss collisions!
-
BRUTE_FORCE =
<IntegrationType.BRUTE_FORCE: 0>¶
-
NORMAL =
<IntegrationType.NORMAL: 1>¶
-
NO_OBST =
<IntegrationType.NO_OBST: 2>¶
-
__annotations__ =
{}¶
-
__members__ =
{'BRUTE_FORCE': <IntegrationType.BRUTE_FORCE: 0>, 'NORMAL': <IntegrationType.NORMAL: 1>, 'NO_OBST': <IntegrationType.NO_OBST: 2>}¶
-
__module__ =
'ipctk'¶
- _pybind11_conduit_v1_()¶
- property name : str¶
- property value : int¶
-
BRUTE_FORCE =
-
__annotations__ =
{}¶
- __init__(self: ipctk.ESPParameters, dhat: typing.SupportsFloat, dbar_factor: typing.SupportsFloat = 0.2, quad_order: typing.SupportsInt = 1, area_weights: bool = True, integration_type: ipctk.ESPParameters.IntegrationType = <IntegrationType.NORMAL: 1>)¶
Construct parameter set for ESP contact.
- Parameters:¶
- dhat
Activation distance of the barrier.
- dbar_factor
Near/far split parameter dbar / dhat, in [0, 2]. The far part vanishes identically at 2; the edge-edge weights use the support min(dbar, dhat); 0 disables edge-edge contact.
- quad_order
Gauss-Lobatto edge quadrature order (2D).
- area_weights
Whether to weight the quadrature by area.
- integration_type
Which obstacle primitives to integrate.
- Raises:¶
ValueError – If dhat is not positive and finite, dbar_factor is not in [0, 2], or quad_order is negative.
-
__module__ =
'ipctk'¶
- _pybind11_conduit_v1_()¶
- property area_weights : bool¶
- property dbar : float¶
- property dhat : float¶
- property integration_type : ipctk.ESPParameters.IntegrationType¶
- property quad_order : int¶
ESP Collisions¶
- class ipctk.ESPCollisions¶
Bases:
pybind11_objectPublic Methods:
__init__(self)build(self, mesh, vertices, , ], param, ...)Initialize the set of collisions used to compute the potential.
compute_minimum_distance(self, mesh, ...)Computes the minimum squared distance over the collision candidates found by build().
__len__(self)Get the number of collisions.
empty(self)Get if the collision set is empty.
clear(self)Clear the collision set.
to_string(self, mesh, vertices, , ], param)n_candidates(self)Get the number of candidates.
Inherited from
pybind11_objectPrivate Methods:
-
__annotations__ =
{}¶
-
__module__ =
'ipctk'¶
- _pybind11_conduit_v1_()¶
- build(self: ipctk.ESPCollisions, mesh: ipc::CollisionMesh, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]", "flags.f_contiguous"], param: ipc::ESPParameters, broad_phase: ipctk.BroadPhase = None) None¶
Initialize the set of collisions used to compute the potential.
- Parameters:¶
- mesh
The collision mesh.
- vertices
Vertices of the collision mesh.
- param
ESPParameters.
- broad_phase
Broad phase method.
- compute_minimum_distance(self: ipctk.ESPCollisions, mesh: ipc::CollisionMesh, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]", "flags.f_contiguous"]) float¶
Computes the minimum squared distance over the collision candidates found by build().
- to_string(self: ipctk.ESPCollisions, mesh: ipc::CollisionMesh, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]", "flags.f_contiguous"], param: ipc::ESPParameters) str¶
-
__annotations__ =
ESP Potential¶
- class ipctk.ESPPotential¶
Bases:
pybind11_objectPublic Methods:
__init__(self, param[, use_near_far])Construct an Extremum Sum Potential (ESP).
__call__(self, collisions, mesh, vertices, , ])Compute the barrier potential for a set of collisions.
gradient(self, collisions, mesh, vertices, , ])Compute the gradient of the barrier potential.
hessian(self, collisions, mesh, vertices, , ...)Compute the hessian of the barrier potential.
Inherited from
pybind11_objectPrivate Methods:
-
__annotations__ =
{}¶
- __call__(self: ipctk.ESPPotential, collisions: ipctk.ESPCollisions, mesh: ipc::CollisionMesh, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]", "flags.f_contiguous"]) float¶
Compute the barrier potential for a set of collisions.
-
__init__(self, param: ipctk.ESPParameters, use_near_far: bool =
True)¶ Construct an Extremum Sum Potential (ESP).
- Parameters:¶
- param: ipctk.ESPParameters¶
A set of parameters.
- use_near_far: bool =
True¶ Whether to normalize the quadrature weights so they sum to 1, splitting near and far contributions when 0 < dbar_factor <= 2 (the far part vanishes at 2).
-
__module__ =
'ipctk'¶
- _pybind11_conduit_v1_()¶
- gradient(self: ipctk.ESPPotential, collisions: ipctk.ESPCollisions, mesh: ipc::CollisionMesh, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]", "flags.f_contiguous"]) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
Compute the gradient of the barrier potential.
- Parameters:¶
- collisions
The set of collisions.
- mesh
The collision mesh.
- vertices
Vertices of the collision mesh.
- Returns:¶
The gradient of all barrier potentials (not scaled by the barrier stiffness). This will have a size of |vertices|.
- hessian(self: ipctk.ESPPotential, collisions: ipctk.ESPCollisions, mesh: ipc::CollisionMesh, vertices: typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]", "flags.f_contiguous"], project_hessian_to_psd: ipctk.PSDProjectionMethod = <PSDProjectionMethod.NONE: 0>) scipy.sparse.csc_matrix[numpy.float64]¶
Compute the hessian of the barrier potential.
- Parameters:¶
- collisions
The set of collisions.
- mesh
The collision mesh.
- vertices
Vertices of the collision mesh.
- project_hessian_to_psd
Make sure the hessian is positive semi-definite. With normalized weights and edge-edge terms, each face’s block is projected as a whole.
- Returns:¶
The hessian of all barrier potentials (not scaled by the barrier stiffness). This will have a size of |vertices|x|vertices|.
-
__annotations__ =