OpenSim::PointKinematics Class Reference

A class for recording the kinematics of a point on a body of a model during a simulation. More...

#include <PointKinematics.h>

Inheritance diagram for OpenSim::PointKinematics:
OpenSim::Analysis OpenSim::Object

List of all members.

Public Member Functions

 PointKinematics (Model *aModel=0)
 Construct an PointKinematics instance for recording the kinematics of the bodies of a model during a simulation.
 PointKinematics (const std::string &aFileName)
 Construct an object from file.
 PointKinematics (const PointKinematics &aObject)
 Copy constructor.
virtual Objectcopy () const
 Clone.
virtual ~PointKinematics ()
 Destructor.
PointKinematicsoperator= (const PointKinematics &aPointKinematics)
 Assign this object to the values of another.
void setBodyPoint (const std::string &aBody, const SimTK::Vec3 &aPoint)
 Set the body for which the point kinematics are to be computed and the point on the body represented in local frame.
void setBody (Body *aBody)
 Set the body for which the induced accelerations are to be computed.
void setRelativeToBody (Body *aBody)
BodygetBody ()
 Get the body for which the induced accelerations are to be computed.
BodygetRelativeToBody ()
void setPoint (const SimTK::Vec3 &aPoint)
 Set the point for which the induced accelerations are to be computed.
void getPoint (SimTK::Vec3 &rPoint)
 Get the point for which the induced accelerations are to be computed.
void setPointName (const std::string &aName)
const std::string & getPointName ()
 Get the point name.
virtual void setModel (Model &aModel)
 Set the model for which the point kinematics are to be computed.
void setStorageCapacityIncrements (int aIncrement)
 Set the capacity increments of all storage instances.
StoragegetAccelerationStorage ()
 Get the acceleration storage.
StoragegetVelocityStorage ()
 Get the velocity storage.
StoragegetPositionStorage ()
 Get the position storage.
virtual int begin (SimTK::State &s)
 This method is called at the beginning of an analysis so that any necessary initializations may be performed.
virtual int step (const SimTK::State &s, int setNumber)
 This method is called to perform the analysis.
virtual int end (SimTK::State &s)
 This method is called at the end of an analysis so that any necessary finalizations may be performed.
virtual int printResults (const std::string &aBaseName, const std::string &aDir="", double aDT=-1.0, const std::string &aExtension=".sto")
 Print the results of the analysis.

Static Public Attributes

static const int NAME_LENGTH = PointKinematicsNAME_LENGTH
static const int BUFFER_LENGTH = PointKinematicsBUFFER_LENGTH

Protected Member Functions

virtual int record (const SimTK::State &s)
 Record the kinematics.

Protected Attributes

PropertyStr _bodyNameProp
PropertyDblVec3 _pointProp
PropertyStr _pointNameProp
PropertyStr _relativeToBodyNameProp
std::string & _bodyName
SimTK::Vec3 & _point
std::string & _pointName
std::string & _relativeToBodyName
double * _dy
double * _kin
Storage_pStore
Storage_vStore
Storage_aStore

Detailed Description

A class for recording the kinematics of a point on a body of a model during a simulation.

Author:
Frank C. Anderson
Version:
1.0

Constructor & Destructor Documentation

PointKinematics::PointKinematics ( Model aModel = 0  ) 

Construct an PointKinematics instance for recording the kinematics of the bodies of a model during a simulation.

Also serves as a default constructor

Parameters:
aModel Model for which the analyses are to be recorded.
PointKinematics::PointKinematics ( const std::string &  aFileName  ) 

Construct an object from file.

The object is constructed from the root element of the XML document. The type of object is the tag name of the XML root element.

Parameters:
aFileName File name of the document.
PointKinematics::PointKinematics ( const PointKinematics aObject  ) 

Copy constructor.

PointKinematics::~PointKinematics (  )  [virtual]

Destructor.


Member Function Documentation

int PointKinematics::begin ( SimTK::State &  s  )  [virtual]

This method is called at the beginning of an analysis so that any necessary initializations may be performed.

This method is meant to be called at the begining of an integration

This method should be overriden in the child class. It is included here so that the child class will not have to implement it if it is not necessary.

Parameters:
s current system state
aClientData General use pointer for sending in client data.
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.

Object * PointKinematics::copy (  )  const [virtual]

Clone.

Reimplemented from OpenSim::Analysis.

int PointKinematics::end ( SimTK::State &  s  )  [virtual]

This method is called at the end of an analysis so that any necessary finalizations may be performed.

This method is meant to be called at the end of an integration

This method should be overriden in the child class. It is included here so that the child class will not have to implement it if it is not necessary.

Parameters:
s current state of system
aClientData General use pointer for sending in client data.
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.

Storage * PointKinematics::getAccelerationStorage (  ) 

Get the acceleration storage.

Returns:
Acceleration storage.
Body * PointKinematics::getBody (  ) 

Get the body for which the induced accelerations are to be computed.

Returns:
Body pointer
void PointKinematics::getPoint ( SimTK::Vec3 &  rPoint  ) 

Get the point for which the induced accelerations are to be computed.

Parameters:
rPoint X-Y-Z Point
const std::string & PointKinematics::getPointName (  ) 

Get the point name.

Parameters:
aName Name for the point.
Storage * PointKinematics::getPositionStorage (  ) 

Get the position storage.

Returns:
Position storage.
Body * PointKinematics::getRelativeToBody (  ) 
Storage * PointKinematics::getVelocityStorage (  ) 

Get the velocity storage.

Returns:
Velocity storage.
PointKinematics & PointKinematics::operator= ( const PointKinematics aPointKinematics  ) 

Assign this object to the values of another.

Returns:
Reference to this object.

Reimplemented from OpenSim::Analysis.

virtual int OpenSim::PointKinematics::printResults ( const std::string &  aBaseName,
const std::string &  aDir = "",
double  aDT = -1.0,
const std::string &  aExtension = ".sto" 
) [virtual]

Print the results of the analysis.

Parameters:
aFileName File to which to print the data.
aDT Time interval between results (linear interpolation is used). If not included as an argument or negative, all time steps are printed without interpolation.
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.

int PointKinematics::record ( const SimTK::State &  s  )  [protected, virtual]

Record the kinematics.

void PointKinematics::setBody ( Body aBody  ) 

Set the body for which the induced accelerations are to be computed.

Parameters:
aBody Body ID
void PointKinematics::setBodyPoint ( const std::string &  aBody,
const SimTK::Vec3 &  aPoint 
)

Set the body for which the point kinematics are to be computed and the point on the body represented in local frame.

Both params are required to avoid the limbo state where either body or point are undefined..

Parameters:
aBody Body name [3] aPoint point coordinates
void PointKinematics::setModel ( Model aModel  )  [virtual]

Set the model for which the point kinematics are to be computed.

Parameters:
aModel Model pointer

Reimplemented from OpenSim::Analysis.

void PointKinematics::setPoint ( const SimTK::Vec3 &  aPoint  ) 

Set the point for which the induced accelerations are to be computed.

Parameters:
aPoint X-Y-Z Point
void OpenSim::PointKinematics::setPointName ( const std::string &  aName  ) 
void PointKinematics::setRelativeToBody ( Body aBody  ) 
void PointKinematics::setStorageCapacityIncrements ( int  aIncrement  ) 

Set the capacity increments of all storage instances.

Parameters:
aIncrement Increment by which storage capacities will be increased when storage capcities run out.
int PointKinematics::step ( const SimTK::State &  s,
int  stepNumber 
) [virtual]

This method is called to perform the analysis.

It can be called during the execution of a forward integrations or after the integration by feeding it the necessary data.

When called during an integration, this method is meant to be called

This method should be overriden in derived classes. It is included here so that the derived class will not have to implement it if it is not necessary.

Parameters:
s current state of system
aClientData General use pointer for sending in client data.
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.


Member Data Documentation

std::string& OpenSim::PointKinematics::_bodyName [protected]
double* OpenSim::PointKinematics::_dy [protected]
double* OpenSim::PointKinematics::_kin [protected]
SimTK::Vec3& OpenSim::PointKinematics::_point [protected]
std::string& OpenSim::PointKinematics::_pointName [protected]
const int PointKinematics::BUFFER_LENGTH = PointKinematicsBUFFER_LENGTH [static]
const int PointKinematics::NAME_LENGTH = PointKinematicsNAME_LENGTH [static]

Reimplemented from OpenSim::Object.


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

Generated on Sun Sep 25 00:19:47 2011 for OpenSim by  doxygen 1.6.1