MBSim |
Project Page |
A spring damper force law. More...
#include <spring_damper.h>
Public Member Functions | |
| DirectionalSpringDamper (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 (fmatvec::Function< double(double, double)> *func_) |
| Set function for the force calculation. | |
| void | setForceDirection (const fmatvec::Vec3 &dir) |
| void | plot (double t, double dt=1) |
| plots time dependent data | |
| void | initializeUsingXML (xercesc::DOMElement *element) |
Protected Attributes | |
| double | dist |
|
fmatvec::Function< double(double, double)> * | func |
| Frame * | refFrame |
| fmatvec::Vec3 | forceDir |
| fmatvec::Vec3 | WforceDir |
| fmatvec::Vec3 | WrP0P1 |
| Frame | C |
Private Attributes | |
| std::string | saved_ref1 |
| std::string | saved_ref2 |
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::DirectionalSpringDamper::gActiveChanged | ( | ) | [inline, virtual] |
Implements MBSim::Link.
| std::string MBSim::DirectionalSpringDamper::getType | ( | ) | const [inline, virtual] |
Reimplemented from MBSim::LinkMechanics.
| void MBSim::DirectionalSpringDamper::init | ( | InitStage | stage | ) | [virtual] |
| bool MBSim::DirectionalSpringDamper::isActive | ( | ) | const [inline, virtual] |
Implements MBSim::Link.
| bool MBSim::DirectionalSpringDamper::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::DirectionalSpringDamper::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::DirectionalSpringDamper::setForceDirection | ( | const fmatvec::Vec3 & | dir | ) | [inline] |
| local | force direction represented in first frame |
| void MBSim::DirectionalSpringDamper::setForceFunction | ( | fmatvec::Function< 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.
1.8.0