Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

rdContactForce Class Reference

A abstract class that supports the application of contact force between two bodies, BodyA and BodyB. More...

#include <rdContactForce.h>

Inheritance diagram for rdContactForce:

rdForce rdActuator rdObject rdSetPoint rdLinearSetPoint rdPolynomialSetPoint List of all members.

Public Member Functions

 rdContactForce (int aBodyA=0, int aBodyB=0, int aNYP=0)
 Default constructor.

 rdContactForce (IDOM_Element *aElement, int aNYP=0)
 Construct an actuator from file.

 rdContactForce (const rdContactForce &aForce)
 Copy constructor.

virtual ~rdContactForce ()
 Destructor.

rdContactForce & operator= (const rdContactForce &aContact)
 Assignment operator.

void setNormalA (const double aNormal[3])
 Set the direction of the surface normal of BodyA at the location where the contact force is applied.

void getNormalA (double rNormal[3]) const
 Get the direction of the surface normal of BodyA at the location where the contact force is applied.

void setNormalB (const double aNormal[3])
 Set the direction of the surface normal of BodyB at the location where the contact force is applied.

void getNormalB (double rNormal[3]) const
 Get the direction of the surface normal of BodyB at the location where the contact force is applied.

void getNormalDisplacement (double rDisplacement[3]) const
 Get the normal component of the displacement vector directed from PointA to PointB expressed in the local frame of BodyA.

double getNormalDistance () const
 Get the magnitude of the normal displacement from PointA to PointB.

void getNormalVelocity (double rVelocity[3]) const
 Get the normal component of the velocity of PointB relative to PointA.

double getNormalSpeed () const
 Get the magnitude of the normal velocity of PointB relative to PointA.

void getTangent (double rTangent[3]) const
 Get the tangential component of the displacement of PointB relative to to PointA.

void getTangentialDisplacement (double rDisplacement[3]) const
 Get the tangential component of the displacement vector directed from PointA to PointB expressed in the local frame of BodyA.

double getTangentialDistance () const
 Get the magnitude of the tangential displacement from PointA to PointB.

void getTangentialVelocity (double rVelocity[3]) const
 Get the tangential component of the velocity of PointB relative to PointA expressed in the local frame of BodyA.

void getNormalForce (double rFP[3], double rFV[3], double rF[3]) const
 Get the normal force acting on BodyB expressed in the local frame of BodyA.

void getTangentialForce (double rFP[3], double rFV[3], double rF[3]) const
 Get the tangential force acting on BodyB expressed in the local frame of BodyA.

double getInstantaneousTangentialStiffness () const
 Get the stiffness of the spring in the plane tangent to the surface normal.

double getInstantaneousNormalStiffness () const
 Get the stiffness of the spring in the direction normal to the surface.

double getInstantaneousTangentialViscosity () const
 Get the instantaneous viscosity of the contact element in the plane tangent to the surface normal.

double getInstantaneousNormalViscosity () const
 Get the instantaneous viscosity of the contact element in the direction normal to the surface.

void getFrictionCorrection (double rDF[3]) const
 Get the coorection made in the spring force in order to enforce friction constaints.

virtual void updatePseudoStates ()=0
 Update actuator parameters so they are intervally consistent.

virtual void computeDisplacements ()
 Compute the normal and tangential displacements of PointB relative to PointA.

virtual void computeVelocities ()
 Compute the normal and tangential velocities of PointB relative to PointA.

virtual bool check () const
 Check that this actuator is valid.

virtual void computeLineOfActionComponents (double rNormal[3], double rTangential[3]) const
 Compute the normal and tangential components of the line of action of the force expressed in the local frame of BodyA.

virtual void updateObject (bool aDeep=true)
 Update this object based on its XML node.

virtual void updateNode (bool aDeep=true)
 Update the XML node representing this object.

virtual void generateNode (IDOM_Element *aParent)
 Generate an XML node representing this object.

void updateData ()
 Update the member data of this object based on its XML node.


Static Public Attributes

const char PROP_NORMAL_A [] = "normal_A"
const char PROP_NORMAL_B [] = "normal_B"

Protected Attributes

double _nB [3]
 Surface normal on BodyB expressed in the BodyB frame.

double _nA [3]
 Surface normal on BodyA expressed in the BodyA frame.

double _rnA [3]
 Normal displacement vector expressed in the BodyA frame.

double _rn
 Normal distance from PointA to PointB.

double _vnA [3]
 Normal velocity of PointB relative to PointA expressed in the BodyA frame.

double _vn
 Normal speed of PointB relative to PointA.

double _tA [3]
 Tangent displacement unit vector expressed in the BodyA frame.

double _rtA [3]
 Tangential displacement vector expressed in the BodyA frame.

double _rt
 Tangential distance from PointA to PointB.

double _vtA [3]
 Tangential velocity of PointB relative to PointA expressed in the BodyA frame.

double _ktp
 Instantaneous stiffness in the tangential direction.

double _ktv
 Instantaneous viscosity in the tangential direction.

double _knp
 Instantaneous stiffness in the normal direction.

double _knv
 Instantaneous viscosity in the normal direction.

double _fnMag
 Total normal force magnitude.

double _fnp [3]
 Elastic normal force applied to BodyB expressed in the local frame of BodyA.

double _fnv [3]
 Viscous normal force applied to BodyB expressed in the local frame of BodyA.

double _fn [3]
 Total ormal force applied to BodyB expressed in the local frame of BodyA.

double _ftMag
 Total tangential force magnitude corrected to be consistent with friction constraints.

double _ftp [3]
 Elastic tangential force NOT corrected to enforce friction constraints expressed in the local frame of BodyA.

double _ftv [3]
 Viscous tangential force NOT corrected to enforce friction constraints expressed in the local frame of BodyA.

double _ft [3]
 Total tangential force applied to BodyB expressed in the local frame of BodyA.

double _dfFric [3]
 Correction in the spring force in order to enforce friction constraints.


Private Member Functions

void setNull ()
 Set the data members of this actuator to their null values.


Detailed Description

A abstract class that supports the application of contact force between two bodies, BodyA and BodyB.

Actuators of this type have no states and no controls. That is, contact is assumed to be entirely passive and depends only on the states of a model or models.

Author:
Frank C. Anderson
Version:
1.0


Constructor & Destructor Documentation

rdContactForce::rdContactForce IDOM_Element *  aElement,
int  aNYP = 0
 

Construct an actuator from file.

Parameters:
aFileName Name of the file.

rdContactForce::rdContactForce const rdContactForce &  aForce  ) 
 

Copy constructor.

Parameters:
aForce Force to be copied.


Member Function Documentation

void rdContactForce::computeDisplacements  )  [virtual]
 

Compute the normal and tangential displacements of PointB relative to PointA.

See also:
computeLineOfActionComponents()

void rdContactForce::computeLineOfActionComponents double  rNormal[3],
double  rTangential[3]
const [virtual]
 

Compute the normal and tangential components of the line of action of the force expressed in the local frame of BodyA.

The normal component is the projection of the line of action onto the normal of BodyA:

normal = Dot(n,LOA) * nA.

The tangential component is the vector difference between the line of action and its normal component:

tangential = LOA - normalLOA.

Parameters:
rNormal Normal component of line of action expressed in the local frame of BodyA.
rTangential Tangential component of line of action expressed in the local frame of BodyA.

void rdContactForce::computeVelocities  )  [virtual]
 

Compute the normal and tangential velocities of PointB relative to PointA.

See also:
computeLineOfActionComponents()

void rdContactForce::generateNode IDOM_Element *  aParent  )  [virtual]
 

Generate an XML node representing this object.

Parameters:
aParent Intended parent of the node to be generated. If aParent is NULL, the intent is for this object to serve as the root element of a new document.
See also:
rdObject::generateNode()

Reimplemented from rdForce.

Reimplemented in rdLinearSetPoint, rdPolynomialSetPoint, and rdSetPoint.

void rdContactForce::getFrictionCorrection double  rDF[3]  )  const
 

Get the coorection made in the spring force in order to enforce friction constaints.

The correction is the change made to the force applied to BodyB expressed in the local frame of BodyA.

Friction corrections normally do not involve corrections to the normal force, so the correction will likely have zero magnitude in the direction of the normal force.

Parameters:
rDF Change made to the contact force applied to BodyA expressed in the local frame of BodyA.

double rdContactForce::getInstantaneousNormalStiffness  )  const
 

Get the stiffness of the spring in the direction normal to the surface.

Returns:
Normal stiffness.

double rdContactForce::getInstantaneousNormalViscosity  )  const
 

Get the instantaneous viscosity of the contact element in the direction normal to the surface.

Returns:
Normal viscosity.

double rdContactForce::getInstantaneousTangentialStiffness  )  const
 

Get the stiffness of the spring in the plane tangent to the surface normal.

Returns:
Tangent stiffness.

double rdContactForce::getInstantaneousTangentialViscosity  )  const
 

Get the instantaneous viscosity of the contact element in the plane tangent to the surface normal.

Returns:
Tangent viscosity.

void rdContactForce::getNormalA double  rNormal[3]  )  const
 

Get the direction of the surface normal of BodyA at the location where the contact force is applied.

Parameters:
rNormal Surface normal of BodyA.

void rdContactForce::getNormalB double  rNormal[3]  )  const
 

Get the direction of the surface normal of BodyB at the location where the contact force is applied.

Parameters:
rNormal Surface normal of BodyB.

void rdContactForce::getNormalDisplacement double  rDisplacement[3]  )  const
 

Get the normal component of the displacement vector directed from PointA to PointB expressed in the local frame of BodyA.

ComputeDisplacementVectors() should be called prior to calling this method to ensure that the returned result is valid.

Parameters:
rDisplacment Normal displacement vector.

double rdContactForce::getNormalDistance  )  const
 

Get the magnitude of the normal displacement from PointA to PointB.

A negative magnitude indicates that bodies A and B are penetrating.

ComputeDisplacementVectors() should be called prior to calling this method to ensure that the returned result is valid.

Returns:
Normal distance A positive value indicates penetration.

void rdContactForce::getNormalForce double  rFP[3],
double  rFV[3],
double  rF[3]
const
 

Get the normal force acting on BodyB expressed in the local frame of BodyA.

computeActuation() should be called prior to calling this method to ensure that the returned result is valid.

Parameters:
rFP Elastic normal force.
rFV Viscous normal force.
rF Total normal force.

double rdContactForce::getNormalSpeed  )  const
 

Get the magnitude of the normal velocity of PointB relative to PointA.

A negative value indicates that the bodies are getting closer together.

computeActuation() should be called prior to calling this method to ensure that the returned result is valid.

Returns:
Normal distance A positive value indicates penetration.

void rdContactForce::getNormalVelocity double  rVelocity[3]  )  const
 

Get the normal component of the velocity of PointB relative to PointA.

computeActuation() should be called prior to calling this method to ensure that the returned result is valid.

Parameters:
rVelocity Normal velocity vector.

void rdContactForce::getTangent double  rTangent[3]  )  const
 

Get the tangential component of the displacement of PointB relative to to PointA.

computeActuation() should prior to a call to this method for the returned results to be valid.

Parameters:
rTangent expressed as a unit vector in the local frame of BodyA.

void rdContactForce::getTangentialDisplacement double  rDisplacement[3]  )  const
 

Get the tangential component of the displacement vector directed from PointA to PointB expressed in the local frame of BodyA.

computeActuation() should be called prior to calling this method to ensure that the returned result is valid.

Parameters:
rDisplacement Tangential displacement vector.

double rdContactForce::getTangentialDistance  )  const
 

Get the magnitude of the tangential displacement from PointA to PointB.

computeActuation() should be called prior to calling this method to ensure that the returned result is valid.

Returns:
Tangential displacement magnitude. The returned value is always positive.

void rdContactForce::getTangentialForce double  rFP[3],
double  rFV[3],
double  rF[3]
const
 

Get the tangential force acting on BodyB expressed in the local frame of BodyA.

computeActuation() should be called prior to calling this method to ensure that the returned result is valid.

Parameters:
rFP Elastic normal force NOT corrected to enforce friction constraints.
rFV Viscous normal force NOT corrected to enforce friction constraints.
rF Total normal force corrected to enforce friction constraints. This force is the actual force applied to BodyB.

void rdContactForce::getTangentialVelocity double  rVelocity[3]  )  const
 

Get the tangential component of the velocity of PointB relative to PointA expressed in the local frame of BodyA.

computeActuation() should be called prior to calling this method to ensure that the returned result is valid.

Parameters:
rVelocity Tangential velocity vector.

rdContactForce & rdContactForce::operator= const rdContactForce &  aContact  ) 
 

Assignment operator.

Returns:
Reference to this object.

void rdContactForce::setNormalA const double  aNormal[3]  ) 
 

Set the direction of the surface normal of BodyA at the location where the contact force is applied.

When this method is used to set the surface normal for BodyA, the last surface normal set for BodyB is ignored.

Parameters:
aNormal Direction of surface normal in body-local coordinates.
See also:
setNormalB()

void rdContactForce::setNormalB const double  aNormal[3]  ) 
 

Set the direction of the surface normal of BodyB at the location where the contact force is applied.

When this method is used to set the surface normal for BodyB, the last surface normal set for BodyA is ignored.

Parameters:
aNormal Direction of surface normal in body-local coordinates.
See also:
setNormalA()

void rdContactForce::updateData  ) 
 

Update the member data of this object based on its XML node.

Member objects (children) are not updated.

Reimplemented from rdForce.

Reimplemented in rdLinearSetPoint, rdPolynomialSetPoint, and rdSetPoint.

void rdContactForce::updateNode bool  aDeep = true  )  [virtual]
 

Update the XML node representing this object.

Parameters:
aDeep If true, update the XML node of this object AND the XML nodes of all class members that are rdObjects (child nodes); if false, update only the XML node of this object without updating the XML nodes of its children.

Reimplemented from rdForce.

Reimplemented in rdLinearSetPoint, rdPolynomialSetPoint, and rdSetPoint.

void rdContactForce::updateObject bool  aDeep = true  )  [virtual]
 

Update this object based on its XML node.

Parameters:
aDeep If true, update this object and all its child objects (that is, member variables that are rdObject's); if false, update only the member variables that are not rdObject's.

Reimplemented from rdForce.

Reimplemented in rdLinearSetPoint, rdPolynomialSetPoint, and rdSetPoint.

virtual void rdContactForce::updatePseudoStates  )  [pure virtual]
 

Update actuator parameters so they are intervally consistent.

This method is distinguished from computeActuation() in that it is normally called only after an integration time step has been taken. Updating spring setpoints is an example.

Reimplemented from rdActuator.

Implemented in rdSetPoint.


Member Data Documentation

double rdContactForce::_dfFric[3] [protected]
 

Correction in the spring force in order to enforce friction constraints.

It is the change made to the force applied to BodyA and is expressed in the local frame of BodyA.

double rdContactForce::_ft[3] [protected]
 

Total tangential force applied to BodyB expressed in the local frame of BodyA.

Note that _ftA is not necessarily in the same direction as _tA because of the viscosity component.


The documentation for this class was generated from the following files:
Generated on Wed Aug 20 02:17:09 2003 for Simulation Software by doxygen1.3