Changeset 1093


Ignore:
Timestamp:
04/13/17 13:19:49 (5 years ago)
Author:
rlacroix
Message:

Fix some bugs when using indexed output.

The grid was mistakenly modified which caused some weird behaviors.

Fixes tickets #125 and #127.

File:
1 edited

Legend:

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

    r1078 r1093  
    10021002  void CGrid::computeCompressedIndex() 
    10031003  { 
    1004     compressedOutIndexFromClient = outIndexFromClient; 
    1005  
    10061004    std::map<size_t, size_t> indexes; 
    10071005 
    10081006    { 
    1009       std::map<int, CArray<size_t,1> >::const_iterator it = compressedOutIndexFromClient.begin(); 
    1010       std::map<int, CArray<size_t,1> >::const_iterator itEnd = compressedOutIndexFromClient.end(); 
     1007      std::map<int, CArray<size_t,1> >::const_iterator it = outIndexFromClient.begin(); 
     1008      std::map<int, CArray<size_t,1> >::const_iterator itEnd = outIndexFromClient.end(); 
    10111009      for (; it != itEnd; ++it) 
    10121010      { 
    10131011        for (int i = 0; i < it->second.numElements(); ++i) 
    10141012          indexes.insert(std::make_pair(it->second(i), 0)); 
     1013 
     1014        compressedOutIndexFromClient[it->first].resize(it->second.numElements()); 
    10151015      } 
    10161016    } 
     
    10281028      for (; it != itEnd; ++it) 
    10291029      { 
     1030        const CArray<size_t,1>& outIndex = outIndexFromClient[it->first]; 
    10301031        for (int i = 0; i < it->second.numElements(); ++i) 
    1031           it->second(i) = indexes[it->second(i)]; 
     1032          it->second(i) = indexes[outIndex(i)]; 
    10321033      } 
    10331034    } 
Note: See TracChangeset for help on using the changeset viewer.