MBSim

Project Page
graph.h
00001 /* Copyright (C) 2004-2009 MBSim Development Team
00002  * This library is free software; you can redistribute it and/or 
00003  * modify it under the terms of the GNU Lesser General Public 
00004  * License as published by the Free Software Foundation; either 
00005  * version 2.1 of the License, or (at your option) any later version. 
00006  *  
00007  * This library is distributed in the hope that it will be useful, 
00008  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
00009  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00010  * Lesser General Public License for more details. 
00011  *  
00012  * You should have received a copy of the GNU Lesser General Public 
00013  * License along with this library; if not, write to the Free Software 
00014  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
00015  *
00016  * Contact: martin.o.foerg@googlemail.com
00017  */
00018 
00019 
00020 #ifndef _GRAPH_H_
00021 #define _GRAPH_H_
00022 
00023 #include "mbsim/dynamic_system.h"
00024 
00025 namespace H5 {
00026   class Group;
00027 }
00028 
00029 namespace MBSim {
00030 
00031 
00037   class Graph : public DynamicSystem {
00038     public:
00043       Graph(const std::string &name);
00044 
00048       virtual ~Graph();
00049 
00050       /* INHERITED INTERFACE OF OBJECTINTERFACE */
00051       virtual void updateStateDependentVariables(double t);
00052       virtual void updatedu(double t, double dt);
00053       virtual void updatezd(double t);
00054       virtual void updateud(double t, int i=0);
00055       virtual void sethSize(int h, int j=0) {(this->*sethSize_[j])(h);}
00056       virtual void calcqSize();
00057       virtual void calcuSize(int j=0) {(this->*calcuSize_[j])();}
00058       virtual void setqInd(int qInd);
00059       virtual void setuInd(int uInd, int j=0) {(this->*setuInd_[j])(uInd);}
00060       virtual void sethInd(int hInd, int j=0) {(this->*sethInd_[j])(hInd);}
00061 
00062       /* INHERITED INTERFACE OF ELEMENT */
00063       virtual std::string getType() const { return "Graph"; }
00064       /***************************************************/
00065 
00066       /* INHERITED INTERFACE OF SUBSYSTEM */
00067       virtual void updateJacobians(double t, int j=0);
00068       void facLLM(int i=0); 
00069 
00070       void (Graph::*calcuSize_[2])(); 
00071       void (Graph::*sethSize_[2])(int h); 
00072       void (Graph::*setuInd_[2])(int uInd); 
00073       void (Graph::*sethInd_[2])(int hInd); 
00074       void calcuSize0();
00075       void calcuSize1();
00076       void sethSize0(int h);
00077       void sethSize1(int h);
00078       void setuInd0(int uInd);
00079       void setuInd1(int uInd);
00080       void sethInd0(int hInd);
00081       void sethInd1(int hInd);
00082 
00083       /***************************************************/
00084 
00090       void addObject(int level, Object* object); 
00091 
00092       void co();
00093 
00094     protected:
00098       std::vector< std::vector<Object*> > obj;
00099   };
00100 
00101 }
00102 
00103 #endif
00104