19 #ifndef _DIRECTIONAL_SPRING_DAMPER_H_
20 #define _DIRECTIONAL_SPRING_DAMPER_H_
22 #include "mbsim/links/floating_frame_link.h"
23 #include "mbsim/functions/function.h"
25 #include "mbsim/utils/boost_parameters.h"
26 #include "mbsim/utils/openmbv_utils.h"
39 std::shared_ptr<OpenMBV::CoilSpring> coilspringOpenMBV;
45 void updateGeneralizedPositions();
46 void updateGeneralizedVelocities();
53 std::string
getType()
const {
return "DirectionalSpringDamper"; }
64 func->setParent(
this);
77 void initializeUsingXML(xercesc::DOMElement *element);
79 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))) {
80 OpenMBVCoilSpring ombv(springRadius,crossSectionRadius,1,numberOfCoils,nominalLength,type,diffuseColor,transparency,minimalColorValue,maximalColorValue);
81 coilspringOpenMBV=ombv.createOpenMBV();
std::string getType() const
Definition: directional_spring_damper.h:53
bool gActiveChanged()
Definition: directional_spring_damper.h:51
floating frame link
Definition: floating_frame_link.h:43
void setUnloadedLength(double l0_)
Set unloaded length.
Definition: directional_spring_damper.h:69
Definition: openmbv_utils.h:147
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: directional_spring_damper.h:34
void setForceDirection(const fmatvec::Vec3 &dir)
Definition: directional_spring_damper.h:74
void init(InitStage stage)
plots time series header
Definition: directional_spring_damper.cc:64
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: directional_spring_damper.h:62
void plot()
plots time dependent data
Definition: directional_spring_damper.cc:82
std::vector< Frame * > frame
array in which all frames are listed, connecting bodies via a link
Definition: floating_frame_link.h:165
bool isActive() const
Definition: directional_spring_damper.h:50
fmatvec::Mat3xV forceDir
directions of force and moment in frame of reference
Definition: floating_frame_link.h:153
InitStage
The stages of the initialization.
Definition: element.h:97
bool isSingleValued() const
asks the link if it contains single valued force laws that contribute to the right-hand side vector h...
Definition: directional_spring_damper.h:52
std::string name
name of element
Definition: element.h:298
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:37
void setName(const std::string &str)
Definition: element.h:163