opensurgsim
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SurgSim::Physics::MlcpPhysicsProblem Struct Reference

A description of a physical mixed LCP system to be solved. More...

#include <MlcpPhysicsProblem.h>

Inheritance diagram for SurgSim::Physics::MlcpPhysicsProblem:
SurgSim::Math::MlcpProblem

Public Member Functions

 ~MlcpPhysicsProblem () override
 Destructor.
 
void updateConstraint (const Eigen::SparseVector< double, Eigen::RowMajor, ptrdiff_t > &newSubH, const Vector &newCHt, size_t indexSubC, size_t indexNewSubH)
 Applies a new constraint to a specific Representation. More...
 
void setZero (size_t numDof, size_t numConstraintDof, size_t numConstraints) override
 Resize an MlcpPhysicsProblem and set to zero. More...
 
- Public Member Functions inherited from SurgSim::Math::MlcpProblem
virtual ~MlcpProblem ()
 Destructor.
 
size_t getSize () const
 Gets the size of the system. More...
 
bool isConsistent () const
 Checks if the sizes of various elements of the system are consistent with each other. More...
 

Static Public Member Functions

static MlcpPhysicsProblem Zero (size_t numDof, size_t numConstraintDof, size_t numConstraints)
 Initialize an MlcpPhysicsProblem with zero values. More...
 
- Static Public Member Functions inherited from SurgSim::Math::MlcpProblem
static MlcpProblem Zero (size_t numDof, size_t numConstraintDof, size_t numConstraints)
 Initialize an MlcpProblem with zero values. More...
 

Public Attributes

Eigen::SparseMatrix< double, Eigen::RowMajor, ptrdiff_t > H
 The matrix \(\mathbf{H}\), which is a matrix of size \(c\times n\) that converts from the \(n\) degrees of freedom in the system (i.e., the sum of all the DOF over all the representations in the scene), to the \(c\) degrees of freedom summed over all the constraints being applied to the system. More...
 
Matrix CHt
 The matrix \(\mathbf{C\;H^T}\), which is a matrix of size \(n\times c\) that is used to convert the vector of \(c\) constraint forces to the \(n\) displacements of each degree of freedom of the system. More...
 
- Public Attributes inherited from SurgSim::Math::MlcpProblem
Matrix A
 Matrix \(\mathbf{A}\) used to describe the mixed LCP problem.
 
Vector b
 Vector \(b\) used to describe the mixed LCP problem.
 
Vector mu
 A vector of friction coefficients used to describe the mixed LCP problem. More...
 
std::vector< MlcpConstraintType > constraintTypes
 A vector of constraint types used to describe the mixed LCP problem. More...
 

Additional Inherited Members

- Public Types inherited from SurgSim::Math::MlcpProblem
typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
 
typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
 

Detailed Description

A description of a physical mixed LCP system to be solved.

This extends the pure mathematical MLCP problem by storing the intermediate matrices H and CHt that are necessary to physically interpret the solution.

Note that the matrix \(\mathbf{A}\) used in the MlcpProblem is computed in the physical problem as \(\mathbf{H\;C\;H^T}\), where \(\mathbf{C}\) is the compliance matrix. For contact constraints, \(b\) is the initial signed displacements between the colliding representations, \(b_i \lt 0\) when the representations interpenetrate, \(x\) is the forces to apply at each contact to prevent penetration, and \(c\) is the signed displacements after the forces are applied.

Note
The solution to the MLCP will only address the constraints that were provided, and application of \(x\) to the representations in the scene may cause new collisions for constraints that were not originally incorporated in the MLCP.
See also
SurgSim::Math::MlcpProblem

Member Function Documentation

§ setZero()

void SurgSim::Physics::MlcpPhysicsProblem::setZero ( size_t  numDof,
size_t  numConstraintDof,
size_t  numConstraints 
)
overridevirtual

Resize an MlcpPhysicsProblem and set to zero.

Parameters
numDofthe total degrees of freedom.
numConstraintDofthe total constrained degrees of freedom.
numConstraintsthe number of constraints.

Reimplemented from SurgSim::Math::MlcpProblem.

§ updateConstraint()

void SurgSim::Physics::MlcpPhysicsProblem::updateConstraint ( const Eigen::SparseVector< double, Eigen::RowMajor, ptrdiff_t > &  newSubH,
const Vector &  newCHt,
size_t  indexSubC,
size_t  indexNewSubH 
)

Applies a new constraint to a specific Representation.

Parameters
newSubHNew constraint to be added to H
newCHtCompliance matrix (system matrix inverse) times newSubH
indexSubCIndex of the Representation's compliance matrix
indexNewSubHIndex of the new constraint within H

§ Zero()

MlcpPhysicsProblem SurgSim::Physics::MlcpPhysicsProblem::Zero ( size_t  numDof,
size_t  numConstraintDof,
size_t  numConstraints 
)
static

Initialize an MlcpPhysicsProblem with zero values.

Parameters
numDofthe total degrees of freedom for the MlcpPhysicsProblem to be constructed.
numConstraintDofthe total constrained degrees of freedom for the MlcpPhysicsProblem to be constructed.
numConstraintsthe number of constraints for the MlcpPhysicsProblem to be constructed.
Returns
An MlcpPhysicsProblem appropriately sized and initialized to zero.

Member Data Documentation

§ CHt

Matrix SurgSim::Physics::MlcpPhysicsProblem::CHt

The matrix \(\mathbf{C\;H^T}\), which is a matrix of size \(n\times c\) that is used to convert the vector of \(c\) constraint forces to the \(n\) displacements of each degree of freedom of the system.

§ H

Eigen::SparseMatrix<double, Eigen::RowMajor, ptrdiff_t> SurgSim::Physics::MlcpPhysicsProblem::H

The matrix \(\mathbf{H}\), which is a matrix of size \(c\times n\) that converts from the \(n\) degrees of freedom in the system (i.e., the sum of all the DOF over all the representations in the scene), to the \(c\) degrees of freedom summed over all the constraints being applied to the system.

It is used to convert the vector of \(n\) displacements of each degree of freedom of the system to the vector of \(c\) displacements of each degree of freedom of the constraints. Given a set of constraints \(\mathbf{G}(t, \mathbf{x})\), then \(\mathbf{H} = \frac{d \mathbf{G}}{d \mathbf{x}}\) (i.e., the constraints' tangential space).


The documentation for this struct was generated from the following files: