19 #ifndef _SPRING_DAMPER_H_
20 #define _SPRING_DAMPER_H_
22 #include "mbsim/links/frame_link.h"
23 #include "mbsim/functions/function.h"
25 #include "mbsim/utils/boost_parameters.h"
26 #include "mbsim/utils/openmbv_utils.h"
38 std::shared_ptr<OpenMBV::CoilSpring> coilspringOpenMBV;
48 std::string
getType()
const {
return "SpringDamper"; }
59 func->setParent(
this);
67 void initializeUsingXML(xercesc::DOMElement *element);
70 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVCoilSpring, tag, (optional (numberOfCoils,(
int),3)(springRadius,(
double),1)(crossSectionRadius,(
double),-1)(nominalLength,(
double),-1)(type,(OpenMBV::CoilSpring::Type),OpenMBV::CoilSpring::tube)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1))) {
71 OpenMBVCoilSpring ombv(springRadius,crossSectionRadius,1,numberOfCoils,nominalLength,type,diffuseColor,transparency,minimalColorValue,maximalColorValue);
72 coilspringOpenMBV=ombv.createOpenMBV();
bool gActiveChanged()
Definition: spring_damper.h:46
void setUnloadedLength(double l0_)
Set unloaded length.
Definition: spring_damper.h:64
Definition: openmbv_utils.h:147
void setForceFunction(Function< double(double, double)> *func_)
Set function for the force calculation. The first input parameter to that function is the distance re...
Definition: spring_damper.h:57
InitStage
The stages of the initialization.
Definition: element.h:97
BOOST_PARAMETER_MEMBER_FUNCTION((void), enableOpenMBVCoilSpring, tag,(optional(numberOfCoils,(int), 3)(springRadius,(double), 1)(crossSectionRadius,(double),-1)(nominalLength,(double),-1)(type,(OpenMBV::CoilSpring::Type), OpenMBV::CoilSpring::tube)(diffuseColor,(const fmatvec::Vec3 &),"[-1;1;1]")(transparency,(double), 0)(minimalColorValue,(double), 0)(maximalColorValue,(double), 1)))
Visualise the SpringDamper using a OpenMBV::CoilSpring.
Definition: spring_damper.h:70
std::string name
name of element
Definition: element.h:298
bool isActive() const
Definition: spring_damper.h:45
void plot()
plots time dependent data
Definition: spring_damper.cc:69
frame link
Definition: frame_link.h:42
std::string getType() const
Definition: spring_damper.h:48
bool isSingleValued() const
asks the link if it contains single valued force laws that contribute to the right-hand side vector h...
Definition: spring_damper.h:47
void setName(const std::string &str)
Definition: element.h:163
void init(InitStage stage)
plots time series header
Definition: spring_damper.cc:50
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.
Definition: spring_damper.h:34