chrono::ChContactTuple< Ta, Tb > Class Template Reference

Description

template<class Ta, class Tb>
class chrono::ChContactTuple< Ta, Tb >

Base class for contact between two generic ChContactable objects.

T1 and T2 are of ChContactable sub classes.

#include <ChContactTuple.h>

Inheritance diagram for chrono::ChContactTuple< Ta, Tb >:
Collaboration diagram for chrono::ChContactTuple< Ta, Tb >:

Public Types

typedef
Ta::type_variable_tuple_carrier 
typecarr_a
 
typedef
Tb::type_variable_tuple_carrier 
typecarr_b
 

Public Member Functions

 ChContactTuple (ChContactContainerBase *mcontainer, Ta *mobjA, Tb *mobjB, const collision::ChCollisionInfo &cinfo)
 
virtual void Reset (Ta *mobjA, Tb *mobjB, const collision::ChCollisionInfo &cinfo)
 Initialize again this constraint. More...
 
Ta * GetObjA ()
 Get the colliding object A, with point P1.
 
Tb * GetObjB ()
 Get the colliding object B, with point P2.
 
ChCoordsys GetContactCoords () const
 Get the contact coordinate system, expressed in absolute frame. More...
 
const ChMatrix33GetContactPlane () const
 Returns the pointer to a contained 3x3 matrix representing the UV and normal directions of the contact. More...
 
const ChVectorGetContactP1 () const
 Get the contact point 1, in absolute coordinates.
 
const ChVectorGetContactP2 () const
 Get the contact point 2, in absolute coordinates.
 
const ChVectorGetContactNormal () const
 Get the contact normal, in absolute coordinates.
 
double GetContactDistance () const
 Get the contact distance.
 
virtual ChVector GetContactForce () const
 Get the contact force, if computed, in contact coordinate system.
 
virtual void ContIntStateGatherReactions (const unsigned int off_L, ChVectorDynamic<> &L)
 
virtual void ContIntStateScatterReactions (const unsigned int off_L, const ChVectorDynamic<> &L)
 
virtual void ContIntLoadResidual_CqL (const unsigned int off_L, ChVectorDynamic<> &R, const ChVectorDynamic<> &L, const double c)
 
virtual void ContIntLoadConstraint_C (const unsigned int off_L, ChVectorDynamic<> &Qc, const double c, bool do_clamp, double recovery_clamp)
 
virtual void ContIntLoadResidual_F (ChVectorDynamic<> &R, const double c)
 
virtual void ContInjectKRMmatrices (ChSystemDescriptor &mdescriptor)
 
virtual void ContKRMmatricesLoad (double Kfactor, double Rfactor)
 
virtual void ContIntToDescriptor (const unsigned int off_L, const ChVectorDynamic<> &L, const ChVectorDynamic<> &Qc)
 
virtual void ContIntFromDescriptor (const unsigned int off_L, ChVectorDynamic<> &L)
 
virtual void InjectConstraints (ChSystemDescriptor &mdescriptor)
 
virtual void ConstraintsBiReset ()
 
virtual void ConstraintsBiLoad_C (double factor=1., double recovery_clamp=0.1, bool do_clamp=false)
 
virtual void ConstraintsFetch_react (double factor)
 

Protected Attributes

ChContactContainerBasecontainer
 associated contact container
 
Ta * objA
 first ChContactable object in the pair
 
Tb * objB
 second ChContactable object in the pair
 
ChVector p1
 max penetration point on geo1, after refining, in abs space
 
ChVector p2
 max penetration point on geo2, after refining, in abs space
 
ChVector normal
 normal, on surface of master reference (geo1)
 
ChMatrix33 contact_plane
 the plane of contact (X is normal direction)
 
double norm_dist
 penetration distance (negative if going inside) after refining
 

Constructor & Destructor Documentation

template<class Ta, class Tb>
chrono::ChContactTuple< Ta, Tb >::ChContactTuple ( ChContactContainerBase mcontainer,
Ta *  mobjA,
Tb *  mobjB,
const collision::ChCollisionInfo cinfo 
)
Parameters
mcontainercontact container
mobjAChContactable object A
mobjBChContactable object B
cinfodata for the contact pair

Member Function Documentation

template<class Ta, class Tb>
virtual void chrono::ChContactTuple< Ta, Tb >::ContIntFromDescriptor ( const unsigned int  off_L,
ChVectorDynamic<> &  L 
)
virtual
Parameters
off_Loffset in L

Reimplemented in chrono::ChContactDVI< Ta, Tb >, and chrono::ChContactDVIrolling< Ta, Tb >.

template<class Ta, class Tb>
virtual void chrono::ChContactTuple< Ta, Tb >::ContIntLoadConstraint_C ( const unsigned int  off_L,
ChVectorDynamic<> &  Qc,
const double  c,
bool  do_clamp,
double  recovery_clamp 
)
virtual
Parameters
off_Loffset in Qc residual
Qcresult: the Qc residual, Qc += c*C
ca scaling factor
do_clampapply clamping to c*C?
recovery_clampvalue for min/max clamping of c*C

Reimplemented in chrono::ChContactDVIrolling< Ta, Tb >, and chrono::ChContactDVI< Ta, Tb >.

template<class Ta, class Tb>
virtual void chrono::ChContactTuple< Ta, Tb >::ContIntLoadResidual_CqL ( const unsigned int  off_L,
ChVectorDynamic<> &  R,
const ChVectorDynamic<> &  L,
const double  c 
)
virtual
Parameters
off_Loffset in L multipliers
Rresult: the R residual, R += c*Cq'*L
Lthe L vector
ca scaling factor

Reimplemented in chrono::ChContactDVIrolling< Ta, Tb >, and chrono::ChContactDVI< Ta, Tb >.

template<class Ta, class Tb>
virtual void chrono::ChContactTuple< Ta, Tb >::ContIntToDescriptor ( const unsigned int  off_L,
const ChVectorDynamic<> &  L,
const ChVectorDynamic<> &  Qc 
)
virtual
Parameters
off_Loffset in L, Qc

Reimplemented in chrono::ChContactDVI< Ta, Tb >, and chrono::ChContactDVIrolling< Ta, Tb >.

template<class Ta, class Tb>
ChCoordsys chrono::ChContactTuple< Ta, Tb >::GetContactCoords ( ) const

Get the contact coordinate system, expressed in absolute frame.

This represents the 'main' reference of the link: reaction forces are expressed in this coordinate system. Its origin is point P2. (It is the coordinate system of the contact plane and normal)

template<class Ta, class Tb>
const ChMatrix33& chrono::ChContactTuple< Ta, Tb >::GetContactPlane ( ) const

Returns the pointer to a contained 3x3 matrix representing the UV and normal directions of the contact.

In detail, the X versor (the 1s column of the matrix) represents the direction of the contact normal.

template<class Ta, class Tb>
virtual void chrono::ChContactTuple< Ta, Tb >::Reset ( Ta *  mobjA,
Tb *  mobjB,
const collision::ChCollisionInfo cinfo 
)
virtual

Initialize again this constraint.

Parameters
mobjAChContactable object A
mobjBChContactable object B
cinfodata for the contact pair

Reimplemented in chrono::ChContactDEM< Ta, Tb >, chrono::ChContactDVIrolling< Ta, Tb >, and chrono::ChContactDVI< Ta, Tb >.