mbsim  4.0.0
MBSim Kernel
isotropic_rotational_spring_damper.h
1/* Copyright (C) 2004-2012 MBSim Development Team
2 * This library is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2.1 of the License, or (at your option) any later version.
6 *
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
11 *
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 *
16 * Contact: martin.o.foerg@googlemail.com
17 */
18
19#ifndef _ISOTROPIC_ROTATIONAL_SPRING_DAMPER_H_
20#define _ISOTROPIC_ROTATIONAL_SPRING_DAMPER_H_
21
22#include "mbsim/links/fixed_frame_link.h"
23#include "mbsim/functions/function.h"
24
25namespace MBSim {
26
34 public:
39 IsotropicRotationalSpringDamper(const std::string &name="");
40
45
46 void updateGeneralizedPositions();
47 void updateGeneralizedVelocities();
48 void updateForceDirections();
49 void updatelaM();
50
51 bool isActive() const { return true; }
52 bool gActiveChanged() { return false; }
53 bool isSingleValued() const { return true; }
54 void init(InitStage stage, const InitConfigSet &config);
55
56 void setElasticMomentFunction(Function<double(double)> *func_) {
57 funcE=func_;
58 funcE->setParent(this);
59 funcE->setName("ElasticMoment");
60 }
61
62 void setDissipativeMomentFunction(Function<double(double)> *func_) {
63 funcD=func_;
64 funcD->setParent(this);
65 funcD->setName("DissipativeMoment");
66 }
67
68 void initializeUsingXML(xercesc::DOMElement *element);
69
70 private:
71 Function<double(double)> *funcE;
72 Function<double(double)> *funcD;
73 fmatvec::Vec3 n;
74 };
75
76}
77
78#endif
InitStage
The stages of the initialization.
Definition: element.h:62
std::string name
name of element
Definition: element.h:260
void setName(const std::string &str)
Definition: element.h:115
Definition: function.h:53
Isotropic rotational spring damper. This class connects two frames and applies a torque which depends...
Definition: isotropic_rotational_spring_damper.h:33
~IsotropicRotationalSpringDamper()
destructor
Definition: isotropic_rotational_spring_damper.cc:38
void init(InitStage stage, const InitConfigSet &config)
plots time series header
Definition: isotropic_rotational_spring_damper.cc:81
bool isActive() const
Definition: isotropic_rotational_spring_damper.h:51
bool gActiveChanged()
Definition: isotropic_rotational_spring_damper.h:52
IsotropicRotationalSpringDamper(const std::string &name="")
constructor
Definition: isotropic_rotational_spring_damper.cc:34
bool isSingleValued() const
asks the link if it contains single valued force laws that contribute to the right-hand side vector h
Definition: isotropic_rotational_spring_damper.h:53
namespace MBSim
Definition: bilateral_constraint.cc:30