Tangent

Tangent Basis

template <typename DerivedP0, typename DerivedP1>
inline IPC_TOOLKIT_HOST_DEVICE auto ipc::point_point_tangent_basis(
    
const Eigen::MatrixBase<DerivedP0>& p0,
    
const Eigen::MatrixBase<DerivedP1>& p1);

Compute a basis for the space tangent to the point-point pair.

Parameters:
const Eigen::MatrixBase<DerivedP0> &p0

First point

const Eigen::MatrixBase<DerivedP1> &p1

Second point

Returns:

A 3x2 matrix whose columns are the basis vectors.

template <typename DerivedP, typename DerivedE0, typename DerivedE1>
inline IPC_TOOLKIT_HOST_DEVICE auto ipc::point_edge_tangent_basis(
    
const Eigen::MatrixBase<DerivedP>& p,
    
const Eigen::MatrixBase<DerivedE0>& e0,
    
const Eigen::MatrixBase<DerivedE1>& e1);

Compute a basis for the space tangent to the point-edge pair.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

Point

const Eigen::MatrixBase<DerivedE0> &e0

First edge point

const Eigen::MatrixBase<DerivedE1> &e1

Second edge point

Returns:

A 3x2 matrix whose columns are the basis vectors.

template <typename DerivedEA0, typename DerivedEA1,
    typename DerivedEB0, typename DerivedEB1>
inline IPC_TOOLKIT_HOST_DEVICE auto ipc::edge_edge_tangent_basis(
    
const Eigen::MatrixBase<DerivedEA0>& ea0,
    
const Eigen::MatrixBase<DerivedEA1>& ea1,
    
const Eigen::MatrixBase<DerivedEB0>& eb0,
    
const Eigen::MatrixBase<DerivedEB1>& eb1);

Compute a basis for the space tangent to the edge-edge pair.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

First point of the first edge

const Eigen::MatrixBase<DerivedEA1> &ea1

Second point of the first edge

const Eigen::MatrixBase<DerivedEB0> &eb0

First point of the second edge

const Eigen::MatrixBase<DerivedEB1> &eb1

Second point of the second edge

Returns:

A 3x2 matrix whose columns are the basis vectors.

template <typename DerivedP, typename DerivedT0, typename DerivedT1,
    typename DerivedT2>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::point_triangle_tangent_basis(
    
const Eigen::MatrixBase<DerivedP>& p,
    
const Eigen::MatrixBase<DerivedT0>& t0,
    
const Eigen::MatrixBase<DerivedT1>& t1,
    
const Eigen::MatrixBase<DerivedT2>& t2);

Compute a basis for the space tangent to the point-triangle pair.

\[ \begin{bmatrix} \frac{t_1 - t_0}{\|t_1 - t_0\|} & \frac{((t_1 - t_0)\times(t_2 - t_0)) \times(t_1 - t_0)}{\|((t_1 - t_0)\times(t_2 - t_0))\times(t_1 - t_0)\|} \end{bmatrix} \]

Parameters:
const Eigen::MatrixBase<DerivedP> &p

Point

const Eigen::MatrixBase<DerivedT0> &t0

Triangle’s first vertex

const Eigen::MatrixBase<DerivedT1> &t1

Triangle’s second vertex

const Eigen::MatrixBase<DerivedT2> &t2

Triangle’s third vertex

Returns:

A 3x2 matrix whose columns are the basis vectors.

Tangent Basis Jacobians

template <typename DerivedP0, typename DerivedP1>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::point_point_tangent_basis_jacobian(
    
const Eigen::MatrixBase<DerivedP0>& p0,
    
const Eigen::MatrixBase<DerivedP1>& p1);

Compute the Jacobian of the tangent basis for the point-point pair.

Parameters:
const Eigen::MatrixBase<DerivedP0> &p0

First point

const Eigen::MatrixBase<DerivedP1> &p1

Second point

Returns:

A (3*2)x6 matrix whose columns are the basis vectors.

template <typename DerivedP, typename DerivedE0, typename DerivedE1>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::point_edge_tangent_basis_jacobian(
    
const Eigen::MatrixBase<DerivedP>& p,
    
const Eigen::MatrixBase<DerivedE0>& e0,
    
const Eigen::MatrixBase<DerivedE1>& e1);

Compute the Jacobian of the tangent basis for the point-edge pair.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

Point

const Eigen::MatrixBase<DerivedE0> &e0

First edge point

const Eigen::MatrixBase<DerivedE1> &e1

Second edge point

Returns:

A (3*2)x9 matrix whose columns are the basis vectors.

template <typename DerivedEA0, typename DerivedEA1,
    typename DerivedEB0, typename DerivedEB1>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::edge_edge_tangent_basis_jacobian(
    
const Eigen::MatrixBase<DerivedEA0>& ea0,
    
const Eigen::MatrixBase<DerivedEA1>& ea1,
    
const Eigen::MatrixBase<DerivedEB0>& eb0,
    
const Eigen::MatrixBase<DerivedEB1>& eb1);

Compute the Jacobian of the tangent basis for the edge-edge pair.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

First point of the first edge

const Eigen::MatrixBase<DerivedEA1> &ea1

Second point of the first edge

const Eigen::MatrixBase<DerivedEB0> &eb0

First point of the second edge

const Eigen::MatrixBase<DerivedEB1> &eb1

Second point of the second edge

Returns:

A (3*2)x12 matrix whose columns are the basis vectors.

template <typename DerivedP, typename DerivedT0, typename DerivedT1,
    typename DerivedT2>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::point_triangle_tangent_basis_jacobian(
    
const Eigen::MatrixBase<DerivedP>& p,
    
const Eigen::MatrixBase<DerivedT0>& t0,
    
const Eigen::MatrixBase<DerivedT1>& t1,
    
const Eigen::MatrixBase<DerivedT2>& t2);

Compute the Jacobian of the tangent basis for the point-triangle pair.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

Point

const Eigen::MatrixBase<DerivedT0> &t0

Triangle’s first vertex

const Eigen::MatrixBase<DerivedT1> &t1

Triangle’s second vertex

const Eigen::MatrixBase<DerivedT2> &t2

Triangle’s third vertex

Returns:

A (3*2)x12 matrix whose columns are the basis vectors.

Relative Velocity

template <typename DerivedDP0, typename DerivedDP1>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::point_point_relative_velocity(
    
const Eigen::MatrixBase<DerivedDP0>& dp0,
    
const Eigen::MatrixBase<DerivedDP1>& dp1);

Compute the relative velocity of two points.

Parameters:
const Eigen::MatrixBase<DerivedDP0> &dp0

Velocity of the first point

const Eigen::MatrixBase<DerivedDP1> &dp1

Velocity of the second point

Returns:

The relative velocity of the two points

template <typename DerivedDP, typename DerivedDE0,
    typename DerivedDE1>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::point_edge_relative_velocity(
    
const Eigen::MatrixBase<DerivedDP>& dp,
    
const Eigen::MatrixBase<DerivedDE0>& de0,
    
const Eigen::MatrixBase<DerivedDE1>& de1,
    
const typename DerivedDP::Scalar alpha);

Compute the relative velocity of a point and an edge.

Parameters:
const Eigen::MatrixBase<DerivedDP> &dp

Velocity of the point

const Eigen::MatrixBase<DerivedDE0> &de0

Velocity of the first endpoint of the edge

const Eigen::MatrixBase<DerivedDE1> &de1

Velocity of the second endpoint of the edge

const typename DerivedDP::Scalar alpha

Parametric coordinate of the closest point on the edge

Returns:

The relative velocity of the point and the edge

template <typename DerivedDEA0, typename DerivedDEA1,
    typename DerivedDEB0, typename DerivedDEB1,
    typename DerivedCoords>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::edge_edge_relative_velocity(
    
const Eigen::MatrixBase<DerivedDEA0>& dea0,
    
const Eigen::MatrixBase<DerivedDEA1>& dea1,
    
const Eigen::MatrixBase<DerivedDEB0>& deb0,
    
const Eigen::MatrixBase<DerivedDEB1>& deb1,
    
const Eigen::MatrixBase<DerivedCoords>& coords);

Compute the relative velocity of the edges.

Parameters:
const Eigen::MatrixBase<DerivedDEA0> &dea0

Velocity of the first endpoint of the first edge

const Eigen::MatrixBase<DerivedDEA1> &dea1

Velocity of the second endpoint of the first edge

const Eigen::MatrixBase<DerivedDEB0> &deb0

Velocity of the first endpoint of the second edge

const Eigen::MatrixBase<DerivedDEB1> &deb1

Velocity of the second endpoint of the second edge

const Eigen::MatrixBase<DerivedCoords> &coords

Two parametric coordinates of the closest points on the edges

Returns:

The relative velocity of the edges

template <typename DerivedDP, typename DerivedDT0,
    typename DerivedDT1, typename DerivedDT2,
    typename DerivedCoords>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::point_triangle_relative_velocity(
    
const Eigen::MatrixBase<DerivedDP>& dp,
    
const Eigen::MatrixBase<DerivedDT0>& dt0,
    
const Eigen::MatrixBase<DerivedDT1>& dt1,
    
const Eigen::MatrixBase<DerivedDT2>& dt2,
    
const Eigen::MatrixBase<DerivedCoords>& coords);

Compute the relative velocity of the point to the triangle.

Parameters:
const Eigen::MatrixBase<DerivedDP> &dp

Velocity of the point

const Eigen::MatrixBase<DerivedDT0> &dt0

Velocity of the first vertex of the triangle

const Eigen::MatrixBase<DerivedDT1> &dt1

Velocity of the second vertex of the triangle

const Eigen::MatrixBase<DerivedDT2> &dt2

Velocity of the third vertex of the triangle

const Eigen::MatrixBase<DerivedCoords> &coords

Baricentric coordinates of the closest point on the triangle

Returns:

The relative velocity of the point to the triangle

Relative Velocity as Multiplier Matricies

Warning

doxygenfunction: Unable to resolve function “ipc::point_point_relative_velocity_jacobian” with arguments “None”. Candidate function could not be parsed. Parsing error is Error when parsing function declaration. If the function has no return type: Error in declarator or parameters-and-qualifiers Invalid C++ declaration: Expecting “(” in parameters-and-qualifiers. [error at 54] template<typename T = double> IPC_TOOLKIT_HOST_DEVICE MatrixMax< T, 3, 6 > point_point_relative_velocity_jacobian (const int dim) ——————————————————^ If the function has a return type: Error in declarator or parameters-and-qualifiers If pointer to member declarator: Invalid C++ declaration: Expected ‘::’ in pointer to member (function). [error at 75] template<typename T = double> IPC_TOOLKIT_HOST_DEVICE MatrixMax< T, 3, 6 > point_point_relative_velocity_jacobian (const int dim) —————————————————————————^ If declarator-id: Invalid C++ declaration: Expecting “(” in parameters-and-qualifiers. [error at 75] template<typename T = double> IPC_TOOLKIT_HOST_DEVICE MatrixMax< T, 3, 6 > point_point_relative_velocity_jacobian (const int dim) —————————————————————————^

Warning

doxygenfunction: Unable to resolve function “ipc::point_edge_relative_velocity_jacobian” with arguments “None”. Candidate function could not be parsed. Parsing error is Error when parsing function declaration. If the function has no return type: Error in declarator or parameters-and-qualifiers Invalid C++ declaration: Expecting “(” in parameters-and-qualifiers. [error at 54] template<typename T = double> IPC_TOOLKIT_HOST_DEVICE MatrixMax< T, 3, 9 > point_edge_relative_velocity_jacobian (const int dim, const T alpha) ——————————————————^ If the function has a return type: Error in declarator or parameters-and-qualifiers If pointer to member declarator: Invalid C++ declaration: Expected ‘::’ in pointer to member (function). [error at 75] template<typename T = double> IPC_TOOLKIT_HOST_DEVICE MatrixMax< T, 3, 9 > point_edge_relative_velocity_jacobian (const int dim, const T alpha) —————————————————————————^ If declarator-id: Invalid C++ declaration: Expecting “(” in parameters-and-qualifiers. [error at 75] template<typename T = double> IPC_TOOLKIT_HOST_DEVICE MatrixMax< T, 3, 9 > point_edge_relative_velocity_jacobian (const int dim, const T alpha) —————————————————————————^

template <typename DerivedCoords>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::edge_edge_relative_velocity_jacobian(
    
const Eigen::MatrixBase<DerivedCoords>& coords);

Compute du/dx where u is the relative velocity of two edges.

Parameters:
const Eigen::MatrixBase<DerivedCoords> &coords

Two parametric coordinates of the closest points on the edges

Returns:

The relative velocity Jacobian du/dx

template <typename DerivedCoords>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::point_triangle_relative_velocity_jacobian(
    
const Eigen::MatrixBase<DerivedCoords>& coords);

Compute du/dx where u is the relative velocity of a point and a triangle.

Parameters:
const Eigen::MatrixBase<DerivedCoords> &coords

Barycentric coordinates of the closest point on the triangle

Returns:

The relative velocity Jacobian du/dx

Relative Velocity Matrix Jacobians

Warning

doxygenfunction: Unable to resolve function “ipc::point_point_relative_velocity_dx_dbeta” with arguments “None”. Candidate function could not be parsed. Parsing error is Error when parsing function declaration. If the function has no return type: Error in declarator or parameters-and-qualifiers Invalid C++ declaration: Expecting “(” in parameters-and-qualifiers. [error at 54] template<typename T = double> IPC_TOOLKIT_HOST_DEVICE VectorMax< T, 18 > point_point_relative_velocity_dx_dbeta (const int dim) ——————————————————^ If the function has a return type: Error in declarator or parameters-and-qualifiers If pointer to member declarator: Invalid C++ declaration: Expected ‘::’ in pointer to member (function). [error at 73] template<typename T = double> IPC_TOOLKIT_HOST_DEVICE VectorMax< T, 18 > point_point_relative_velocity_dx_dbeta (const int dim) ————————————————————————-^ If declarator-id: Invalid C++ declaration: Expecting “(” in parameters-and-qualifiers. [error at 73] template<typename T = double> IPC_TOOLKIT_HOST_DEVICE VectorMax< T, 18 > point_point_relative_velocity_dx_dbeta (const int dim) ————————————————————————-^

Warning

doxygenfunction: Unable to resolve function “ipc::point_edge_relative_velocity_dx_dbeta” with arguments “None”. Candidate function could not be parsed. Parsing error is Error when parsing function declaration. If the function has no return type: Error in declarator or parameters-and-qualifiers Invalid C++ declaration: Expecting “(” in parameters-and-qualifiers. [error at 54] template<typename T = double> IPC_TOOLKIT_HOST_DEVICE VectorMax< T, 27 > point_edge_relative_velocity_dx_dbeta (const int dim, const T alpha) ——————————————————^ If the function has a return type: Error in declarator or parameters-and-qualifiers If pointer to member declarator: Invalid C++ declaration: Expected ‘::’ in pointer to member (function). [error at 73] template<typename T = double> IPC_TOOLKIT_HOST_DEVICE VectorMax< T, 27 > point_edge_relative_velocity_dx_dbeta (const int dim, const T alpha) ————————————————————————-^ If declarator-id: Invalid C++ declaration: Expecting “(” in parameters-and-qualifiers. [error at 73] template<typename T = double> IPC_TOOLKIT_HOST_DEVICE VectorMax< T, 27 > point_edge_relative_velocity_dx_dbeta (const int dim, const T alpha) ————————————————————————-^

template <typename DerivedCoords>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::edge_edge_relative_velocity_dx_dbeta(
    
const Eigen::MatrixBase<DerivedCoords>& coords);

Compute d²u/dxdβ where u is the relative velocity of two edges.

Γ(β₁,β₂) = [(1-β₁)I, β₁I, (β₂-1)I, -β₂I] (3 × 12) ∂Γ/∂β₁ = [-I, I, 0, 0] ∂Γ/∂β₂ = [ 0, 0, I,-I]

Stored as [vec(∂Γ/∂β₁) | vec(∂Γ/∂β₂)] in column-major order (3rd-order convention). Result shape: (36, 2). For a (3 × 12) matrix M, element M(r,c) maps to vec index c·3 + r.

Parameters:
const Eigen::MatrixBase<DerivedCoords> &coords

Two parametric coordinates of the closest points on the edges

Returns:

The vectorized tensor of d²u/dxdβ

template <typename DerivedCoords>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::point_triangle_relative_velocity_dx_dbeta(
    
const Eigen::MatrixBase<DerivedCoords>& coords);

Compute d²u/dxdβ where u is the relative velocity of a point and a triangle.

Γ(β₁,β₂) = [I, (β₁+β₂-1)I, -β₁I, -β₂I] (3 × 12) ∂Γ/∂β₁ = [0, I, -I, 0] ∂Γ/∂β₂ = [0, I, 0,-I]

Stored as [vec(∂Γ/∂β₁) | vec(∂Γ/∂β₂)] in column-major order (3rd-order convention). Result shape: (36, 2). For a (3 × 12) matrix M, element M(r,c) maps to vec index c·3 + r.

Parameters:
const Eigen::MatrixBase<DerivedCoords> &coords

Baricentric coordinates of the closest point on the triangle

Returns:

The vectorized tensor of d²u/dxdβ

Closet Points

template <typename DerivedP, typename DerivedE0, typename DerivedE1>
inline IPC_TOOLKIT_HOST_DEVICE auto ipc::point_edge_closest_point(
    
const Eigen::MatrixBase<DerivedP>& p,
    
const Eigen::MatrixBase<DerivedE0>& e0,
    
const Eigen::MatrixBase<DerivedE1>& e1);

Compute the baricentric coordinate of the closest point on the edge.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

Point

const Eigen::MatrixBase<DerivedE0> &e0

First edge point

const Eigen::MatrixBase<DerivedE1> &e1

Second edge point

Returns:

barycentric coordinates of the closest point

template <typename DerivedEA0, typename DerivedEA1,
    typename DerivedEB0, typename DerivedEB1>
inline IPC_TOOLKIT_HOST_DEVICE auto ipc::edge_edge_closest_point(
    
const Eigen::MatrixBase<DerivedEA0>& ea0,
    
const Eigen::MatrixBase<DerivedEA1>& ea1,
    
const Eigen::MatrixBase<DerivedEB0>& eb0,
    
const Eigen::MatrixBase<DerivedEB1>& eb1);

Compute the barycentric coordinates of the closest points between two edges.

Accepts any 3D Eigen expression; the scalar type is deduced.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

First point of the first edge

const Eigen::MatrixBase<DerivedEA1> &ea1

Second point of the first edge

const Eigen::MatrixBase<DerivedEB0> &eb0

First point of the second edge

const Eigen::MatrixBase<DerivedEB1> &eb1

Second point of the second edge

Returns:

Barycentric coordinates of the closest points

template <typename DerivedP, typename DerivedT0, typename DerivedT1,
    typename DerivedT2>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::point_triangle_closest_point(
    
const Eigen::MatrixBase<DerivedP>& p,
    
const Eigen::MatrixBase<DerivedT0>& t0,
    
const Eigen::MatrixBase<DerivedT1>& t1,
    
const Eigen::MatrixBase<DerivedT2>& t2);

Compute the barycentric coordinates of the closest point on the triangle.

Accepts any 3D Eigen expression; the scalar type is deduced.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

Point

const Eigen::MatrixBase<DerivedT0> &t0

Triangle’s first vertex

const Eigen::MatrixBase<DerivedT1> &t1

Triangle’s second vertex

const Eigen::MatrixBase<DerivedT2> &t2

Triangle’s third vertex

Returns:

Barycentric coordinates of the closest point

Closet Points Jacobians

template <typename DerivedP, typename DerivedE0, typename DerivedE1>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::point_edge_closest_point_jacobian(
    
const Eigen::MatrixBase<DerivedP>& p,
    
const Eigen::MatrixBase<DerivedE0>& e0,
    
const Eigen::MatrixBase<DerivedE1>& e1);

Compute the Jacobian of the closest point on the edge.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

Point

const Eigen::MatrixBase<DerivedE0> &e0

First edge point

const Eigen::MatrixBase<DerivedE1> &e1

Second edge point

Returns:

Jacobian of the closest point

template <typename DerivedEA0, typename DerivedEA1,
    typename DerivedEB0, typename DerivedEB1>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::edge_edge_closest_point_jacobian(
    
const Eigen::MatrixBase<DerivedEA0>& ea0,
    
const Eigen::MatrixBase<DerivedEA1>& ea1,
    
const Eigen::MatrixBase<DerivedEB0>& eb0,
    
const Eigen::MatrixBase<DerivedEB1>& eb1);

Compute the Jacobian of the closest points between two edges.

Accepts any 3D Eigen expression; the scalar type is deduced.

Parameters:
const Eigen::MatrixBase<DerivedEA0> &ea0

First point of the first edge

const Eigen::MatrixBase<DerivedEA1> &ea1

Second point of the first edge

const Eigen::MatrixBase<DerivedEB0> &eb0

First point of the second edge

const Eigen::MatrixBase<DerivedEB1> &eb1

Second point of the second edge

Returns:

Jacobian of the closest points

template <typename DerivedP, typename DerivedT0, typename DerivedT1,
    typename DerivedT2>
inline IPC_TOOLKIT_HOST_DEVICE auto
ipc::point_triangle_closest_point_jacobian(
    
const Eigen::MatrixBase<DerivedP>& p,
    
const Eigen::MatrixBase<DerivedT0>& t0,
    
const Eigen::MatrixBase<DerivedT1>& t1,
    
const Eigen::MatrixBase<DerivedT2>& t2);

Compute the Jacobian of the closest point on the triangle.

Accepts any 3D Eigen expression; the scalar type is deduced.

Parameters:
const Eigen::MatrixBase<DerivedP> &p

Point

const Eigen::MatrixBase<DerivedT0> &t0

Triangle’s first vertex

const Eigen::MatrixBase<DerivedT1> &t1

Triangle’s second vertex

const Eigen::MatrixBase<DerivedT2> &t2

Triangle’s third vertex

Returns:

Jacobian of the closest point