Ignore:
Timestamp:
09/20/10 17:30:34 (14 years ago)
Author:
hozdoba
Message:

Plusieurs modifications en attendant une version propre et stable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/XMLIO/grid.hpp

    r120 r122  
    1313         CGrid(void) : ObjectTemplate<CGrid>(), GridAttribut(), hasAxis(false), axis(NULL), domain(NULL) 
    1414         { /* Ne rien faire de plus */ } 
     15 
    1516         CGrid(const string& _id) : ObjectTemplate<CGrid>(_id), GridAttribut(), hasAxis(false), axis(NULL), domain(NULL) 
    1617         { /* Ne rien faire de plus */ } 
    1718 
    1819         static string GetName(void) { return ("grid"); } 
     20 
     21         const CAxis* getRelAxis(void) const { return (axis); } 
     22         const CDomain* getRelDomain(void) const { return (domain); } 
    1923 
    2024         inline void solveReference(void) ; 
     
    2428         inline void computeIndex(void); 
    2529 
    26          inline void storeField(const Array<double,1>& field, Array<double,1>& stored); 
    27          inline void storeField(const Array<double,2>& field, Array<double,1>& stored); 
    28          inline void storeField(const Array<double,3>& field, Array<double,1>& stored); 
    29          inline void storeField(const double* const data, Array<double,1>& stored); 
    30  
    31          inline void outputField(const Array<double,1>& stored, Array<double,2>& outField); 
    32          inline void outputField(const Array<double,1>& stored, Array<double,3>& outField); 
     30         bool _hasAxis(void) const { return (hasAxis); } 
     31 
     32         inline void storeField(const Array<double, 1>& field, Array<double, 1>& stored); 
     33         inline void storeField(const Array<double, 2>& field, Array<double, 1>& stored); 
     34         inline void storeField(const Array<double, 3>& field, Array<double, 1>& stored); 
     35         inline void storeField(const double* const data, Array<double, 1>& stored); 
     36 
     37         inline void outputField(const Array<double,1>& stored, Array<double, 2>& outField); 
     38         inline void outputField(const Array<double,1>& stored, Array<double, 3>& outField); 
    3339 
    3440         inline static CGrid* CreateObject(const CDomain* const a_domain, const CAxis* const a_axis); 
     
    7783   void CGrid::solveReference(void) 
    7884   { 
     85 
    7986      static bool isReferenceSolved = false; 
    8087      if (isReferenceSolved) return; 
     
    94101         if (CDomain::HasObject(domain_ref)) 
    95102         { 
    96            domain=CDomain::GetObject(domain_ref) ; 
     103           domain = CDomain::GetObject(domain_ref) ; 
    97104           domain->check() ; 
    98105         } 
     
    115122   void CGrid::computeIndex(void) 
    116123   { 
     124 
    117125      int ni = domain->ni ; 
    118126      int nj = domain->nj ; 
     
    123131      int data_jbegin  = (data_dim == 2) ? (int)domain->data_jbegin : -1; 
    124132 
    125       Array<int,1>& data_i_index =* domain->data_i_index ; 
    126       Array<int,1>& data_j_index =* domain->data_j_index ; 
    127       Array<bool,2>& mask =* domain->mask ; 
     133      Array<int, 1>& data_i_index =* domain->data_i_index ; 
     134      Array<int, 1>& data_j_index =* domain->data_j_index ; 
     135      Array<bool, 2>& mask =* domain->mask ; 
    128136      int i, j, l, n ; 
    129137      int count, indexCount ; 
     
    131139      for(indexCount=0, l=0; l<size ; l++) 
    132140      { 
    133          for(n=0, indexCount=0; n<data_n_index; n++) 
     141         for(n=0; n<data_n_index; n++) 
    134142         { 
    135143            if (data_dim == 1) 
     
    137145               i = (data_i_index(n) + data_ibegin) % ni ; 
    138146               j = (data_i_index(n) + data_ibegin) / ni ; 
    139                cout<<i<<" "<<j<<" "<<mask(i,j)<<endl ; 
     147               //cout<<i<<" "<<j<<" "<<mask(i,j)<<endl ; 
    140148            } 
    141149            else 
     
    143151               i = data_i_index(n) + data_ibegin ; 
    144152               j = data_j_index(n) + data_jbegin ; 
    145                cout<<i<<" "<<j<<" "<<mask(i,j)<<endl ; 
     153               //cout<<i<<" "<<j<<" "<<mask(i,j)<<endl ; 
    146154            } 
    147155 
     
    157165      for(count=0, indexCount=0, l=0; l<size; l++) 
    158166      { 
    159          for(n=0; n<data_n_index; n++) 
     167         for(n=0; n<data_n_index; n++, count++) 
    160168         { 
    161169            if (data_dim == 1) 
     
    164172               j = (data_i_index(n) + data_ibegin) / ni ; 
    165173            } 
    166             else 
     174            else // (dat_dim == 2) 
    167175            { 
    168176               i = data_i_index(n) + data_ibegin ; 
     
    172180            if (i>=0 && i<ni && j>=0 && j<nj && mask(i,j)) 
    173181            { 
    174                storeIndex(indexCount) = n ; 
     182               storeIndex(indexCount) = count ; 
    175183               out_l_index(indexCount) = l ; 
    176184               out_i_index(indexCount) = i ; 
     
    178186               indexCount++ ; 
    179187            } 
    180             count++ ; 
    181188         } 
    182189      } 
    183190 
     191      /** Pour tests 
     192 
    184193      cout << "Out of CGrid::ComputeIndex" << endl ; 
     194 
     195      cout << "storeIndex : " << endl ; 
    185196      cout << storeIndex << endl ; 
     197 
     198      cout << "out_i_index : " << endl ; 
    186199      cout << out_i_index << endl ; 
     200 
     201      cout << "out_j_index : " << endl ; 
    187202      cout << out_j_index << endl ; 
     203 
     204      cout << "out_l_index : " << endl ; 
    188205      cout << out_l_index << endl ; 
     206 
     207      **/ 
     208 
    189209   } 
    190210 
Note: See TracChangeset for help on using the changeset viewer.