All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
regularized_constraint.h
1 /* Copyright (C) 2004-2018 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: martin.o.foerg@googlemail.com
18  */
19 
20 #ifndef _REGULARIZED_CONSTRAINT_H_
21 #define _REGULARIZED_CONSTRAINT_H_
22 
23 #include <mbsim/constitutive_laws/generalized_force_law.h>
24 
25 namespace MBSim {
26 
32  public:
36  RegularizedConstraint(Function<double(double,double)> *forceFunc_=nullptr) : forceFunc(forceFunc_) {
37  if(forceFunc)
38  forceFunc->setParent(this);
39  }
40 
44  ~RegularizedConstraint() override { delete forceFunc; };
45 
46  void init(Element::InitStage stage, const InitConfigSet &config) override;
47 
48  /* INHERITED INTERFACE */
49  bool isSetValued() const override { return false; }
50  /***************************************************/
51 
52  void initializeUsingXML(xercesc::DOMElement *element) override;
53 
60  double operator()(double g, double gd) override { return (*forceFunc)(g,gd); }
61 
67  void setForceFunction(Function<double(double,double)> *forceFunc_) {
68  forceFunc=forceFunc_;
69  forceFunc->setParent(this);
70 
71  }
72  protected:
77  };
78 
79 }
80 
81 #endif
basic force law on acceleration level for constraint description
Definition: generalized_force_law.h:32
Function< double(double, double)> * forceFunc
force function for a regularized contact law
Definition: regularized_constraint.h:76
void init(Element::InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: regularized_constraint.cc:31
InitStage
The stages of the initialization.
Definition: element.h:62
~RegularizedConstraint() override
destructor
Definition: regularized_constraint.h:44
bool isSetValued() const override
Definition: regularized_constraint.h:49
Definition: planar_contour.h:30
RegularizedConstraint(Function< double(double, double)> *forceFunc_=nullptr)
constructor
Definition: regularized_constraint.h:36
double operator()(double g, double gd) override
Definition: regularized_constraint.h:60
void setForceFunction(Function< double(double, double)> *forceFunc_)
Set the force function for use in regularisized constitutive laws The first input parameter to the fo...
Definition: regularized_constraint.h:67
basic regularized force law on acceleration level for constraint description
Definition: regularized_constraint.h:31

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Home