All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
interface_integrator.h
1 /* Copyright (C) 2013 Markus Schneider
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  *
18  * Contact:
19  * markus.ms.schneider@live.de
20  *
21  */
22 
23 #ifndef _INTERFACE_INTEGRATOR_H_
24 #define _INTERFACE_INTEGRATOR_H_
25 
26 #include <mbsim/integrators/integrator.h>
27 
28 namespace MBSimControl {
29  class Signal;
30  class ExternSignalSource;
31 }
32 
33 namespace MBSimInterface {
34 
35  class MBSimServer;
36 
40 
41  protected:
42  std::ofstream integPlot;
43 
44  public:
45 
48 
49  void setMBSimServer(MBSimServer* m_) {mbsimServer=m_; }
50 
51  void integrate(MBSim::DynamicSystemSolver& system);
52 
53  virtual void initializeUsingXML(xercesc::DOMElement *element);
54 
55  virtual std::string getType() const { return "InterfaceIntegrator"; }
56 
57  void integratorCommunication(const char* requestIdentifier, const char* interface2mbsim, unsigned int interface2mbsimLength, std::ostringstream* mbsim2interface);
58  bool getExitRequest() {return exitRequest; }
59 
60  private:
61  // get values
62  void getz(double** z_);
63  void getzdot(double** zdot_);
64  void getsv(double** sv_);
65 
66  // set values
67  void setTime(double t_);
68  void setz(const fmatvec::Vec& z_);
69 
70  // internal routines
71  int zSize, svSize;
72 
73  bool printCommunication;
74 
75  void dumpMemory(std::ostringstream *out, void *p, unsigned int N);
76  void double2str(std::ostringstream *out, double *p, unsigned int N);
77  void int2str(std::ostringstream *out, int *p, unsigned int N);
78 
79  bool exitRequest;
80 
81  MBSimServer* mbsimServer;
82  std::vector<std::string> outputSignalRef, inputSignalRef, outputSignalName, inputSignalName;
83  std::vector<MBSimControl::Signal*> outputSignal;
84  std::vector<MBSimControl::ExternSignalSource*> inputSignal;
85  fmatvec::VecInt outputSignalSize, inputSignalSize;
86  void resolveInputOutputNames();
87  fmatvec::Vec outputVector, inputVector;
88  };
89 }
90 
91 #endif // _SERVER_INTEGRATOR_H_
Definition: mbsim_server.h:34
Dummy-Integrator InterfaceIntegrator This integrator is an interface for other integration tool...
Definition: interface_integrator.h:39
static DynamicSystemSolver * system

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML