Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | List of all members
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:
SurgSim::Physics::FemConstraintFixedPoint SurgSim::Physics::FemConstraintFixedRotationVector SurgSim::Physics::FemConstraintFrictionalSliding SurgSim::Physics::FemConstraintFrictionlessContact SurgSim::Physics::FemConstraintFrictionlessSliding SurgSim::Physics::FixedConstraintFixedPoint SurgSim::Physics::FixedConstraintFixedRotationVector SurgSim::Physics::FixedConstraintFrictionlessContact SurgSim::Physics::MassSpringConstraintFixedPoint SurgSim::Physics::MassSpringConstraintFrictionlessContact SurgSim::Physics::RigidConstraintFixedPoint SurgSim::Physics::RigidConstraintFixedRotationVector SurgSim::Physics::RigidConstraintFrictionlessContact

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 ConstraintImplementationFactorygetFactory ()
 

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
dtThe time step
dataThe data associated to the constraint
localizationThe localization for this implementation
[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)

◆ 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 
)
privatepure virtual

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

Parameters
dtThe time step
dataThe data associated to the constraint
localizationThe localization for the constraint
[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)

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

◆ doGetNumDof()

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

◆ getConstraintType()

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

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