Public Member Functions | Private Member Functions | List of all members
SurgSim::Physics::MassSpringRepresentationContact Class Reference

MassSpring frictionless contact implementation. More...

#include <SurgSim/Physics/MassSpringRepresentationContact.h>

Inheritance diagram for SurgSim::Physics::MassSpringRepresentationContact:
SurgSim::Physics::ConstraintImplementation

Public Member Functions

 MassSpringRepresentationContact ()
 Constructor. More...
 
virtual ~MassSpringRepresentationContact ()
 Destructor. More...
 
virtual SurgSim::Math::MlcpConstraintType getMlcpConstraintType () const override
 Gets the Mixed Linear Complementarity Problem constraint type for this ConstraintImplementation. More...
 
virtual RepresentationType getRepresentationType () const override
 Gets the Type of representation that this implementation is concerned with. More...
 
- Public Member Functions inherited from SurgSim::Physics::ConstraintImplementation
 ConstraintImplementation ()
 Constructor. More...
 
virtual ~ConstraintImplementation ()
 Destructor. More...
 
size_t getNumDof () const
 Gets the number of degree of freedom for this implementation. 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...
 

Private Member Functions

virtual size_t doGetNumDof () const override
 Gets the number of degrees of freedom for a frictionless contact. 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) override
 Adds a mass-spring frictionless contact constraint to an MlcpPhysicsProblem. More...
 

Additional Inherited Members

- Protected Attributes inherited from SurgSim::Physics::ConstraintImplementation
Eigen::SparseVector< double, 0, ptrdiff_t > m_newH
 Preallocated variable for derived implementations of doBuild. More...
 

Detailed Description

MassSpring frictionless contact implementation.

MassSpringRepresentationContact implements the frictionless contact constraint for the MassSpringRepresentation, which prevents nodes from passing through a surface. See MassSpringRepresentationContact::doBuild for more information.

Constructor & Destructor Documentation

SurgSim::Physics::MassSpringRepresentationContact::MassSpringRepresentationContact ( )

Constructor.

SurgSim::Physics::MassSpringRepresentationContact::~MassSpringRepresentationContact ( )
virtual

Destructor.

Member Function Documentation

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

Adds a mass-spring frictionless contact constraint to an MlcpPhysicsProblem.

Parameters
dtThe time step.
data[ContactConstraintData] Plane defining the constraint.
localization[MassSpringRepresentationLocalization] Location and Representation to be constrained.
[in,out]mlcpThe Mixed LCP physics problem to fill up.
indexOfRepresentationThe index of the representation (associated to this implementation) in the mlcp.
indexOfConstraintThe index of the constraint in the mlcp.
signThe sign of this implementation in the constraint (positive or negative side).

Implements SurgSim::Physics::ConstraintImplementation.

size_t SurgSim::Physics::MassSpringRepresentationContact::doGetNumDof ( ) const
overrideprivatevirtual

Gets the number of degrees of freedom for a frictionless contact.

Returns
1, as a frictionless contact only has 1 equation of constraint (along the normal direction).

Implements SurgSim::Physics::ConstraintImplementation.

SurgSim::Math::MlcpConstraintType SurgSim::Physics::MassSpringRepresentationContact::getMlcpConstraintType ( ) const
overridevirtual

Gets the Mixed Linear Complementarity Problem constraint type for this ConstraintImplementation.

Returns
SurgSim::Math::MLCP_UNILATERAL_3D_FRICTIONLESS_CONSTRAINT

Implements SurgSim::Physics::ConstraintImplementation.

SurgSim::Physics::RepresentationType SurgSim::Physics::MassSpringRepresentationContact::getRepresentationType ( ) const
overridevirtual

Gets the Type of representation that this implementation is concerned with.

Returns
SurgSim::Physics::REPRESENTATION_TYPE_MASSSPRING

Implements SurgSim::Physics::ConstraintImplementation.


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