All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
nonlinear_spring_damper_force.h
1 /* Copyright (C) 2004-2009 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: markus.ms.schneider@gmail.com
18  */
19 
20 #ifndef _NONLINEAR_SPRING_DAMPER_FORCE_H_
21 #define _NONLINEAR_SPRING_DAMPER_FORCE_H_
22 
23 #include "mbsim/functions/function.h"
24 
25 namespace MBSim {
26 
32  class NonlinearSpringDamperForce : public Function<double(double,double)> {
33  public:
38 
43  delete sF;
44  delete sdF;
45  }
46 
52  NonlinearSpringDamperForce(Function<double(double)> *sF_, Function<double(double)> *sdF_) : sF(sF_), sdF(sdF_) {
53  sF->setParent(this);
54  sdF->setParent(this);
55  }
56 
57  /* INHERITED INTERFACE OF FUNCTION2 */
58  virtual double operator()(const double& s, const double& sd) { return (*sF)(s) + (*sdF)(sd); }
59  void initializeUsingXML(xercesc::DOMElement *element);
60  void init(Element::InitStage stage) {
62  sF->init(stage);
63  sdF->init(stage);
64  }
65  /***************************************************/
66 
67  /* GETTER / SETTER */
68  void setForceDeflectionFunction(Function<double(double)> * sF_) {
69  sF=sF_;
70  sF->setParent(this);
71  sF->setName("ForceDeflection");
72  }
73 
74  void setForceVelocityFunction(Function<double(double)> * sdF_) {
75  sdF=sdF_;
76  sdF->setParent(this);
77  sdF->setName("ForceVelocity");
78  }
79  /***************************************************/
80 
81  protected:
86 
91  };
92 
93 }
94 
95 #endif
function describing a nonlinear relationship between the input deflection / relative velocity and the...
Definition: nonlinear_spring_damper_force.h:32
Function< double(double)> * sF
deflection depending force function
Definition: nonlinear_spring_damper_force.h:85
void init(Element::InitStage stage)
plots time series header
Definition: nonlinear_spring_damper_force.h:60
InitStage
The stages of the initialization.
Definition: element.h:97
Definition: planar_contour.h:31
Function()
Definition: function.h:53
virtual void init(InitStage stage)
plots time series header
Definition: element.cc:70
Function< double(double)> * sdF
relative velocity depending force function
Definition: nonlinear_spring_damper_force.h:90
void setName(const std::string &str)
Definition: element.h:163
~NonlinearSpringDamperForce()
destructor
Definition: nonlinear_spring_damper_force.h:42
NonlinearSpringDamperForce(Function< double(double)> *sF_, Function< double(double)> *sdF_)
constructor
Definition: nonlinear_spring_damper_force.h:52
NonlinearSpringDamperForce()
constructor
Definition: nonlinear_spring_damper_force.h:37

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML