All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
constraint.h
1 /* Copyright (C) 2004-2009 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 _CONSTRAINT_H
20 #define _CONSTRAINT_H
21 
22 #include "mbsim/element.h"
23 
24 namespace MBSim {
25 
30  class Constraint : public Element {
31  private:
32 
33  public:
34  Constraint(const std::string &name);
35  virtual void updateGeneralizedCoordinates() {}
36  virtual void updateGeneralizedJacobians(int j=0) { }
37  virtual void updatedx() { }
38  virtual void updatexd() { }
39  virtual void calcxSize() { xSize = 0; }
40  virtual const fmatvec::Vec& getx() const { return x; }
41  virtual fmatvec::Vec& getx() { return x; }
42  virtual void setxInd(int xInd_) { xInd = xInd_; };
43  virtual int getxSize() const { return xSize; }
44  virtual void updatexRef(const fmatvec::Vec& ref);
45  virtual void updatexdRef(const fmatvec::Vec& ref);
46  virtual void updatedxRef(const fmatvec::Vec& ref);
47  virtual void init(InitStage stage);
48  virtual void initz();
49  virtual void writez(H5::GroupBase *group);
50  virtual void readz0(H5::GroupBase *group);
51  std::string getType() const { return "Constraint"; }
52  virtual void plot();
53  virtual void closePlot();
54  virtual void setUpInverseKinetics() { }
55  virtual std::shared_ptr<OpenMBV::Group> getOpenMBVGrp() {return std::shared_ptr<OpenMBV::Group>();}
56  bool getUpdateGeneralizedCoordinates() const { return updGC; }
57  bool getUpdateGeneralizedJacobians() const { return updGJ; }
58  void resetUpToDate() { updGC = true; updGJ = true; }
59 
60  const fmatvec::Vec& evalxd();
61 
62  protected:
67 
72 
73  fmatvec::Vec dx;
74 
79 
83  int xSize, xInd;
84  bool updGC, updGJ;
85  };
86 
87 }
88 
89 #endif
int xSize
size and local index of order one parameters
Definition: constraint.h:83
virtual void closePlot()
closes plot file
Definition: constraint.cc:91
basic class of MBSim mainly for plotting
Definition: element.h:58
fmatvec::Vec xd
differentiated order one parameters
Definition: constraint.h:71
fmatvec::Vec x
order one parameters
Definition: constraint.h:66
virtual void plot()
plots time dependent data
Definition: constraint.cc:78
InitStage
The stages of the initialization.
Definition: element.h:97
virtual void init(InitStage stage)
plots time series header
Definition: constraint.cc:47
std::string name
name of element
Definition: element.h:298
Class for constraints between generalized coordinates of objects.
Definition: constraint.h:30
fmatvec::Vec x0
order one initial value
Definition: constraint.h:78
std::string getType() const
Definition: constraint.h:51

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML