SurgSim::Physics::ConstraintImplementation Class Referenceabstract

Base class for all constraint implementations. A ConstraintImplementation defines 1 side of a constraint. More...

`#include <SurgSim/Physics/ConstraintImplementation.h>`

Inheritance diagram for SurgSim::Physics::ConstraintImplementation:

## Public Member Functions

| ConstraintImplementation ()
| Constructor. More...
virtual | ~ConstraintImplementation ()
| Destructor. More...
size_t | getNumDof () const
| Gets the number of degree of freedom for this implementation. More...
virtual SurgSim::Physics::ConstraintType | getConstraintType () const =0
| Gets the constraint type for this ConstraintImplementation. More...
void | build (double dt, const ConstraintData &data, const std::shared_ptr< Localization > &localization, MlcpPhysicsProblem *mlcp, size_t indexOfRepresentation, size_t indexOfConstraint, ConstraintSideSign sign)
| Builds the subset of an Mlcp physics problem associated to this implementation. More...

## Static Public Member Functions

static ConstraintImplementationFactory & | getFactory ()

## Protected Attributes

Eigen::SparseVector< double, Eigen::RowMajor, ptrdiff_t > | m_newH
| Preallocated variable for derived implementations of doBuild. More...

## Private Member Functions

virtual size_t | doGetNumDof () const =0
| Does get number of degree of freedom. More...
virtual void | doBuild (double dt, const ConstraintData &data, const std::shared_ptr< Localization > &localization, MlcpPhysicsProblem *mlcp, size_t indexOfRepresentation, size_t indexOfConstraint, ConstraintSideSign sign)=0
| Builds the subset of an Mlcp physics problem associated to this implementation. More...

## Detailed Description

Base class for all constraint implementations. A ConstraintImplementation defines 1 side of a constraint.

## Constructor & Destructor Documentation

## ConstraintImplementation()

SurgSim::Physics::ConstraintImplementation::ConstraintImplementation | ( |  | ) |

Constructor.

## ~ConstraintImplementation()

SurgSim::Physics::ConstraintImplementation::~ConstraintImplementation | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## build()

void SurgSim::Physics::ConstraintImplementation::build | ( | double | dt,
|  | const ConstraintData & | data,
|  | const std::shared_ptr< Localization > & | localization,
|  | MlcpPhysicsProblem * | mlcp,
|  | size_t | indexOfRepresentation,
|  | size_t | indexOfConstraint,
|  | ConstraintSideSign | sign
| ) |  |

Builds the subset of an Mlcp physics problem associated to this implementation.

Parameters

  | dt | The time step
  | data | The data associated to the constraint
  | localization | The localization for this implementation
  [in,out] | mlcp | The Mixed LCP physics problem to fill up
  | indexOfRepresentation | The index of the representation (associated to this implementation) in the mlcp
  | indexOfConstraint | The index of the constraint in the mlcp
  | sign | The sign of this implementation in the constraint (positive or negative side)

## doBuild()

virtual void SurgSim::Physics::ConstraintImplementation::doBuild | ( | double | dt,
|  | const ConstraintData & | data,
|  | const std::shared_ptr< Localization > & | localization,
|  | MlcpPhysicsProblem * | mlcp,
|  | size_t | indexOfRepresentation,
|  | size_t | indexOfConstraint,
|  | ConstraintSideSign | sign
| ) |  |

private pure virtual

Builds the subset of an Mlcp physics problem associated to this implementation.

Parameters

  | dt | The time step
  | data | The data associated to the constraint
  | localization | The localization for the constraint
  [in,out] | mlcp | The Mixed LCP physics problem to fill up
  | indexOfRepresentation | The index of the representation (associated to this implementation) in the mlcp
  | indexOfConstraint | The index of the constraint in the mlcp
  | sign | The sign of this implementation in the constraint (positive or negative side)

Implemented in SurgSim::Physics::MassSpringConstraintFrictionlessContact, SurgSim::Physics::FixedConstraintFrictionlessContact, SurgSim::Physics::RigidConstraintFrictionlessContact, SurgSim::Physics::FixedConstraintFixedPoint, SurgSim::Physics::RigidConstraintFixedPoint, SurgSim::Physics::FixedConstraintFixedRotationVector, SurgSim::Physics::RigidConstraintFixedRotationVector, SurgSim::Physics::FemConstraintFixedRotationVector, SurgSim::Physics::MassSpringConstraintFixedPoint, SurgSim::Physics::FemConstraintFrictionlessContact, SurgSim::Physics::FemConstraintFixedPoint, SurgSim::Physics::FemConstraintFrictionalSliding, and SurgSim::Physics::FemConstraintFrictionlessSliding.

## doGetNumDof()

virtual size_t SurgSim::Physics::ConstraintImplementation::doGetNumDof | ( |  | ) | const

private pure virtual

Does get number of degree of freedom.

Returns
  The number of degree of freedom associated to this implementation

Implemented in SurgSim::Physics::MassSpringConstraintFrictionlessContact, SurgSim::Physics::RigidConstraintFrictionlessContact, SurgSim::Physics::FixedConstraintFrictionlessContact, SurgSim::Physics::FixedConstraintFixedPoint, SurgSim::Physics::RigidConstraintFixedPoint, SurgSim::Physics::FixedConstraintFixedRotationVector, SurgSim::Physics::RigidConstraintFixedRotationVector, SurgSim::Physics::MassSpringConstraintFixedPoint, SurgSim::Physics::FemConstraintFrictionlessContact, SurgSim::Physics::FemConstraintFixedPoint, SurgSim::Physics::FemConstraintFixedRotationVector, SurgSim::Physics::FemConstraintFrictionalSliding, and SurgSim::Physics::FemConstraintFrictionlessSliding.

## getConstraintType()

virtual SurgSim::Physics::ConstraintType SurgSim::Physics::ConstraintImplementation::getConstraintType | ( |  | ) | const

pure virtual

Gets the constraint type for this ConstraintImplementation.

Returns
  The constraint type corresponding to this constraint implementation

Implemented in SurgSim::Physics::MassSpringConstraintFrictionlessContact, SurgSim::Physics::RigidConstraintFrictionlessContact, SurgSim::Physics::FixedConstraintFrictionlessContact, SurgSim::Physics::FixedConstraintFixedPoint, SurgSim::Physics::RigidConstraintFixedPoint, SurgSim::Physics::FixedConstraintFixedRotationVector, SurgSim::Physics::RigidConstraintFixedRotationVector, SurgSim::Physics::MassSpringConstraintFixedPoint, SurgSim::Physics::FemConstraintFrictionlessContact, SurgSim::Physics::FemConstraintFixedPoint, SurgSim::Physics::FemConstraintFixedRotationVector, SurgSim::Physics::FemConstraintFrictionalSliding, and SurgSim::Physics::FemConstraintFrictionlessSliding.

## getFactory()

ConstraintImplementationFactory & SurgSim::Physics::ConstraintImplementation::getFactory | ( |  | ) |

static

Returns
  The static class factory that contains the implementations for a given Representation type.

## getNumDof()

size_t SurgSim::Physics::ConstraintImplementation::getNumDof | ( |  | ) | const

Gets the number of degree of freedom for this implementation.

Returns
  The number of degree of freedom for this implementation

## Member Data Documentation

## m_newH

Eigen::SparseVector<double, Eigen::RowMajor, ptrdiff_t> SurgSim::Physics::ConstraintImplementation::m_newH

protected

Preallocated variable for derived implementations of doBuild.

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

- SurgSim/Physics/ConstraintImplementation.h
- SurgSim/Physics/ConstraintImplementation.cpp