mbsim 4.0.0 MBSim Kernel

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
36 class Graph : public DynamicSystem {
37 public:
42 Graph(const std::string &name);
43
47 ~Graph() override = default;
48
49 void updateT() override;
50 void updateM() override;
51 void updateLLM() override;
52 void updateh(int k=0) override;
53 void updatedq() override;
54 void updatedu() override;
55 void updatezd() override;
56 void sethSize(int h, int j=0) override {(this->*sethSize_[j])(h);}
57 void calcqSize() override;
58 void calcuSize(int j=0) override {(this->*calcuSize_[j])();}
59 void setqInd(int qInd) override;
60 void setuInd(int uInd, int j=0) override {(this->*setuInd_[j])(uInd);}
61 void sethInd(int hInd, int j=0) override {(this->*sethInd_[j])(hInd);}
62
63 #ifndef SWIG
64 void (Graph::*calcuSize_[2])();
65 void (Graph::*sethSize_[2])(int h);
66 void (Graph::*setuInd_[2])(int uInd);
67 void (Graph::*sethInd_[2])(int hInd);
68 #endif
69 void calcuSize0();
70 void calcuSize1();
71 void sethSize0(int h);
72 void sethSize1(int h);
73 void setuInd0(int uInd);
74 void setuInd1(int uInd);
75 void sethInd0(int hInd);
76 void sethInd1(int hInd);
77
83 void addObject(int level, Object* object);
84
85 protected:
89 std::vector< std::vector<Object*>> obj;
90 };
91
92 }
93
94 #endif
MBSim::Graph::Graph
Graph(const std::string &name)
constructor
Definition: graph.cc:29
MBSim::Graph::addObject
void addObject(int level, Object *object)
add new object to graph at level
Definition: graph.cc:144
MBSim::DynamicSystem::h
fmatvec::Vec h[2]
smooth, smooth with respect to objects, smooth with respect to links and nonsmooth
Definition: dynamic_system.h:856
MBSim::Graph::obj
std::vector< std::vector< Object * > > obj
none
Definition: graph.h:89
MBSim::DynamicSystem
dynamic system as topmost hierarchical level
Definition: dynamic_system.h:58
MBSim::Graph
class for tree-structured mechanical systems with recursive and flat memory mechanism
Definition: graph.h:36
MBSim::Element::name
std::string name
name of element
Definition: element.h:260
MBSim::Graph::~Graph
~Graph() override=default
destructor
MBSim::Object
class for all objects having own dynamics and mass
Definition: object.h:42
MBSim
namespace MBSim
Definition: bilateral_constraint.cc:30