All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 <SurgSim/Physics/MlcpPhysicsProblem.h>

Inheritance diagram for SurgSim::Physics::MlcpPhysicsProblem:
Inheritance graph
[legend]
Collaboration diagram for SurgSim::Physics::MlcpPhysicsProblem:
Collaboration graph
[legend]

Public Member Functions

virtual ~MlcpPhysicsProblem () override
 Destructor. More...
 
template<typename SubCDerivedType >
void updateConstraint (const Eigen::SparseVector< double > &newSubH, const Eigen::MatrixBase< SubCDerivedType > &subC, size_t indexSubC, size_t indexNewSubH)
 Applies a new constraint to a specific Representation. More...
 
virtual 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. More...
 
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

Matrix 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. More...
 
Vector b
 Vector \(b\) used to describe the mixed LCP problem. More...
 
Vector mu
 A vector of friction coefficients used to describe the mixed LCP problem. More...
 
std::vector< MlcpConstraintTypeconstraintTypes
 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

Constructor & Destructor Documentation

SurgSim::Physics::MlcpPhysicsProblem::~MlcpPhysicsProblem ( )
overridevirtual

Destructor.

Member Function Documentation

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.

template<typename SubCDerivedType >
void SurgSim::Physics::MlcpPhysicsProblem::updateConstraint ( const Eigen::SparseVector< double > &  newSubH,
const Eigen::MatrixBase< SubCDerivedType > &  subC,
size_t  indexSubC,
size_t  indexNewSubH 
)

Applies a new constraint to a specific Representation.

Parameters
newSubHNew constraint to be added to H
subCCompliance matrix associated with the Representation
indexSubCIndex of the Representation's compliance matrix
indexNewSubHIndex of the new constraint within H
Template Parameters
SubCDerivedTypethe CRTP derived type of the passed subC matrix, which usually can be deduced
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

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.

Matrix 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: