Ignore:
Timestamp:
10/16/12 13:04:44 (12 years ago)
Author:
ymipsl
Message:

Major Update

  • redesign Type and attribute manipulation
  • add enumerate type and attribute
  • use blitz class array instead of boost class array

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/grid.hpp

    r351 r369  
    99#include "domain.hpp" 
    1010#include "axis.hpp" 
     11#include "array_new.hpp" 
     12#include "attribute_array.hpp" 
    1113 
    1214namespace xios { 
     
    5456         void solveReference(void); 
    5557 
    56          virtual void toBinary  (StdOStream & os) const; 
    57          virtual void fromBinary(StdIStream & is); 
     58 //        virtual void toBinary  (StdOStream & os) const; 
     59//         virtual void fromBinary(StdIStream & is); 
    5860 
    5961         /// Tests /// 
     
    6365 
    6466         /// Accesseurs /// 
    65          const std::deque<ARRAY(int, 1)> & getStoreIndex(void) const; 
    66          const std::deque<ARRAY(int, 1)> & getOutIIndex(void)  const; 
    67          const std::deque<ARRAY(int, 1)> & getOutJIndex(void)  const; 
    68          const std::deque<ARRAY(int, 1)> & getOutLIndex(void)  const; 
     67         const std::deque< CArray<int, 1>* > & getStoreIndex(void) const; 
     68         const std::deque< CArray<int, 1>* > & getOutIIndex(void)  const; 
     69         const std::deque< CArray<int, 1>* > & getOutJIndex(void)  const; 
     70         const std::deque< CArray<int, 1>* > & getOutLIndex(void)  const; 
    6971 
    7072         const CAxis*   getRelAxis  (void) const; 
     
    8082 
    8183         /// Entrées-sorties de champs /// 
    82          template <StdSize n> 
    83             void inputField(const ARRAY(double, n) field, ARRAY(double, 1) stored) const; 
     84         template <int n> 
     85            void inputField(const CArray<double,n>& field, CArray<double,1>& stored) const; 
    8486             
    85          void inputFieldServer(const std::deque<ARRAY(double, 1)> storedClient, 
    86                                                 ARRAY(double, 1)  storedServer) const; 
    87 /* 
    88          template <StdSize n> 
    89             void outputField(const ARRAY(double, 1) stored,  ARRAY(double, n) field) const; 
    90 */ 
    91          void outputField(int rank, const ARRAY(double, 1) stored,  ARRAY(double, 3) field)  ; 
    92          void outputField(int rank, const ARRAY(double, 1) stored,  ARRAY(double, 2) field)  ; 
    93          void outputField(int rank,const ARRAY(double, 1) stored,  ARRAY(double, 1) field)  ;  
     87         void inputFieldServer(const std::deque< CArray<double, 1>* > storedClient, 
     88                               CArray<double, 1>&  storedServer) const; 
     89 
     90         void outputField(int rank, const CArray<double,1>& stored,  CArray<double,3>& field)  ; 
     91         void outputField(int rank, const CArray<double,1>& stored,  CArray<double,2>& field)  ; 
     92         void outputField(int rank, const CArray<double,1>& stored,  CArray<double,1>& field)  ;  
    9493    
    9594         /// Destructeur /// 
     
    111110 
    112111         /// Entrées-sorties de champs (interne) /// 
    113          void storeField_arr(const double * const data, ARRAY(double, 1) stored) const; 
     112         void storeField_arr(const double * const data, CArray<double,1>& stored) const; 
    114113 
    115114         /// Traitements protégés /// 
     
    120119 
    121120         static bool dispatchEvent(CEventServer& event) ; 
    122          void outputFieldToServer(ARRAY(double, 1) fieldIn, int rank, ARRAY(double, 1) fieldOut) ; 
     121         void outputFieldToServer(CArray<double,1>& fieldIn, int rank, CArray<double,1>& fieldOut) ; 
    123122         static void recvIndex(CEventServer& event) ; 
    124123         void recvIndex(int rank, CBufferIn& buffer) ; 
     
    134133         CDomain* domain ; 
    135134 
    136          std::deque<ARRAY(int, 1)> storeIndex ; 
    137          std::deque<ARRAY(int, 1)> out_i_index ; 
    138          std::deque<ARRAY(int, 1)> out_j_index ; 
    139          std::deque<ARRAY(int, 1)> out_l_index ; 
    140          ARRAY(int, 1) storeIndex_client ; 
    141          ARRAY(int, 1) out_i_client ; 
    142          ARRAY(int, 1) out_j_client ; 
    143          ARRAY(int, 1) out_l_client ; 
     135         std::deque< CArray<int, 1>* > storeIndex ; 
     136         std::deque< CArray<int, 1>* > out_i_index ; 
     137         std::deque< CArray<int, 1>* > out_j_index ; 
     138         std::deque< CArray<int, 1>* > out_l_index ; 
    144139          
    145          map<int,ARRAY(int, 1)>  storeIndex_toSrv ; 
     140        CArray<int, 1>  storeIndex_client ; 
     141        CArray<int, 1>  out_i_client ; 
     142        CArray<int, 1>  out_j_client ; 
     143        CArray<int, 1>  out_l_client ; 
     144          
     145         map<int, CArray<int, 1>* >  storeIndex_toSrv ; 
    146146         map<int,int> nbSenders ; 
    147147//         std::deque<ARRAY(int, 1)> out_i_toSrv ; 
     
    149149//         std::deque<ARRAY(int, 1)> out_l_toSrv ; 
    150150          
    151          map<int,ARRAY(int, 1)> out_i_fromClient ; 
    152          map<int,ARRAY(int, 1)> out_j_fromClient ; 
    153          map<int,ARRAY(int, 1)> out_l_fromClient ; 
     151         map<int, CArray<int, 1>* > out_i_fromClient ; 
     152         map<int, CArray<int, 1>* > out_j_fromClient ; 
     153         map<int, CArray<int, 1>* > out_l_fromClient ; 
    154154          
    155155   }; // class CGrid 
     
    157157   ///-------------------------------------------------------------- 
    158158 
    159    template <StdSize n> 
    160       void CGrid::inputField(const  ARRAY(double, n) field, ARRAY(double, 1) stored) const 
     159   template <int n> 
     160      void CGrid::inputField(const CArray<double,n>& field, CArray<double,1>& stored) const 
    161161   { 
    162       if (this->getDataSize() != field->num_elements()) 
    163          ERROR("CGrid::inputField(const  ARRAY(double, n) field, ARRAY(double, 1) stored)", 
     162      if (this->getDataSize() != field.numElements()) 
     163         ERROR("void CGrid::inputField(const  CArray<double,n>& field, CArray<double,1>& stored) const", 
    164164                << "[ Taille des données attendue = " << this->getDataSize()       << ", " 
    165                 << "Taille des données reçue = "      << field->num_elements() << " ] " 
     165                << "Taille des données reçue = "      << field.numElements() << " ] " 
    166166                << "Le tableau de données n'a pas la bonne taille !") ; 
    167       this->storeField_arr(field->data(), stored) ; 
     167      this->storeField_arr(field.dataFirst(), stored) ; 
    168168   } 
    169169 
Note: See TracChangeset for help on using the changeset viewer.