Class containing a 3dof mass simObjec without gravity.
More...
#include <CMass.h>
|
|
| CMass (std::string sSimObjectName, ISimObjectCreator *pCreator) |
| | The constructor sets the pointer to the output object and the parser object.
|
| |
| virtual void | OdeFcn (const double dT, const double *const adX, double *const adXDot) const |
| | Calculates the state derivatives.
|
| |
|
| CMass (std::string sSimObjectName, ISimObjectCreator *pCreator) |
| | The constructor sets the pointer to the output object and the parser object.
|
| |
| virtual void | OdeFcn (const double dT, const double *const adX, double *const adXDot) const |
| | Calculates the state derivatives.
|
| |
|
virtual bool | HasJacobians () const override |
| |
|
virtual void | OdeJacobian (double T, const double *X, double *J, int nStates) override |
| |
|
virtual int | GetJacobianSparsity (int nStates, int *rowPtr, int *colIdx) override |
| |
|
virtual bool | HasPortJacobians () const override |
| |
|
virtual void | OutputPortJacobian (const std::string &portName, double T, const double *X, double *dPort_dX, int portSize, int nStates, int index=-1) override |
| |
|
virtual void | InputPortJacobian (const std::string &portName, double T, const double *X, double *dF_dInput, int portSize, int nStates) override |
| |
|
| virtual const double * | Position (const double dT, const double *const adX) |
| | Returns the current position state.
|
| |
| virtual const double * | Velocity (const double dT, const double *const adX) |
| | Returns the current velocity state.
|
| |
|
virtual const double * | Position (const double dT, const double *const adX) |
| |
|
virtual const double * | Velocity (const double dT, const double *const adX) |
| |
| int | LocalIndex (int globalStateIndex) const |
| |
|
|
double | m_dMass |
| | The mass of the object.
|
| |
|
double | m_dg |
| | The acceleration of gravity.
|
| |
|
ISignalPort * | m_pInForce |
| | A pointer to the input force.
|
| |
| int | m_IStatePos |
| | The index of the position state.
|
| |
| int | m_IStateVel |
| | The index of the velocity state.
|
| |
- Author
- Karl-Johan Reite
- Examples
- CMass.h.
◆ LocalIndex()
| int CMass::LocalIndex |
( |
int |
globalStateIndex | ) |
const |
|
inlineprotected |
Turns a model-global state index into one local to this SimObject.
OdeFcn and the port functions are handed the whole model's state vector, so they use the global indices above directly. The Jacobian callbacks are handed this object's own slice, whose first element is the first state it registered (Pos), so every index they use goes through this function (BASE-0021).
◆ OdeFcn() [1/2]
| virtual void CMass::OdeFcn |
( |
const double |
dT, |
|
|
const double *const |
adX, |
|
|
double *const |
adXDot |
|
) |
| const |
|
virtual |
◆ OdeFcn() [2/2]
| virtual void CMass::OdeFcn |
( |
const double |
dT, |
|
|
const double *const |
adX, |
|
|
double *const |
adXDot |
|
) |
| const |
|
virtual |
◆ Position()
| virtual const double * CMass::Position |
( |
const double |
dT, |
|
|
const double *const |
adX |
|
) |
| |
|
protectedvirtual |
- Parameters
-
| dT | Current time. |
| adX | Current state vector. |
- Returns
- Pointer to the position component of the state.
- Examples
- CMass.cpp, and CMass.h.
◆ Velocity()
| virtual const double * CMass::Velocity |
( |
const double |
dT, |
|
|
const double *const |
adX |
|
) |
| |
|
protectedvirtual |
- Parameters
-
| dT | Current time. |
| adX | Current state vector. |
- Returns
- Pointer to the velocity component of the state.
- Examples
- CMass.cpp, and CMass.h.
◆ m_IStatePos
The model-global index of the position state, as AddState returned it.
- Examples
- CMass.cpp, and CMass.h.
◆ m_IStateVel
The model-global index of the velocity state, as AddState returned it.
- Examples
- CMass.cpp, and CMass.h.
The documentation for this class was generated from the following files:
- webfhsim/reloadrepos/fhsim/doc/user/examples/CMass.h
- webfhsim/reloadrepos/fhsim_base/src/body/CMass.h