#include <rdContactForceSet.h>
Inheritance diagram for rdContactForceSet:

Public Member Functions | |
| rdContactForceSet () | |
| Default constructor. | |
| rdContactForceSet (const char *aFileName) | |
| Construct an actuator from file. | |
| virtual | ~rdContactForceSet () |
| Destructor. | |
| void | setModel (rdModel *aModel) |
| Set the model for which actuation is provided. | |
| rdModel * | getModel () |
| Get a pointer to the model which is actuated. | |
| rdContactForce * | setContactForce (rdContactForce *aContact) |
| Set the contact object at the first empty index. | |
| rdContactForce * | setContactForce (int aIndex, rdContactForce *aContact) |
| Set the actuator at an index. | |
| rdContactForce * | getContactForce (int aIndex) const |
| Get the actuator at an index. | |
| int | getNYP () |
| Get the total number of actuator pseudostates. | |
| int | getPseudoStatesIndex (int aWhichActuator) |
| Get the index for the pseudostates array for a particular contact. | |
| void | setPseudoStates (const double aY[]) |
| Set the pseudostates for all contacts in the model. | |
| void | getPseudoStates (double rY[]) |
| Get the pseudostates for all contacts in the model. | |
| void | computeContact () |
| For each contact, compute all necessary quantities. | |
| void | updatePseudoStates () |
| Update the pseudostates of all contact forces. | |
| void | apply () |
| For each contact, apply the force(s) (or torque(s)) to the model. | |
| bool | check () const |
| Check that all contacts are valid. | |
| void | updateObject (bool aDeep=true) |
| Update this object based on its XML node. | |
| void | updateNode (bool aDeep=true) |
| Update the XML node representing this object. | |
| void | generateNode (IDOM_Element *aParent) |
| Generate an XML node representing this object. | |
Static Public Member Functions | |
| void | RegisterType (const rdContactForce &aContact) |
| Register a supported contact force type. | |
Protected Attributes | |
| rdPtrArray | _defaultContactForces |
| Expandable array of default contact force objects. | |
| rdModel * | _model |
| Model on which the contact forces act. | |
| int | _nyp |
| Number of pseudostates. | |
| int * | _pseudoIndex |
| Pseudostates index. | |
Private Member Functions | |
| void | setNull () |
| Set the data members of this actuator to their null values. | |
| void | constructPseudoStatesIndex () |
| Construct the pseudostates index. | |
| void | constructDefaultContacts () |
| Construct the default contact forces. | |
Static Private Attributes | |
| rdPtrArray | _ContactForceTypes |
| Expandable array of supported contact force types. | |
A contact is distinguished from a general actuator in that it has no states and no controls. However, a contact can have pseudostates (variables that are not only a function of the states, but also of the time history of the states).
|
|
Construct an actuator from file.
|
|
|
Generate an XML node representing this object.
Reimplemented from rdObject. |
|
|
Get the actuator at an index.
|
|
|
Get a pointer to the model which is actuated.
|
|
|
Get the total number of actuator pseudostates.
|
|
|
Get the pseudostates for all contacts in the model. See getPseudoStatesIndex() for a description of the assumed layout of the pseudostates array.
|
|
|
Get the index for the pseudostates array for a particular contact. The pseudostates that characterize all the contact forces of a model are held by the model in an array of values. The convention used by rdContactSet is that the pseudostates for an actuator are held in this array sequentially: PseudoStatesArray Act Act State yp[ictx+0] 0 0 yp[ictx+1] 0 1 yp[ictx+2] 0 2 yp[ictx+3] 1 0 yp[ictx+4] 3 0 yp[ictx+5] 3 1 ... ... ... Notice that not all contacts need have the same number of pseudostates. In the above example, contact 0 has 3 pseudostates, contact 1 has 1 pseudostate, contact 2 has 0 pseudostates, and contact 3 has 2 pseudostates. Note also that it is assumed that the indeces are computed as though the contact pseudostates start at the beginning of the pseudostates array. In actuality the contact pseudostates may start in the middle of some larger array. The index ictx above indexes where in the pseudostate array yp the contact pseudostates begin. It should be apparent to the caller what this number is and should account for as necessary. This method returns the array index that marks the beginning of the pseudostates for a particular contact. In the event the contact has no pseudostates, -1 is returned. For the above example, the following values of aWhich would produce the following return values: aWhich Return 0 0 1 3 2 -1 3 4
|
|
|
Register a supported contact force type. Any contact type that is supported can be written to and read from an XML file. The contact force must have implemented the following methods to be supported: 1) copy constructor (e.g., rdSpring::rdSpring(const rdSpring &aSpring)) 2) virtual rdContactForce* copy() const, 3) virtual rdContactForce* copy(IDOM_Element*) const, 4) rdContactForce& operator=() (!! with the appropriate return type), 5) virtual void updateObject(bool aDeep=true), 6) virtual void updateNode(bool aDeep=true), and 7) virtual void generateNode(IDOM_Element *aParent). Because this method is static, registration of contact types needs to be done only once per process and an rdContactForceSet does not need to be instantiated to do so. This method makes a copy of the specified contact, so the caller may continue to use the spacified contact force (aContactForce) for whatever purpose.
|
|
||||||||||||
|
Set the actuator at an index. Sending in NULL for the rdContactForce pointer essentially removes the actuator at aIndex from the array of actuators. Note however that the caller is responsible for deleting any actuators that are removed from this list in this way. For this reason, the actuator pointer previously held at aIndex is returned by this method. It is also permissible to send in any positive value for aIndex, and there can be gaps in the array of actuators. However, it is advisible to use setContacts(rdContactForce*) when adding an actutor so the array of actuators remains contiguous.
|
|
|
Set the contact object at the first empty index. This method should always return NULL. If it does not return NULL, it means that a contact object was already stored at what was thought to be the first empty location.
|
|
|
Set the model for which actuation is provided.
|
|
|
Set the pseudostates for all contacts in the model. See getPseudoStatesIndex() for a description of the assumed layout of the pseudostates array.
|
|
|
Update this object based on its XML node.
Reimplemented from rdPtrArray. |
|
|
Update the pseudostates of all contact forces. Pseudostates are quantities that are not integrated but that depend on the time history of a simulation (e.g., spring set points). |
1.3