All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
graph.h
1 /* Copyright (C) 2004-2014 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 
20 #ifndef _GRAPH_H_
21 #define _GRAPH_H_
22 
23 #include "mbsim/dynamic_system.h"
24 
25 namespace H5 {
26  class Group;
27 }
28 
29 namespace MBSim {
30 
31 
37  class Graph : public DynamicSystem {
38  public:
43  Graph(const std::string &name);
44 
48  virtual ~Graph();
49 
50  /* INHERITED INTERFACE OF OBJECTINTERFACE */
51  virtual void updateStateDependentVariables(double t);
52  virtual void updatedu(double t, double dt);
53  virtual void updatezd(double t);
54  virtual void updateud(double t, int i=0);
55  virtual void sethSize(int h, int j=0) {(this->*sethSize_[j])(h);}
56  virtual void calcqSize();
57  virtual void calcuSize(int j=0) {(this->*calcuSize_[j])();}
58  virtual void setqInd(int qInd);
59  virtual void setuInd(int uInd, int j=0) {(this->*setuInd_[j])(uInd);}
60  virtual void sethInd(int hInd, int j=0) {(this->*sethInd_[j])(hInd);}
61 
62  /* INHERITED INTERFACE OF ELEMENT */
63  virtual std::string getType() const { return "Graph"; }
64  /***************************************************/
65 
66  /* INHERITED INTERFACE OF SUBSYSTEM */
67  virtual void updateJacobians(double t, int j=0);
68  void facLLM(int i=0);
69 
70  void (Graph::*calcuSize_[2])();
71  void (Graph::*sethSize_[2])(int h);
72  void (Graph::*setuInd_[2])(int uInd);
73  void (Graph::*sethInd_[2])(int hInd);
74  void calcuSize0();
75  void calcuSize1();
76  void sethSize0(int h);
77  void sethSize1(int h);
78  void setuInd0(int uInd);
79  void setuInd1(int uInd);
80  void sethInd0(int hInd);
81  void sethInd1(int hInd);
82 
83  /***************************************************/
84 
90  void addObject(int level, Object* object);
91 
92  void printGraph();
93 
94  protected:
98  std::vector< std::vector<Object*> > obj;
99  };
100 
101 }
102 
103 #endif
104 
Graph(const std::string &name)
constructor
Definition: graph.cc:29
void addObject(int level, Object *object)
add new object to graph at level
Definition: graph.cc:146
fmatvec::Vec h[2]
smooth, smooth with respect to objects, smooth with respect to links, nonsmooth and order one right h...
Definition: dynamic_system.h:799
void facLLM(int i=0)
compute Cholesky decomposition of mass matrix TODO necessary?
Definition: graph.cc:142
std::vector< std::vector< Object * > > obj
none
Definition: graph.h:98
virtual std::string getType() const
Definition: graph.h:63
dynamic system as topmost hierarchical level
Definition: dynamic_system.h:57
class for tree-structured mechanical systems with recursive and flat memory mechanism ...
Definition: graph.h:37
std::string name
name of element
Definition: element.h:290
virtual ~Graph()
destructor
Definition: graph.cc:40
class for all objects having own dynamics and mass
Definition: object.h:42

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML