| MULTIBODY SIMULATION SOFTWARE - API documentation |
#include <CHlinkEngine.h>


Public Types | |
| enum | eCh_eng_mode { ENG_MODE_ROTATION = 0, ENG_MODE_SPEED, ENG_MODE_TORQUE, ENG_MODE_KEY_ROTATION, ENG_MODE_KEY_POLAR, ENG_MODE_TO_POWERTRAIN_SHAFT } |
| enum | eCh_shaft_mode { ENG_SHAFT_LOCK = 0, ENG_SHAFT_PRISM, ENG_SHAFT_OLDHAM, ENG_SHAFT_UNIVERSAL, ENG_SHAFT_CARDANO } |
Public Member Functions | |
| virtual void | Copy (ChLinkEngine *source) |
| virtual ChLink * | new_Duplicate () |
| virtual void | UpdateTime (double mytime) |
| virtual void | UpdateForces (double mytime) |
| virtual void | UpdatedExternalTime (double prevtime, double time) |
| virtual void | SetMarker1 (ChMarker *mark1) |
| virtual void | SetMarker2 (ChMarker *mark2) |
| ChFunction * | Get_rot_funct () |
| void | Set_rot_funct (ChFunction *m_funct) |
| ChFunction * | Get_spe_funct () |
| void | Set_spe_funct (ChFunction *m_funct) |
| ChFunction * | Get_tor_funct () |
| void | Set_tor_funct (ChFunction *m_funct) |
| ChFunction * | Get_torque_w_funct () |
| void | Set_torque_w_funct (ChFunction *m_funct) |
| ChFunction * | Get_rot_funct_x () |
| void | Set_rot_funct_x (ChFunction *m_funct) |
| ChFunction * | Get_rot_funct_y () |
| void | Set_rot_funct_y (ChFunction *m_funct) |
| Quaternion | GetKeyedPolarRotation () |
| void | SetKeyedPolarRotation (Quaternion mq) |
| int | Get_learn () |
| void | Set_learn (int mset) |
| int | Get_impose_reducer () |
| void | Set_impose_reducer (int mset) |
| int | Get_eng_mode () |
| void | Set_eng_mode (int mset) |
| int | Get_shaft_mode () |
| void | Set_shaft_mode (int mset) |
| double | Get_mot_rot () |
| double | Get_mot_rot_dt () |
| double | Get_mot_rot_dtdt () |
| double | Get_mot_torque () |
| double | Get_mot_rerot () |
| double | Get_mot_rerot_dt () |
| double | Get_mot_rerot_dtdt () |
| double | Get_mot_retorque () |
| void | Set_mot_tau (double mtau) |
| double | Get_mot_tau () |
| void | Set_mot_eta (double meta) |
| double | Get_mot_eta () |
| void | Set_mot_inertia (double min) |
| double | Get_mot_inertia () |
| ChShaft * | GetInnerShaft1 () |
| ChShaft * | GetInnerShaft2 () |
| double | GetInnerTorque1 () |
| double | GetInnerTorque2 () |
| virtual void | InjectConstraints (ChLcpSystemDescriptor &mdescriptor) |
| virtual void | ConstraintsBiReset () |
| virtual void | ConstraintsBiLoad_C (double factor=1., double recovery_clamp=0.1, bool do_clamp=false) |
| virtual void | ConstraintsBiLoad_Ct (double factor=1.) |
| virtual void | ConstraintsLoadJacobians () |
| virtual void | ConstraintsLiLoadSuggestedSpeedSolution () |
| virtual void | ConstraintsLiLoadSuggestedPositionSolution () |
| virtual void | ConstraintsLiFetchSuggestedSpeedSolution () |
| virtual void | ConstraintsLiFetchSuggestedPositionSolution () |
| virtual void | ConstraintsFetch_react (double factor=1.) |
| virtual void | InjectVariables (ChLcpSystemDescriptor &mdescriptor) |
| virtual void | VariablesFbReset () |
| virtual void | VariablesFbLoadForces (double factor=1.) |
| virtual void | VariablesQbLoadSpeed () |
| virtual void | VariablesQbSetSpeed (double step=0.) |
| virtual void | VariablesQbIncrementPosition (double step) |
| virtual void | StreamIN (ChStreamInBinary &mstream) |
| virtual void | StreamOUT (ChStreamOutBinary &mstream) |
Protected Attributes | |
| ChFunction * | rot_funct |
| ChFunction * | spe_funct |
| ChFunction * | tor_funct |
| ChFunction * | torque_w |
| int | learn |
| int | impose_reducer |
| double | mot_rot |
| double | mot_rot_dt |
| double | mot_rot_dtdt |
| double | mot_torque |
| double | mot_rerot |
| double | mot_rerot_dt |
| double | mot_rerot_dtdt |
| double | mot_retorque |
| double | mot_tau |
| double | mot_eta |
| double | mot_inertia |
| int | eng_mode |
| int | shaft_mode |
| ChFunction * | rot_funct_x |
| ChFunction * | rot_funct_y |
| double | last_r3time |
| double | last_r3mot_rot |
| double | last_r3mot_rot_dt |
| Quaternion | last_r3relm_rot |
| Quaternion | last_r3relm_rot_dt |
| Quaternion | keyed_polar_rotation |
| ChShaft | innershaft1 |
| ChShaft | innershaft2 |
| ChLcpConstraintTwoGeneric | innerconstraint1 |
| ChLcpConstraintTwoGeneric | innerconstraint2 |
| double | cache_li_speed1 |
| double | cache_li_pos1 |
| double | torque_react1 |
| double | cache_li_speed2 |
| double | cache_li_pos2 |
| double | torque_react2 |
Class for links representing engines between two rigid bodies. Note that the engine can be in 'impose relative rotation' mode, as well as in 'impose speed' etc. It can also be used to represent an engine with a torque/speed custom curve. etc.
| void chrono::ChLinkEngine::ConstraintsBiLoad_C | ( | double | factor = 1., |
| double | recovery_clamp = 0.1, |
||
| bool | do_clamp = false |
||
| ) | [virtual] |
Adds the current C (constraint violation) to the known term (b_i) of encapsulated ChLcpConstraints
Reimplemented from chrono::ChLinkLock.
| void chrono::ChLinkEngine::ConstraintsBiLoad_Ct | ( | double | factor = 1. | ) | [virtual] |
Adds the current Ct (partial t-derivative, as in C_dt=0-> [Cq]*q_dt=-Ct) to the known term (b_i) of encapsulated ChLcpConstraints
Reimplemented from chrono::ChLinkLock.
| void chrono::ChLinkEngine::ConstraintsFetch_react | ( | double | factor = 1. | ) | [virtual] |
Fetches the reactions from the lagrangian multiplier (l_i) of encapsulated ChLcpConstraints. Mostly used after the LCP provided the solution in ChLcpConstraints. Also, should convert the reactions obtained from dynamical simulation, from link space to intuitive react_force and react_torque.
Reimplemented from chrono::ChLinkLock.
| void chrono::ChLinkEngine::ConstraintsLiFetchSuggestedSpeedSolution | ( | ) | [virtual] |
After the LCP solver has found the l_i lagangian multipliers for the SPEED problem, this function will be called to store the solutions in a cache (to be implemented in ChLink sub classes) so that it can be later retrieved with ConstraintsLiLoadSuggestedSpeedSolution(). If you do not plan to implement a l_i cache, just do not override this function in child classes and do nothing.
Reimplemented from chrono::ChLinkMasked.
| void chrono::ChLinkEngine::ConstraintsLiLoadSuggestedSpeedSolution | ( | ) | [virtual] |
Fills the solution of the constraint (the lagrangian multiplier l_i) with an initial guess, if any. This can be used for warm-starting the LCP solver before starting the solution of the SPEED problem, if some approximate solution of constraint impulese l_i already exist (ex. cached from a previous LCP execution) When implementing this in sub classes, if no guess is available, set l_i as 0.
Reimplemented from chrono::ChLinkMasked.
| void chrono::ChLinkEngine::InjectConstraints | ( | ChLcpSystemDescriptor & | mdescriptor | ) | [virtual] |
LCP SYSTEM FUNCTIONS
Reimplemented from chrono::ChLinkLock.
| void chrono::ChLinkEngine::InjectVariables | ( | ChLcpSystemDescriptor & | mdescriptor | ) | [virtual] |
Tell to a system descriptor that there are variables of type ChLcpVariables in this object (for further passing it to a LCP solver) Basically does nothing, but maybe that inherited classes may specialize this.
Reimplemented from chrono::ChPhysicsItem.
| void chrono::ChLinkEngine::StreamIN | ( | ChStreamInBinary & | mstream | ) | [virtual] |
Method to allow deserializing a persistent binary archive (ex: a file) into transient data.
Reimplemented from chrono::ChLinkLock.
| void chrono::ChLinkEngine::StreamOUT | ( | ChStreamOutBinary & | mstream | ) | [virtual] |
Method to allow serializing transient data into a persistent binary archive (ex: a file).
Reimplemented from chrono::ChLinkLock.
| void chrono::ChLinkEngine::UpdatedExternalTime | ( | double | prevtime, |
| double | time | ||
| ) | [virtual] |
Called from a foreign software (i.e. a plugin, a CAD appl.), if any, to report that time has changed. Most often you can leave this unimplemented.
Reimplemented from chrono::ChLink.
| void chrono::ChLinkEngine::UpdateForces | ( | double | mytime | ) | [virtual] |
Inherits, and updates the C_force and C_torque 'intuitive' forces, adding the effects of the contained ChLinkForce objects. (Default: inherits parent UpdateForces(), then C_force and C_torque are incremented with the Link::ChLinkForces objects)
Reimplemented from chrono::ChLinkLock.
| void chrono::ChLinkEngine::UpdateTime | ( | double | time | ) | [virtual] |
UPDATING PROCEDURES
Reimplemented from chrono::ChLinkLock.
| void chrono::ChLinkEngine::VariablesFbLoadForces | ( | double | factor = 1. | ) | [virtual] |
Adds the current forces (applied to item) into the encapsulated ChLcpVariables, in the 'fb' part: qf+=forces*factor
Reimplemented from chrono::ChPhysicsItem.
| void chrono::ChLinkEngine::VariablesQbIncrementPosition | ( | double | step | ) | [virtual] |
Increment item positions by the 'qb' part of the ChLcpVariables, multiplied by a 'step' factor. pos+=qb*step If qb is a speed, this behaves like a single step of 1-st order numerical integration (Eulero integration).
Reimplemented from chrono::ChPhysicsItem.
| void chrono::ChLinkEngine::VariablesQbLoadSpeed | ( | ) | [virtual] |
Initialize the 'qb' part of the ChLcpVariables with the current value of speeds. Note: since 'qb' is the unknown of the LCP, this function sems unuseful, however the LCP solver has an option 'add_Mq_to_f', that takes [M]*qb and add to the 'fb' term before starting (this is often needed in the Anitescu time stepping method, for instance); this explains the need of this method..
Reimplemented from chrono::ChPhysicsItem.
| void chrono::ChLinkEngine::VariablesQbSetSpeed | ( | double | step = 0. | ) | [virtual] |
Fetches the item speed (ex. linear and angular vel.in rigid bodies) from the 'qb' part of the ChLcpVariables and sets it as the current item speed. If 'step' is not 0, also should compute the approximate acceleration of the item using backward differences, that is accel=(new_speed-old_speed)/step. Mostly used after the LCP provided the solution in ChLcpVariables.
Reimplemented from chrono::ChPhysicsItem.
CHRONO::ENGINE