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. More...
#include <spring_damper.h>
Public Member Functions | |
| SpringDamper (const std::string &name="") | |
| void | updatelaF () |
| 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 More... | |
| void | init (InitStage stage, const InitConfigSet &config) |
| plots time series header More... | |
| void | setForceFunction (Function< double(double, double)> *func_) |
| Set function for the force calculation. The first input parameter to that function is the distance relative to the unloaded length. The second input parameter to that function is the relative velocity. The return value of that function is used as the force of the SpringDamper. | |
| void | setUnloadedLength (double l0_) |
| Set unloaded length. | |
| void | plot () |
| plots time dependent data More... | |
| void | initializeUsingXML (xercesc::DOMElement *element) |
| BOOST_PARAMETER_MEMBER_FUNCTION ((void), enableOpenMBV, tag,(optional(numberOfCoils,(int), 3)(springRadius,(double), 1)(crossSectionRadius,(double),-1)(nominalLength,(double),-1)(type,(OpenMBVCoilSpring::Type), OpenMBVCoilSpring::tube)(colorRepresentation,(OpenMBVCoilSpring::ColorRepresentation), OpenMBVCoilSpring::none)(minimalColorValue,(double), 0)(maximalColorValue,(double), 1)(diffuseColor,(const fmatvec::Vec3 &),"[-1;1;1]")(transparency,(double), 0)(pointSize,(double), 0)(lineWidth,(double), 0))) | |
| Visualise the SpringDamper using a OpenMBV::CoilSpring. | |
Public Member Functions inherited from MBSim::FixedFrameLink | |
| FixedFrameLink (const std::string &name) | |
| constructor More... | |
| void | calcSize () override |
| void | updateh (int i=0) override |
| void | updateVelocities () override |
| void | updateGeneralizedPositions () override |
| void | updateGeneralizedVelocities () override |
| void | updateForceDirections () override |
Public Member Functions inherited from MBSim::FrameLink | |
| FrameLink (const std::string &name) | |
| constructor More... | |
| void | connect (Frame *frame0, Frame *frame1) |
| Frame * | getFrame (int i) |
| void | resetUpToDate () override |
| const fmatvec::Mat3xV & | evalGlobalForceDirection () |
| const fmatvec::Mat3xV & | evalGlobalMomentDirection () |
| fmatvec::Mat3xV & | getGlobalForceDirection (bool check=true) |
| fmatvec::Mat3xV & | getGlobalMomentDirection (bool check=true) |
| void | updatePositions () override |
| void | updateForce () override |
| void | updateMoment () override |
| void | updateR () override |
| const fmatvec::Vec3 & | evalGlobalRelativePosition () |
| const fmatvec::SqrMat3 & | evalGlobalRelativeOrientation () |
| const fmatvec::Vec3 & | evalGlobalRelativeVelocity () |
| const fmatvec::Vec3 & | evalGlobalRelativeAngularVelocity () |
| fmatvec::Vec3 & | getGlobalRelativePosition (bool check=true) |
| fmatvec::SqrMat3 & | getGlobalRelativeOrientation (bool check=true) |
| fmatvec::Vec3 & | getGlobalRelativeVelocity (bool check=true) |
| fmatvec::Vec3 & | getGlobalRelativeAngularVelocity (bool check=true) |
| void | updateWRef (const fmatvec::Mat &ref, int i=0) override |
| references to contact force direction matrix of dynamic system parent | |
| void | updateVRef (const fmatvec::Mat &ref, int i=0) override |
| references to condensed contact force direction matrix of dynamic system parent | |
| void | updatehRef (const fmatvec::Vec &hRef, int i=0) override |
| references to complete and link smooth force vector of dynamic system parent | |
| virtual void | updatedhdqRef (const fmatvec::Mat &ref, int i=0) |
| virtual void | updatedhduRef (const fmatvec::SqrMat &ref, int i=0) |
| virtual void | updatedhdtRef (const fmatvec::Vec &ref, int i=0) |
| void | updaterRef (const fmatvec::Vec &ref, int i=0) override |
| references to nonsmooth force vector of dynamic system parent | |
Public Member Functions inherited from MBSim::MechanicalLink | |
| MechanicalLink (const std::string &name) | |
| constructor More... | |
| void | resetUpToDate () override |
| void | updateGeneralizedForces () override |
| virtual void | updatelaM () |
| const fmatvec::Vec3 & | evalForce (int i=1) |
| const fmatvec::Vec3 & | evalMoment (int i=1) |
| const fmatvec::Mat3xV & | evalRF (int i=1) |
| const fmatvec::Mat3xV & | evalRM (int i=1) |
| const fmatvec::VecV & | evallaF () |
| const fmatvec::VecV & | evallaM () |
| Frame * | getPointOfApplication (int i) |
| int | getNumberOfLinks () |
Public Member Functions inherited from MBSim::Link | |
| Link (const std::string &name) | |
| constructor More... | |
| int | getGeneralizedRelativePositionSize () |
| int | getGeneralizedRelativeVelocitySize () |
| int | getGeneralizedForceSize () |
| virtual void | updateg () |
| virtual void | updategd () |
| virtual void | updatewb () |
| virtual void | updateW (int i=0) |
| virtual void | updateV (int i=0) |
| virtual void | updateStopVector () |
| virtual void | updateStopVectorParameters () |
| virtual void | updateLinkStatus () |
| virtual void | updateLinkStatusReg () |
| virtual void | updateJacobians (int j=0) |
| virtual void | updateb () |
| virtual void | updatedx () |
| virtual void | updatexd () |
| virtual void | calcxSize () |
| virtual const fmatvec::Vec & | getx () const |
| virtual fmatvec::Vec & | getx () |
| virtual void | setxInd (int xInd_) |
| virtual int | getxSize () const |
| virtual void | updatexRef (const fmatvec::Vec &ref) |
| virtual void | updatexdRef (const fmatvec::Vec &ref) |
| virtual void | updatedxRef (const fmatvec::Vec &ref) |
| virtual void | updatebRef (const fmatvec::Mat &hRef) |
| virtual void | initz () |
| virtual void | writez (H5::GroupBase *group) |
| virtual void | readz0 (H5::GroupBase *group) |
| virtual void | setbInd (int bInd_) |
| virtual void | updatewbRef (const fmatvec::Vec &ref) |
| references to TODO of dynamic system parent | |
| virtual void | updatelaRef (const fmatvec::Vec &ref) |
| references to contact force parameter of dynamic system parent | |
| virtual void | updateLaRef (const fmatvec::Vec &ref) |
| references to contact force parameter of dynamic system parent | |
| virtual void | deletelaRef () |
| delete reference to contact force parameter of dynamic system parent | |
| virtual void | updategRef (const fmatvec::Vec &ref) |
| references to contact relative distances of dynamic system parent | |
| virtual void | updategdRef (const fmatvec::Vec &ref) |
| references to contact relative velocities of dynamic system parent | |
| virtual void | updateresRef (const fmatvec::Vec &ref) |
| references to residuum of nonlinear contact equations of dynamic system parent | |
| virtual void | updaterFactorRef (const fmatvec::Vec &ref) |
| references to rfactors of dynamic system parent | |
| virtual void | updatesvRef (const fmatvec::Vec &sv) |
| references to stopvector of dynamic system parent (root function for event driven integration) | |
| virtual void | updatejsvRef (const fmatvec::VecInt &jsvParent) |
| references to stopvector evaluation of dynamic system parent (root detection with corresponding bool array by event driven integrator) | |
| virtual void | updateLinkStatusRef (const fmatvec::VecInt &LinkStatusParent) |
| reference to vector of link status (for set valued links with piecewise link equations) | |
| virtual void | updateLinkStatusRegRef (const fmatvec::VecInt &LinkStatusRegParent) |
| reference to vector of link status (for single-valued links) | |
| virtual void | calclaSize (int j) |
| calculates size of contact force parameters | |
| virtual void | calcgSize (int j) |
| calculates size of relative distances | |
| virtual void | calcgdSize (int j) |
| calculates size of gap velocities More... | |
| virtual void | calcrFactorSize (int j) |
| calculates size of rfactors | |
| virtual void | calcbSize () |
| calculates size of rfactors | |
| virtual void | calcsvSize () |
| calculates size of stopvector (root function for event driven integration) | |
| virtual void | calcLinkStatusSize () |
| calculates size of vector LinkStatus | |
| virtual void | calcLinkStatusRegSize () |
| calculates size of vector LinkStatusReg | |
| virtual bool | isSetValued () const |
| asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore set valued More... | |
| virtual bool | detectImpact () |
| virtual void | solveImpactsFixpointSingle () |
| virtual void | solveConstraintsFixpointSingle () |
| virtual void | solveImpactsGaussSeidel () |
| virtual void | solveConstraintsGaussSeidel () |
| virtual void | solveImpactsRootFinding () |
| virtual void | solveConstraintsRootFinding () |
| virtual void | jacobianConstraints () |
| computes JACOBIAN and mass action matrix of nonlinear contact equations | |
| virtual void | jacobianImpacts () |
| computes JACOBIAN and mass action matrix of nonlinear contact equations on velocity level | |
| virtual void | updaterFactors () |
| update relaxation factors for contact equations | |
| virtual void | checkImpactsForTermination () |
| verify underlying force laws on velocity level concerning given tolerances | |
| virtual void | checkConstraintsForTermination () |
| verify underlying force laws concerning given tolerances | |
| virtual void | checkActive (int j) |
| check if set-valued contacts are active and set corresponding attributes More... | |
| virtual double | evalPotentialEnergy () |
| compute potential energy | |
| virtual void | setGeneralizedForceTolerance (double tol) |
| virtual void | setGeneralizedImpulseTolerance (double tol) |
| virtual void | setGeneralizedRelativePositionTolerance (double tol) |
| virtual void | setGeneralizedRelativeVelocityTolerance (double tol) |
| virtual void | setGeneralizedRelativeAccelerationTolerance (double tol) |
| virtual void | setGeneralizedRelativePositionCorrectionValue (double corr) |
| virtual void | setGeneralizedRelativeVelocityCorrectionValue (double corr) |
| virtual void | setrMax (double rMax_) |
| virtual void | setLinkStatusInd (int LinkStatusInd_) |
| virtual void | setLinkStatusRegInd (int LinkStatusRegInd_) |
| virtual void | setlaInd (int laInd_) |
| virtual void | setgInd (int gInd_) |
| virtual void | setgdInd (int gdInd_) |
| virtual void | setrFactorInd (int rFactorInd_) |
| virtual void | LinearImpactEstimation (double t, fmatvec::Vec &gInActive_, fmatvec::Vec &gdInActive_, int *IndInActive_, fmatvec::Vec &gAct_, int *IndActive_) |
| get gap distance and calculate gap velocity of unilateral links to estimate impacts within the next step More... | |
| virtual void | SizeLinearImpactEstimation (int *sizeInActive_, int *sizeActive_) |
| calculates the number of active and inactive unilateral constraints and increments sizeActive/sizeInActive | |
| virtual void | updatecorr (int j) |
| virtual void | updatecorrRef (const fmatvec::Vec &ref) |
| virtual void | calccorrSize (int j) |
| virtual void | setcorrInd (int corrInd_) |
| virtual void | checkRoot () |
| void | setx (const fmatvec::Vec &x_) |
| virtual void | setsvInd (int svInd_) |
| int | getsvSize () const |
| int | getLinkStatusSize () const |
| int | getLinkStatusRegSize () const |
| const fmatvec::Vec & | getla (bool check=true) const |
| const fmatvec::Vec & | getLa (bool check=true) const |
| fmatvec::Vec & | getla (bool check=true) |
| fmatvec::Vec & | getLa (bool check=true) |
| fmatvec::Vec & | getwb (bool check=true) |
| int | getlaInd () const |
| int | getlaSize () const |
| int | getbSize () const |
| const fmatvec::Vec & | evalg () |
| const fmatvec::Vec & | evalgd () |
| const fmatvec::Vec & | evalla () |
| const fmatvec::Vec & | evalLa () |
| const fmatvec::Vec & | evalwb () |
| const fmatvec::Vec & | evalxd () |
| int | getgdInd () const |
| int | getgSize () const |
| int | getgdSize () const |
| int | getrFactorSize () const |
| const fmatvec::VecInt & | getrFactorUnsure () const |
| const fmatvec::VecV & | evalGeneralizedRelativePosition () |
| const fmatvec::VecV & | evalGeneralizedRelativeVelocity () |
| const fmatvec::VecV & | evalGeneralizedForce () |
| fmatvec::VecV & | getGeneralizedRelativePosition (bool check=true) |
| fmatvec::VecV & | getGeneralizedRelativeVelocity (bool check=true) |
| fmatvec::VecV & | getGeneralizedForce (bool check=true) |
| void | savela () |
| saves contact forces for use as starting value in next time step | |
| void | saveLa () |
| saves contact impulses for use as starting value in next time step | |
| void | initla () |
| load contact forces for use as starting value | |
| void | initLa () |
| load contact impulses for use as starting value | |
| void | decreaserFactors () |
| decrease rfactor if mass action matrix is not diagonal dominant (cf. Foerg: Dissertation, page 80 et seq.) | |
| int | getcorrSize () const |
| bool | getUpdaterrel () const |
Public Member Functions inherited from MBSim::Element | |
| Element (const std::string &name) | |
| constructor | |
| ~Element () override=default | |
| destructor | |
| void | throwError (const std::string &msg) const |
| virtual void | setDynamicSystemSolver (DynamicSystemSolver *sys) |
| sets the used dynamics system solver to the element More... | |
| virtual void | plotAtSpecialEvent () |
| plots time dependent data at special events More... | |
| const std::string & | getName () const |
| void | setName (const std::string &str) |
| void | setPath (const std::string &str) |
| DynamicSystemSolver * | getDynamicSystemSolver () |
| virtual void | createPlotGroup () |
| creates the plotGroup for H5-output | |
| H5::GroupBase * | getPlotGroup () |
| bool | getPlotFeature (const PlotFeatureEnum &pf) |
| virtual void | setPlotFeature (const PlotFeatureEnum &pf, bool value) |
| Set a plot feature. More... | |
| void | setPlotFeatureForChildren (const PlotFeatureEnum &pf, bool value) |
| Set a plot feature for the children of this object. More... | |
| void | setPlotFeatureRecursive (const PlotFeatureEnum &pf, bool value) |
| Set a plot feature for this object and the children of this object. More... | |
| template<class T > | |
| T * | getByPath (const std::string &path, bool initialCaller=true) const |
| Get the object of type T represented by the path path. Do not set any argurment other than path! | |
| std::string | getPath (const Element *relTo=nullptr, std::string sep="/") const |
| Return the path of this object. If relativeTo is not NULL return a relative path to relativeTo. Do not set any argurment other than relTo and sep! | |
| virtual Element * | getChildByContainerAndName (const std::string &container, const std::string &name) const |
| Get the Element named name in the container named container. | |
|
virtual std::shared_ptr < OpenMBV::Group > | getOpenMBVGrp () |
| virtual Element * | getParent () |
| virtual const Element * | getParent () const |
| virtual void | setParent (Element *parent_) |
| std::vector< Element * > | getDependencies () const |
| checks dependency on other elements. More... | |
| void | addDependency (Element *ele) |
| int | computeLevel () |
| computes the length of the pathes in the graph that represents the dependencies between all elements. More... | |
| virtual void | updatePositions (Frame *frame) |
| virtual void | updateVelocities (Frame *frame) |
| virtual void | updateAccelerations (Frame *frame) |
| virtual void | updateJacobians (Frame *frame, int j=0) |
| virtual void | updateGyroscopicAccelerations (Frame *frame) |
| const double & | getTime () const |
| double | getStepSize () const |
|
const MBXMLUtils::DOMEvalException & | getDOMEvalError () const |
Public Member Functions inherited from fmatvec::Atom | |
| Atom & | operator= (const Atom &) |
| void | setMessageStreamActive (MsgType type, bool activeFlag) |
| void | getMessageStream (MsgType type, std::shared_ptr< bool > &a, std::shared_ptr< std::ostream > &s) const |
| void | adoptMessageStreams (const Atom *src=nullptr) |
| std::ostream & | msg (MsgType type) const |
| bool | msgAct (MsgType type) const |
Protected Member Functions | |
| double | evalNone () |
| double | evalDeflection () |
| double | evalTensileForce () |
| double | evalCompressiveForce () |
| double | evalAbsoluteForce () |
Protected Member Functions inherited from MBSim::Element | |
| void | updatePlotFeatures () |
Protected Member Functions inherited from fmatvec::Atom | |
| Atom (const Atom &src) | |
Protected Attributes | |
| Function< double(double, double)> * | func |
| double | l0 |
|
std::shared_ptr < OpenMBVCoilSpring > | ombvCoilSpring |
|
std::shared_ptr < OpenMBV::CoilSpring > | coilspringOpenMBV |
| double(SpringDamper::* | evalOMBVColorRepresentation [5])() |
Protected Attributes inherited from MBSim::FixedFrameLink | |
| int | nF |
| int | nM |
Protected Attributes inherited from MBSim::FrameLink | |
| std::vector< Frame * > | frame |
| array in which all frames are listed, connecting bodies via a link | |
| fmatvec::Vec3 | WrP0P1 |
| difference vector of position, velocity and angular velocity | |
| fmatvec::Vec3 | WvP0P1 |
| fmatvec::Vec3 | WomK0K1 |
| fmatvec::SqrMat3 | AK0K1 |
| fmatvec::Mat3xV | DF |
| fmatvec::Mat3xV | DM |
| bool | updPos |
| bool | updVel |
| bool | updDF |
Protected Attributes inherited from MBSim::MechanicalLink | |
| std::vector< Frame * > | P |
| std::vector< fmatvec::Mat3xV > | RF |
| std::vector< fmatvec::Mat3xV > | RM |
| fmatvec::VecV | lambdaF |
| fmatvec::VecV | lambdaM |
| std::vector< fmatvec::Vec3 > | F |
| std::vector< fmatvec::Vec3 > | M |
| fmatvec::RangeV | iF |
| indices of forces and torques | |
| fmatvec::RangeV | iM |
| bool | updF |
| bool | updM |
| bool | updRMV |
| bool | updlaF |
| bool | updlaM |
Protected Attributes inherited from MBSim::Link | |
| int | ng |
| int | ngd |
| int | nla |
| fmatvec::Vec | x |
| order one parameters | |
| fmatvec::Vec | xd |
| differentiated order one parameters | |
| fmatvec::Vec | dx |
| fmatvec::Vec | x0 |
| order one initial value | |
| int | xSize |
| size and local index of order one parameters | |
| int | xInd |
| fmatvec::Vec | sv |
| stop vector for event driven integration (root function) | |
| fmatvec::VecInt | jsv |
| evaluation of roots of stop vector with a boolean vector | |
| int | svSize |
| size and local index of stop vector | |
| int | svInd |
| fmatvec::VecInt | LinkStatus |
| status of link (default 0) describing which piece of the equation is valid (e.g. stick or slip) More... | |
| int | LinkStatusSize |
| size and local index of link status vector (set-valued) | |
| int | LinkStatusInd |
| fmatvec::VecInt | LinkStatusReg |
| status of link More... | |
| int | LinkStatusRegSize |
| size and local index of single-valued link status vector | |
| int | LinkStatusRegInd |
| fmatvec::Vec | g |
| relative position, relative velocity, contact force and impact parameters | |
| fmatvec::Vec | gd |
| fmatvec::Vec | la |
| fmatvec::Vec | La |
| fmatvec::Vec | laS |
| contact forces of smooth contact laws | |
| int | gSize |
| size and local index of relative distances | |
| int | gInd |
| int | gdSize |
| size and local index of relative velocities | |
| int | gdInd |
| int | laSize |
| size and local index of contact force parameters | |
| int | laInd |
| int | bSize |
| size and local index of contact force parameters | |
| int | bInd |
| fmatvec::RangeV | Ig |
| local index of relative distances and contact force parameters | |
| fmatvec::RangeV | Ila |
| double | gTol |
| tolerance for relative position, relative velocity, relative acceleration, force and impact | |
| double | gdTol |
| double | gddTol |
| double | laTol |
| double | LaTol |
| double | gCorr |
| correction factor for relative position and relative velocity | |
| double | gdCorr |
| fmatvec::Vec | la0 |
| attribute to save contact force parameter of previous time step | |
| fmatvec::Vec | La0 |
| fmatvec::Vec | rFactor |
| vector of rfactors for relaxation of contact equations | |
| fmatvec::VecInt | rFactorUnsure |
| boolean vector defining if rfactor belongs to not diagonal dominant mass action matrix (cf. Foerg Dissertation, page 80 et seq.) | |
| int | rFactorSize |
| size and local index of rfactors | |
| int | rFactorInd |
| double | rMax |
| maximum r-factor | |
| fmatvec::Vec | res |
| std::vector< fmatvec::Mat > | W [2] |
| force direction matrix for nonsmooth right hand side | |
| std::vector< fmatvec::Mat > | V [2] |
| reduced force direction matrix for nonsmooth right hand side | |
| std::vector< fmatvec::Vec > | h [2] |
| smooth complete and link right hand side | |
| std::vector< fmatvec::Mat > | dhdq |
| smooth Jacobians for implicit integration | |
| std::vector< fmatvec::Mat > | dhdu |
| std::vector< fmatvec::Vec > | dhdt |
| std::vector< fmatvec::Vec > | r [2] |
| nonsmooth right hand side | |
| fmatvec::Vec | wb |
| TODO. | |
| fmatvec::Mat | b |
| TODO. | |
| int | corrSize |
| int | corrInd |
| fmatvec::Vec | corr |
| fmatvec::VecV | rrel |
| fmatvec::VecV | vrel |
| fmatvec::VecV | lambda |
| bool | updSize |
| bool | updrrel |
| bool | updvrel |
| bool | updla |
Protected Attributes inherited from MBSim::Element | |
| Element * | parent |
| std::string | name |
| name of element | |
| std::string | path |
| The path of this object. Is set during the init stage reorganizeHierarchy. Before this the path is calculated dynamically using getPath() after this stage getPath just returns this value. | |
| MBXMLUtils::DOMEvalException | domEvalError |
| Special XML helper variable. | |
| DynamicSystemSolver * | ds |
| dynamic system | |
| H5::VectorSerie< double > * | plotVectorSerie |
| time series | |
| std::vector< double > | plotVector |
| one entry of time series | |
| std::vector< std::string > | plotColumns |
| columns of time series | |
| H5::GroupBase * | plotGroup |
| associated plot group | |
| std::vector< Element * > | dependency |
| vector containing all dependencies. | |
| PlotFeatureMap | plotFeature |
| plot feature | |
| PlotFeatureMap | plotFeatureForChildren |
Additional Inherited Members | |
Public Types inherited from MBSim::Element | |
| enum | InitStage { resolveStringRef =0, preInit, plotting, unknownStage, LASTINITSTAGE } |
| The stages of the initialization. More... | |
Public Types inherited from fmatvec::Atom | |
| enum | MsgType |
Static Public Member Functions inherited from fmatvec::Atom | |
| static void | setCurrentMessageStream (MsgType type, const std::shared_ptr< bool > &a=std::make_shared< bool >(true), const std::shared_ptr< std::ostream > &s=std::make_shared< std::ostream >(std::cout.rdbuf())) |
| static std::ostream & | msgStatic (MsgType type) |
| static bool | msgActStatic (MsgType type) |
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.
|
inlinevirtual |
Implements MBSim::Link.
|
virtual |
|
inlinevirtual |
Implements MBSim::Link.
|
inlinevirtual |
asks the link if it contains single valued force laws that contribute to the right-hand side vector h
Reimplemented from MBSim::Link.
|
virtual |
plots time dependent data
| simulation | time |
| simulation | time step size for derivative calculation |
Reimplemented from MBSim::Link.