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

suGeneralizedForces Class Reference

A class for recording the joint torques of the generalized coordinates of a model during a simulation. More...

#include <suGeneralizedForces.h>

Inheritance diagram for suGeneralizedForces:

rdAnalysis List of all members.

Public Member Functions

 suGeneralizedForces (rdModel *aModel)
 Construct an suGeneralizedForces object for recording the joint torques of a model's generalized coodinates during a simulation.

virtual ~suGeneralizedForces ()
 Destructor.

void setStorageCapacityIncrements (int aIncrement)
 Set the capacity increments of all storage instances.

rdStoragegetGravGenForcesStorage ()
 Get the storage for the gravity generalized forces.

rdStoragegetVelGenForcesStorage ()
 Get the storage for the velocity generalized forces.

rdStoragegetActuatorGenForcesStorage ()
 Get the storage for the actuator generalized forces.

rdStoragegetContactGenForcesStorage ()
 Get the storage for the contact generalized forces.

virtual int begin (int aStep, double aDT, double aT, double *aX, double *aY, void *aClientData=NULL)
 This method is called at the beginning of an analysis so that any necessary initializations may be performed.

virtual int analyze (double *aXPrev, double *aYPrev, int aStep, double aDT, double aT, double *aX, double *aY, void *aClientData=NULL)
 This method is called to perform the analysis.

virtual int end (int aStep, double aDT, double aT, double *aX, double *aY, void *aClientData=NULL)
 This method is called at the end of an analysis so that any necessary finalizations may be performed.

virtual int printResults (char *aBaseName, char *aDir=NULL, double aDT=-1.0, char *aExtension=".sto")
 Print results.


Protected Member Functions

virtual int record (double aT, double *aX, double *aY)
 Record the joint torques.


Protected Attributes

double * _dqdt
double * _dudt
double * _zero_aY
double * _gravGenForces
double * _velGenForces
double * _actuatorGenForces
double * _contactGenForces
rdStorage_gravGenForcesStore
rdStorage_velGenForcesStore
rdStorage_actuatorGenForcesStore
rdStorage_contactGenForcesStore

Private Member Functions

void constructDescription ()
 Construct the description for the joint torque files.

void constructColumnLabels ()
 Construct the column labels for the kinematics files.

void allocateStorage ()
 Allocate storage for the kinematics.

void deleteStorage ()
 Delete storage objects.


Detailed Description

A class for recording the joint torques of the generalized coordinates of a model during a simulation.

Author:
Frank C. Anderson & Saryn Goldberg
Version:
1.0


Constructor & Destructor Documentation

suGeneralizedForces::suGeneralizedForces rdModel aModel  ) 
 

Construct an suGeneralizedForces object for recording the joint torques of a model's generalized coodinates during a simulation.

Parameters:
aModel Model for which the joint torques are to be recorded.


Member Function Documentation

int suGeneralizedForces::analyze double *  aXPrev,
double *  aYPrev,
int  aStep,
double  aDT,
double  aT,
double *  aX,
double *  aY,
void *  aClientData = NULL
[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 in rdModel::integStepCallback(), which has the same argument list.

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:
aXPrev Controls at the beginining of the current time step.
aYPrev States at the beginning of the current time step.
aStep Step number of the integration.
aDT Size of the time step that was just taken.
aT Current time in the integration.
aX Current control values.
aY Current states.
aClientData General use pointer for sending in client data.
Returns:
-1 on error, 0 otherwise.

Reimplemented from rdAnalysis.

int suGeneralizedForces::begin int  aStep,
double  aDT,
double  aT,
double *  aX,
double *  aY,
void *  aClientData = NULL
[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 in rdModel::integBeginCallback() and has the same argument list.

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:
aStep Step number of the integration.
aDT Size of the time step that will be attempted.
aT Current time in the integration.
aX Current control values.
aY Current states.
aClientData General use pointer for sending in client data.
Returns:
-1 on error, 0 otherwise.

Reimplemented from rdAnalysis.

int suGeneralizedForces::end int  aStep,
double  aDT,
double  aT,
double *  aX,
double *  aY,
void *  aClientData = NULL
[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 in rdModel::integEndCallback() and has the same argument list.

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:
aStep Step number of the integration.
aDT Size of the time step that was just completed.
aT Current time in the integration.
aX Current control values.
aY Current states.
aClientData General use pointer for sending in client data.
Returns:
-1 on error, 0 otherwise.

Reimplemented from rdAnalysis.

rdStorage * suGeneralizedForces::getActuatorGenForcesStorage  ) 
 

Get the storage for the actuator generalized forces.

Returns:
Actuator Generalized Force storage.

rdStorage * suGeneralizedForces::getContactGenForcesStorage  ) 
 

Get the storage for the contact generalized forces.

Returns:
Contact Generalized Force storage.

rdStorage * suGeneralizedForces::getGravGenForcesStorage  ) 
 

Get the storage for the gravity generalized forces.

Returns:
Gravity Generalized Force storage.

rdStorage * suGeneralizedForces::getVelGenForcesStorage  ) 
 

Get the storage for the velocity generalized forces.

Returns:
Velocity Generalized Force storage.

int suGeneralizedForces::printResults char *  aBaseName,
char *  aDir = NULL,
double  aDT = -1.0,
char *  aExtension = ".sto"
[virtual]
 

Print results.

The file names are constructed as aDir + "/" + aBaseName + "_" + ComponentName + aExtension

Parameters:
aDir Directory in which the results reside.
aBaseName Base file name.
aDT Desired time interval between adjacent storage vectors. Linear interpolation is used to print the data out at the desired interval.
aExtension File extension.
Returns:
0 on success, -1 on error.

Reimplemented from rdAnalysis.

void suGeneralizedForces::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.


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