source: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.hpp @ 1875

Last change on this file since 1875 was 1875, checked in by ymipsl, 4 years ago

XIOS coupling branch
Some updates.

First coupling test is beginning to work...

YM

  • Property svn:executable set to *
File size: 4.0 KB
Line 
1#ifndef __XIOS_CCouplerIn__
2#define __XIOS_CCouplerIn__
3
4/// XIOS headers ///
5#include "xios_spl.hpp"
6#include "field.hpp"
7#include "declare_group.hpp"
8#include "date.hpp"
9#include "attribute_enum.hpp"
10#include "attribute_enum_impl.hpp"
11#include "context_client.hpp"
12#include "mpi.hpp"
13#include "string_tools.hpp"
14
15namespace xios
16{
17
18   /// ////////////////////// Déclarations ////////////////////// ///
19
20   class CCouplerInGroup;
21   class CCouplerInAttributes;
22   class CCouplerIn;
23
24   class CGarbageCollector;
25
26   ///--------------------------------------------------------------
27
28   // Declare/Define CCouplerInAttribute
29   BEGIN_DECLARE_ATTRIBUTE_MAP(CCouplerIn)
30#  include "coupler_in_attribute.conf"
31   END_DECLARE_ATTRIBUTE_MAP(CCouplerIn)
32
33   ///--------------------------------------------------------------
34
35   /*!
36   \class CCouplerIn
37   This class corresponds to file component of the xml.
38   The class contains all the nessceary information to write data into a netcdf file: The most important thing
39   is the field(s) which will be written into file. Besides, there are some options to write
40   data into file, e.g: writting into only one file or multiple file; splitting a running into several files.
41   Moreover, there are some other attributes of netcdf file which are also stored in this class
42   */
43   class CCouplerIn
44      : public CObjectTemplate<CCouplerIn>
45      , public CCouplerInAttributes
46   {
47         /// typedef ///
48         typedef CObjectTemplate<CCouplerIn>   SuperClass;
49         typedef CCouplerInAttributes SuperClassAttribute;
50
51      public :
52         enum EEventId
53         {
54           NO_EVENT
55         };
56
57         typedef CCouplerInAttributes RelAttributes;
58         typedef CCouplerInGroup      RelGroup;
59
60         /// Constructeurs ///
61         CCouplerIn(void);
62         explicit CCouplerIn(const StdString& id);
63         CCouplerIn(const CCouplerIn& couplerIn);       // Not implemented yet.
64         CCouplerIn(const CCouplerIn* const couplerIn); // Not implemented yet.
65
66         /// Destructeur ///
67         virtual ~CCouplerIn(void);
68
69      public:
70         /// Accesseurs ///
71         CFieldGroup* getVirtualFieldGroup(void) const;
72         std::vector<CField*> getAllFields(void) const;
73         std::vector<CField* > getEnabledFields(void);
74
75         StdString dumpClassAttributes(void);
76
77      public :
78         void setVirtualFieldGroup(CFieldGroup* newVFieldGroup);
79
80         // Add component into coupler
81         CField* addField(const string& id = "");
82         CFieldGroup* addFieldGroup(const string& id = "");
83
84      public:
85         /// Accesseurs statiques ///
86         static StdString GetName(void);
87         static StdString GetDefName(void);
88         static ENodeType GetType(void);
89      public:
90         /// Traitements ///
91         virtual void parse(xml::CXMLNode& node);
92//         virtual StdString toString(void) const;
93
94      public:
95         virtual void solveDescInheritance(bool apply, const CAttributeMap* const parent = 0);
96         void solveFieldRefInheritance(bool apply);
97         void createInterCommunicator(void) ;
98         void assignContext(void) ;
99     
100      private:
101        CContextClient* client_=nullptr ;
102      public:
103         CContextClient* getContextClient(void) {return client_; }
104     
105      private:
106        string couplingContextId_ ;
107      public:
108        const string& getCouplingContextId(void) ; 
109
110      private :
111
112         CFieldGroup* virtualFieldGroup;
113
114//         std::shared_ptr<CDataOutput> data_out;
115//         std::shared_ptr<CDataInput> data_in;
116         std::vector<CField*> enabledFields;
117
118
119      public:
120
121   }; // class CCouplerIn
122
123   ///--------------------------------------------------------------
124
125   // Declare/Define CCouplerInGroup and CCouplerInDefinition
126   DECLARE_GROUP(CCouplerIn);
127
128   ///--------------------------------------------------------------
129
130} // namespace xios
131
132#endif // __XIOS_CCouplingIn__
Note: See TracBrowser for help on using the repository browser.