source: XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.hpp @ 172

Last change on this file since 172 was 169, checked in by hozdoba, 13 years ago
File size: 3.7 KB
Line 
1#ifndef __XMLIO_CGrid__
2#define __XMLIO_CGrid__
3
4/// xmlioserver headers ///
5#include "xmlioserver_spl.hpp"
6#include "group_factory.hpp"
7
8#include "declare_group.hpp"
9#include "domain.hpp"
10#include "axis.hpp"
11
12namespace xmlioserver {
13namespace tree {
14   
15   /// ////////////////////// Déclarations ////////////////////// ///
16
17   class CGridGroup;
18   class CGridAttributes;
19   class CGrid;
20
21   ///--------------------------------------------------------------
22
23   // Declare/Define CGridAttribute
24   BEGIN_DECLARE_ATTRIBUTE_MAP(CGrid)
25   #include "grid_attribute.conf"
26   END_DECLARE_ATTRIBUTE_MAP(CGrid)
27
28   ///--------------------------------------------------------------
29
30   class CGrid
31      : public CObjectTemplate<CGrid>
32      , public CGridAttributes
33   {
34         /// typedef ///
35         typedef CObjectTemplate<CGrid>   SuperClass;
36         typedef CGridAttributes SuperClassAttribute;
37
38      public :
39
40         typedef CGridAttributes RelAttributes;
41         typedef CGridGroup      RelGroup;
42
43         /// Constructeurs ///
44         CGrid(void);
45         explicit CGrid(const StdString & id);
46         CGrid(const CGrid & grid);       // Not implemented yet.
47         CGrid(const CGrid * const grid); // Not implemented yet.
48
49         /// Traitements ///
50         void solveReference(void);
51
52         /// Tests ///
53         bool hasAxis(void) const;
54
55      public :
56
57         /// Accesseurs ///
58         const ARRAY(int, 1) & getStoreIndex(void) const;
59         const ARRAY(int, 1) & getOutIIndex(void)  const;
60         const ARRAY(int, 1) & getOutJIndex(void)  const;
61         const ARRAY(int, 1) & getOutLIndex(void)  const;
62
63         const boost::shared_ptr<CAxis>   getRelAxis  (void) const;
64         const boost::shared_ptr<CDomain> getRelDomain(void) const;
65
66         /// Entrées-sorties de champs ///
67         template <StdSize n>
68            void inputField(const  ARRAY(double, n) field, ARRAY(double, 1) stored) const;
69
70         template <StdSize n>
71            void outputField(const ARRAY(double, 1) stored,  ARRAY(double, n) field) const;
72
73         /// Destructeur ///
74         virtual ~CGrid(void);
75
76      public :
77
78         /// Accesseurs statiques ///
79         static StdString GetName(void);
80         static StdString GetDefName(void);
81         
82         static ENodeType GetType(void);
83
84         /// Instanciateurs Statiques ///
85         static boost::shared_ptr<CGrid>
86            CreateGrid(boost::shared_ptr<CDomain> domain);
87         static boost::shared_ptr<CGrid>
88            CreateGrid(boost::shared_ptr<CDomain> domain, boost::shared_ptr<CAxis> axis);
89
90      protected :
91
92         /// Entrées-sorties de champs (interne) ///
93         void storeField_arr(const double * const data, ARRAY(double, 1) stored) const;
94
95         /// Traitements protégés ///
96         void computeIndex(void);
97         void solveDomainRef(void);
98         void solveAxisRef(void);
99
100      public:
101
102         /// Propriétés privées ///
103         bool withAxis ;
104         bool isChecked;
105
106         boost::shared_ptr<CAxis>   axis ;
107         boost::shared_ptr<CDomain> domain ;
108
109         ARRAY(int, 1) storeIndex ;
110         ARRAY(int, 1) out_i_index ;
111         ARRAY(int, 1) out_j_index ;
112         ARRAY(int, 1) out_l_index ;
113
114   }; // class CGrid
115
116   ///--------------------------------------------------------------
117
118   template <StdSize n>
119      void CGrid::inputField(const  ARRAY(double, n) field, ARRAY(double, 1) stored) const
120   { this->storeField_arr(field.data(), stored) ; }
121
122   ///--------------------------------------------------------------
123
124   // Declare/Define CGridGroup and CGridDefinition
125   DECLARE_GROUP(CGrid);
126
127   ///--------------------------------------------------------------
128
129} // namespace tree
130} // namespace xmlioserver
131
132#endif // __XMLIO_CGrid__
Note: See TracBrowser for help on using the repository browser.