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

suDecomp Class Reference

An abstract base class for supporting the decomposition of contact forces. More...

#include <suDecomp.h>

Inheritance diagram for suDecomp:

rdAnalysis suDecompHardUTWalk suDecompInteg suDecompTaylor List of all members.

Public Member Functions

 suDecomp (rdModel *aModel)
 Construct an decomposition instance for a model.

 suDecomp (rdModel *aModel, char *aBaseName, char *aDir=NULL, char *aExtension=NULL)
 Construct an induced acceleration instance for a model.

virtual ~suDecomp ()
 Destructor.

int getNumComponents ()
 Get the number of components.

int getNumIndependentComponents ()
 Get the number of independent components.

int getNumElements ()
 Get the number of contact elements.

int getLastActuatorIndex ()
 Get the index of the last actuator component.

int getGravityIndex ()
 Get the index of the gravity component.

int getVelocityIndex ()
 Get the index of the velocity component.

int getInertialIndex ()
 Get the index of the inertial component.

int getAllActuatorsIndex ()
 Get the index of the total of all actuator components.

int getAllIndex ()
 Get the index of the total of all components.

void setContactThreshold (double aThreshold)
 Set the force threashold above which contact is assumed to be established.

double getContactThreshold ()
 Get the force threashold above which contact is assumed to be established.

void setUsePresetContactEstablishedSettings (bool aTrueFalse)
 Set whether or not to use preset contact established settings.

bool getUsePresetContactEstablishedSettings () const
 Get whether or not to use preset contact established settings.

void setContactEstablished (int aIndex, bool aTrueFalse)
 Set whether or not contact has been established at a specified contact point.

bool getContactEstablished (int aIndex) const
 Get whether or not contact has been established at a specified contact point.

void setRecordContactPointAccelerations (bool aTrueFalse)
 Determine whether or not contact point accelerations will be recorded.

bool getRecordContactPointAccelerations ()
 Get whether or not the contact points are being recorded.

const char * getComponentName (int aC)
 GET THE NAME OF A COMPONENT.

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

const rdStoragegetDecomposition (int aC) const
 Get the force decomposition for a particular component.

bool getUseNullDecomposition ()
 Get whether or not accelerations are being computed using a NULL decomposition.

virtual void compute (double *aXPrev, double *aYPrev, int aStep, double aDT, double aT, double *aX, double *aY)=0
void sum ()
 Sum the separate components of a force decompositon to get the decomposition due to all actuators and to all components.

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.


Static Public Attributes

const char * ADDON_COMPONENT_NAMES []

Protected Attributes

int _nc
 Number of action components.

int _nic
 Number of independent action components.

int _np
 Number of contact points.

int _cAct
 Index to the last actuator component.

int _cGrav
 Index to the gravity component.

int _cVel
 Index to the velocity component.

int _cIner
 Index to the inertial component.

int _cAllAct
 Index to the all actuators component.

int _cAll
 Index to the all component.

const char ** _cNames
 Array of component names.

double _contactThreshold
 Contact threashold for when to perform a decomposition.

bool _usePresetContactEstablishedSettings
 Flag to indicate whether or not to use preset contact established settings.

bool * _contactEstablished
 Array of flags to indicate whether or not contact has been established at each of the contact pooints.

double * _fContig
 Contiguous memory allocation for the force decomposition results.

double *** _f
 Arrays for storing the current force decomposition.

rdStorage ** _fStore
 Storage objects for storing the time history of the decomposition.

rdStorage ** _cpaStore
 Storage objects for storing the contact point accelerations.

bool _recordContactPointAccelerations
 Flag which indicates whether or not the contact point accelerations are being recorded.


Private Member Functions

void setNull ()
 Set member variables to approprate NULL values.

void initializeNumbers ()
 Initialize numbers of things.

void constructComponentNames ()
 Construct component names.

void constructDescription ()
 Construct a description.

void constructColumnLabels ()
 Construct the column labels.

void allocateElementVectors ()
 Allocate element vectors.

void allocateStoragePointers ()
 Allocate storage pointers for the force decomposition and induced accelerations.

void allocateStorage ()
 Allocate storage for the decomposition.

void deleteStorage ()
 Delete storage objects.

void createNullDecomposition ()
 Create a NULL decomposition.

virtual int readDecomposition (char *aBaseName, char *aDir=NULL, char *aExtension=NULL)
 Read the results of a force decomposition from file.


Private Attributes

bool _useNullDecomposition
 Flag which indicates whether or not the decomposition is NULL.


Detailed Description

An abstract base class for supporting the decomposition of contact forces.

Author:
Frank C. Anderson
Version:
1.0


Constructor & Destructor Documentation

suDecomp::suDecomp rdModel aModel  ) 
 

Construct an decomposition instance for a model.

This constructor is used if the decomposition analysis is going to be performed during the course of a simulation.

Parameters:
aModel Model on which the analyses are to be performed.

suDecomp::suDecomp rdModel aModel,
char *  aBaseName,
char *  aDir = NULL,
char *  aExtension = NULL
 

Construct an induced acceleration instance for a model.

This constructor is used when the analysis is to be performed following a simulation. The states recorded during the simulation as well as an appropriate force decomposition must be used to construct the induced acceleration instance. The induced accelerations are not read in from file. They are recomputed based on the force decomposition.

If NULL is sent in as the base name for the force decomposition files, it is assumed that induced accelerations are to be computed based on a NULL decomposition. A NULL decomposition is one in which all induced contact forces are assmed to be zero: each actuator accelerates the model in a pure sense, without its associated reaction forces.

Parameters:
aModel Model on which the simulation was run.
aStates Set of model states.
aBaseName Base name for the force decompositon files. If NULL, accelerations are computed based on a NULL decompostion.
aDir Directory in which the results reside.
aExtension File extension of the force decomposition files.


Member Function Documentation

int suDecomp::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 suDecomp::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.

Reimplemented in suDecompTaylor.

int suDecomp::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.

bool suDecomp::getContactEstablished int  aIndex  )  const
 

Get whether or not contact has been established at a specified contact point.

Parameters:
aIndex Index of the contact point: 0 <= aIndex < rdModel::getNP().
Returns:
True if contact has been established; false if not or on an error.
See also:
setUsePresetContactEstablished()

double suDecomp::getContactThreshold  ) 
 

Get the force threashold above which contact is assumed to be established.

Returns:
Force threashold above which contact is established.

const rdStorage * suDecomp::getDecomposition int  aC  )  const
 

Get the force decomposition for a particular component.

Returns:
Pointer to the force decomposition for component aC.

bool suDecomp::getRecordContactPointAccelerations  ) 
 

Get whether or not the contact points are being recorded.

Returns:
bool

bool suDecomp::getUseNullDecomposition  ) 
 

Get whether or not accelerations are being computed using a NULL decomposition.

A NULL decomposition is one in which all induced contact forces are assumed to be zero.

The value returned by this method can be used to decide whether or not it is necessary to apply contact forces.

Returns:
True when a NULL decomposition is used, false otherwise.

bool suDecomp::getUsePresetContactEstablishedSettings  )  const
 

Get whether or not to use preset contact established settings.

If this flag is set to true, computation of contact forces is not performed in order to determine if contact has been established. Rather, it is assumed that the caller has preset the desired contact-established settings.

Returns:
True if preset contact established settings are used in the decomposition. False if contact forces are computed to determine if contact has been established.
See also:
setContactEstablished()

int suDecomp::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.
aExtension File extension.
Returns:
0 on success, -1 on error.

Reimplemented from rdAnalysis.

int suDecomp::readDecomposition char *  aBaseName,
char *  aDir = NULL,
char *  aExtension = NULL
[private, virtual]
 

Read the results of a force decomposition from file.

Note that the induced accelerations are not read in from file. The induced accelerations are recomputed based on the force decomposition.

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

Parameters:
aDir Directory in which the results reside.
aBaseName Base file name of the files.
aExtension File extension.
Returns:
0 on success, -1 on error.

void suDecomp::setContactEstablished int  aIndex,
bool  aTrueFalse
 

Set whether or not contact has been established at a specified contact point.

Parameters:
aIndex Index of the contact point: 0 <= aIndex < rdModel::getNP().
aTrueFalse Wheter or not contact has been established.
See also:
setUsePresetContactEstablished()

void suDecomp::setContactThreshold double  aThreshold  ) 
 

Set the force threashold above which contact is assumed to be established.

Parameters:
aThreashold Force threashold above which contact is established.

void suDecomp::setRecordContactPointAccelerations bool  aTrueFalse  ) 
 

Determine whether or not contact point accelerations will be recorded.

If set to true, space is allocated to store them.

Parameters:
aTrueFalse 

void suDecomp::setStorageCapacityIncrements int  aIncrement  )  [virtual]
 

Set the capacity increments of all storage instances.

Parameters:
aIncrement Increment by which storage capacities will be increased when storage capcities run out.

void suDecomp::setUsePresetContactEstablishedSettings bool  aTrueFalse  ) 
 

Set whether or not to use preset contact established settings.

If this flag is set to true, computation of contact forces is not performed in order to determine if contact has been established. Rather, it is assumed that the caller has preset the desired contact-established settings.

Parameters:
aTrueFalse If true, preset contact established settings are used in the decomposition. If false, contact forces are computed to determine if contact has been established.
See also:
setContactEstablished()


Member Data Documentation

bool suDecomp::_useNullDecomposition [private]
 

Flag which indicates whether or not the decomposition is NULL.

A NULL decomposition means no decompostion- all induced contact forces zero.

bool suDecomp::_usePresetContactEstablishedSettings [protected]
 

Flag to indicate whether or not to use preset contact established settings.

If this flag is set to true, computation of contact forces is not performed in order to determine if contact has been established. Rather, it is assumed that the caller has preset the desired contact-established settings.

const char * suDecomp::ADDON_COMPONENT_NAMES [static]
 

Initial value:

 {
   "Gravity","Velocity","Inertial","Actuators","All"
}


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