MBSim |
Project Page |
A spring damper force law. More...
#include <spring_damper.h>
Public Member Functions | |
| SpringDamper (const std::string &name="") | |
| void | updateh (double, int i=0) |
| void | updateg (double) |
| void | updategd (double) |
| void | connect (Frame *frame1, Frame *frame2) |
| Connect the SpringDamper to frame1 and frame2. | |
| bool | isActive () const |
| bool | gActiveChanged () |
| bool | isSingleValued () const |
| asks the link if it contains single valued force laws that contribute to the right-hand side vector h | |
| std::string | getType () const |
| void | init (InitStage stage) |
| plots time series header | |
| void | setForceFunction (Function2< double, double, double > *func_) |
| Set function for the force calculation. | |
| void | setProjectionDirection (Frame *refFrame_, fmatvec::Vec dir) |
| Set a projection direction of the applied force. | |
| void | plot (double t, double dt=1) |
| plots time dependent data | |
| void | initializeUsingXML (MBXMLUtils::TiXmlElement *element) |
Protected Attributes | |
| double | dist |
| fmatvec::Vec3 | n |
|
Function2< double, double, double > * | func |
| Frame * | refFrame |
| fmatvec::Vec3 | forceDir |
| fmatvec::Vec3 | WforceDir |
Private Attributes | |
| std::string | saved_frameOfReference |
| std::string | saved_ref1 |
| std::string | saved_ref2 |
| fmatvec::Vec | saved_direction |
A spring damper force law.
This class connects two frames and applies a force in it, which depends in the distance and relative velocity between the two frames.
| bool MBSim::SpringDamper::gActiveChanged | ( | ) | [inline, virtual] |
Implements MBSim::Link.
| std::string MBSim::SpringDamper::getType | ( | ) | const [inline, virtual] |
Reimplemented from MBSim::LinkMechanics.
| void MBSim::SpringDamper::init | ( | InitStage | stage | ) | [virtual] |
| bool MBSim::SpringDamper::isActive | ( | ) | const [inline, virtual] |
Implements MBSim::Link.
| bool MBSim::SpringDamper::isSingleValued | ( | ) | const [inline, virtual] |
asks the link if it contains single valued force laws that contribute to the right-hand side vector h
Reimplemented from MBSim::Link.
| void MBSim::SpringDamper::plot | ( | double | t, |
| double | dt = 1 |
||
| ) | [virtual] |
plots time dependent data
| simulation | time |
| simulation | time step size for derivative calculation |
Reimplemented from MBSim::LinkMechanics.
| void MBSim::SpringDamper::setForceFunction | ( | Function2< double, double, double > * | func_ | ) | [inline] |
Set function for the force calculation.
The first input parameter to that function is the distance g between frame2 and frame1. The second input parameter to that function is the relative velocity gd between frame2 and frame1. The return value of that function is used as the force of the SpringDamper.
| void MBSim::SpringDamper::setProjectionDirection | ( | Frame * | refFrame_, |
| fmatvec::Vec | dir | ||
| ) | [inline] |
Set a projection direction of the applied force.
If this function is not set, or frame is NULL, than force calculated by setForceFunction is applied on the two connected frames in the direction of the two connected frames. If this function is set, than this force is first projected in direction dir and then applied on the two connected frames in the projected direction; (!) this might induce violation of the global equality of torques (!). The direction vector dir is given in coordinates of frame refFrame.
1.8.0