MBSim

Project Page
Public Member Functions | Protected Attributes | Private Attributes
MBSim::DirectionalSpringDamper Class Reference

A spring damper force law. More...

#include <spring_damper.h>

Inheritance diagram for MBSim::DirectionalSpringDamper:
MBSim::LinkMechanics MBSim::Link MBSim::Element

List of all members.

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

Detailed Description

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.


Member Function Documentation

Returns:
has the relative distance vector changed?

Implements MBSim::Link.

std::string MBSim::DirectionalSpringDamper::getType ( ) const [inline, virtual]
Returns:
std::string representation

Reimplemented from MBSim::LinkMechanics.

plots time series header

Parameters:
invocingparent class

Reimplemented from MBSim::LinkMechanics.

bool MBSim::DirectionalSpringDamper::isActive ( ) const [inline, virtual]
Returns:
are link equations active?

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

Returns:
single valued force laws used within link?

Reimplemented from MBSim::Link.

void MBSim::DirectionalSpringDamper::plot ( double  t,
double  dt = 1 
) [virtual]

plots time dependent data

Parameters:
simulationtime
simulationtime step size for derivative calculation

Reimplemented from MBSim::LinkMechanics.

void MBSim::DirectionalSpringDamper::setForceDirection ( const fmatvec::Vec3 &  dir) [inline]
Parameters:
localforce 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.


The documentation for this class was generated from the following file: