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
25 namespace MBSim {
26
33 class IsotropicRotationalSpringDamper : public FixedFrameLink {
34 public:
39 IsotropicRotationalSpringDamper(const std::string &name="");
40
44 ~IsotropicRotationalSpringDamper();
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
MBSim::FixedFrameLink
frame link
Definition: fixed_frame_link.h:30
MBSim::IsotropicRotationalSpringDamper
Isotropic rotational spring damper. This class connects two frames and applies a torque which depends...
Definition: isotropic_rotational_spring_damper.h:33
MBSim::IsotropicRotationalSpringDamper::gActiveChanged
bool gActiveChanged()
Definition: isotropic_rotational_spring_damper.h:52
MBSim::Element::InitStage
InitStage
The stages of the initialization.
Definition: element.h:62
MBSim::IsotropicRotationalSpringDamper::isActive
bool isActive() const
Definition: isotropic_rotational_spring_damper.h:51
MBSim::IsotropicRotationalSpringDamper::isSingleValued
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
MBSim::Function
Definition: contact_kinematics.h:32
MBSim::Element::name
std::string name
name of element
Definition: element.h:260
MBSim::IsotropicRotationalSpringDamper::IsotropicRotationalSpringDamper
IsotropicRotationalSpringDamper(const std::string &name="")
constructor
Definition: isotropic_rotational_spring_damper.cc:34
MBSim::Element::setName
void setName(const std::string &str)
Definition: element.h:115
MBSim::IsotropicRotationalSpringDamper::~IsotropicRotationalSpringDamper
~IsotropicRotationalSpringDamper()
destructor
Definition: isotropic_rotational_spring_damper.cc:38
MBSim::IsotropicRotationalSpringDamper::init
void init(InitStage stage, const InitConfigSet &config)
plots time series header
Definition: isotropic_rotational_spring_damper.cc:81
MBSim
namespace MBSim
Definition: bilateral_constraint.cc:30