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


Public Member Functions | |
| virtual void | Copy (ChLinkNumdiff *source) |
| virtual ChLink * | new_Duplicate () |
| virtual void | ImposeCoords (ChMatrix<> *mc, double t) |
| virtual void | FetchCoords (ChMatrix<> *mc) |
| virtual void | FetchCoords_dt (ChMatrix<> *mc) |
| virtual void | ComputeC () |
| virtual void | ComputeCt () |
| virtual void | ComputeCq () |
| virtual void | UpdateState () |
| virtual void | StreamIN (ChStreamInBinary &mstream) |
| virtual void | StreamOUT (ChStreamOutBinary &mstream) |
| virtual void | StreamOUT (ChStreamOutAscii &mstream) |
Note that numerical differentiation for computing jacobians might be an easy way to write constraints, but in general it is slower (and less precise) than with custom analytical approaches (that's why the ChLinkLock family is not inherited from this class and prefer to use a custom analytical expression for jacobians).
| void chrono::ChLinkNumdiff::ImposeCoords | ( | ChMatrix<> * | mc, | |
| double | t | |||
| ) | [virtual] |
Forces the system (basically: two connected bodies) into the specified states/times. Used internally by numerical differentiation, when computing numerially the jacobian, by the UpdateState() function. Used by UpdateState() and ComputeK(). Default: the mc matrix is a vector with "Link::GetNumCoords" rows, with the position states (vect1,quat1,vect1,quat2) of Body1 and Body2. Note!! It automatically calls, at the end, the UpdateTime(time) and UpdateRelMarkerCoords() functions!!! Most often, no need to give specific implementations if the q coordinate vector of your constraint equation(s) C(q,t) represents the position of the two bodies Body1 and Body2, and it's enough. But you must override it, if your inherited link' "numcoords" aren't 14, for example if linking 3 bodies, etc -really seldom..-, or body pos & speeds, etc
| void chrono::ChLinkNumdiff::FetchCoords | ( | ChMatrix<> * | mc | ) | [virtual] |
The opposite: returns the current state into the vector mc, which has number of rows = "GetNumCoords()" (def. 14)
| void chrono::ChLinkNumdiff::FetchCoords_dt | ( | ChMatrix<> * | mc | ) | [virtual] |
Same, but returns the _time_derivative_ of current state (the speeds).
| void chrono::ChLinkNumdiff::ComputeC | ( | ) | [virtual] |
>>>> IMPORTANT FUNCTION<<<< Given current time and coordinate state, computes the residual vect. of the constraint equations C. C = C(q,t) NOTE!! If your class inherits from this class, often this is the ONLY function you _must_ provide, together with GetDOC(), because the base UpdateState() will automatically compute the jacobians matrix etc. via numerical differentiation (Default: C = 0, no particular constraint)
UPDATING PROCEDURES
| void chrono::ChLinkNumdiff::ComputeCt | ( | ) | [virtual] |
Used mostly internally by UpdateState(), to compute Ct term and and Cq1, Cq2 jacobian matrices at current (q,t), by numerical differentiation. However, you may override one of these if you know some fast custom analytical expression - otherwise leave these as they are, and the numerical differentiation will do the rest.
| void chrono::ChLinkNumdiff::UpdateState | ( | ) | [virtual] |
This is expected to update the values in C, C_dt, C_dtdt, in jacobians Cq1 and Cq2, in Qc and in Ct. By default, this does NOTHING, so it is up to the inherited classes to fill these vectors/matrices depending on how they describe the constraint equations.
Reimplemented from chrono::ChLinkMasked.
| void chrono::ChLinkNumdiff::StreamIN | ( | ChStreamInBinary & | mstream | ) | [virtual] |
Method to allow deserializing a persistent binary archive (ex: a file) into transient data.
Reimplemented from chrono::ChLinkMasked.
| void chrono::ChLinkNumdiff::StreamOUT | ( | ChStreamOutBinary & | mstream | ) | [virtual] |
Method to allow serializing transient data into a persistent binary archive (ex: a file).
Reimplemented from chrono::ChLinkMasked.
| virtual void chrono::ChLinkNumdiff::StreamOUT | ( | ChStreamOutAscii & | mstream | ) | [virtual] |
Method to allow serialization of transient data in ascii, as a readable item, for example "chrono::GetLog() << myobject;"
Reimplemented from chrono::ChLinkMasked.
CHRONO::ENGINE