ElmerFoamFSI  2.0
ElmerFoamFSI is fluid-solid interaction simulation application built up from OpenFOAM CFD and Elmer CSM coupled through the IMPACT multiphysics software integration infrastructure.
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros Groups Pages
Orchestrator.H
Go to the documentation of this file.
1 #ifndef __ORCHESTRATOR_H__
2 #define __ORCHESTRATOR_H__
3 
4 namespace impact {
5  namespace orchestrator {
6 
7  class agentbase {
8  public:
10  protected:
11  std::vector<std::string> componentInterfaceNames;
12  std::vector<std::string> modelInterfaceNames;
13  std::vector<int> componentFunctionHandles;
14  std::ostream *errStream;
15  std::ostream *outStream;
16  public:
17  agentbase() : errStream(NULL), outStream(NULL) {
19  };
20  virtual void SetErrStream(std::ostream &oStream){ errStream = &oStream; };
21  virtual void SetOutStream(std::ostream &oStream){ outStream = &oStream; };
22  virtual int Initialize(const std::string &interfaceName){return(0);};
23  virtual int Run(){return(0);};
24  virtual int InitializeTimeStep(double time){return(0);};
25  virtual int FinalizeTimeStep(double time){return(0);};
26  virtual int Finalize(){return(0);};
27  virtual int DumpSolution(){return(0);};
28  virtual void WriteOut(const std::string &output){
29  if(outStream)
30  *outStream << output;
31  }
32  virtual void WriteErr(const std::string &output){
33  if(errStream)
34  *errStream << output;
35  }
36  virtual ~agentbase(){};
37  };
38 
39  class couplingbase {
40  public:
43  protected:
44  std::vector<impact::orchestrator::agentbase *> componentAgents;
45  std::vector<double> realNumbers;
46  std::vector<int> intNumbers;
47  std::ostream *errStream;
48  std::ostream *outStream;
49  public:
50  couplingbase() : errStream(NULL), outStream(NULL) {
51  realNumbers.resize(NUMBER_OF_REALS,0);
53  }
54  virtual void SetErrStream(std::ostream &oStream){ errStream = &oStream; };
55  virtual void SetOutStream(std::ostream &oStream){ outStream = &oStream; };
56  virtual int Initialize(std::vector<std::string> &componentInterfaceNames){return(0);};
57  virtual int Run(){return(0);};
58  virtual int Finalize(){return(0);};
59  virtual int DumpSolution(){return(0);};
60  virtual void WriteOut(const std::string &output){
61  if(outStream)
62  *outStream << output;
63  }
64  virtual void WriteErr(const std::string &output){
65  if(errStream)
66  *errStream << output;
67  }
68  virtual ~couplingbase(){};
69 
70  };
71  }
72 }
73 
74 #endif
virtual void SetOutStream(std::ostream &oStream)
Definition: Orchestrator.H:55
virtual void SetErrStream(std::ostream &oStream)
Definition: Orchestrator.H:54
virtual int Initialize(const std::string &interfaceName)
Definition: Orchestrator.H:22
std::vector< int > componentFunctionHandles
Definition: Orchestrator.H:13
virtual void SetErrStream(std::ostream &oStream)
Definition: Orchestrator.H:20
virtual int FinalizeTimeStep(double time)
Definition: Orchestrator.H:25
std::vector< impact::orchestrator::agentbase * > componentAgents
Definition: Orchestrator.H:44
virtual void WriteOut(const std::string &output)
Definition: Orchestrator.H:60
virtual int Initialize(std::vector< std::string > &componentInterfaceNames)
Definition: Orchestrator.H:56
virtual void SetOutStream(std::ostream &oStream)
Definition: Orchestrator.H:21
std::vector< std::string > modelInterfaceNames
Definition: Orchestrator.H:12
virtual int InitializeTimeStep(double time)
Definition: Orchestrator.H:24
std::vector< std::string > componentInterfaceNames
Definition: Orchestrator.H:11
virtual void WriteErr(const std::string &output)
Definition: Orchestrator.H:64
std::vector< double > realNumbers
Definition: Orchestrator.H:45
virtual void WriteErr(const std::string &output)
Definition: Orchestrator.H:32
virtual void WriteOut(const std::string &output)
Definition: Orchestrator.H:28