Ignore:
Timestamp:
06/22/15 13:36:27 (9 years ago)
Author:
mhnguyen
Message:

Final testing transfomation algorithm: inverse axis (local commit)

+) Make some minor change to make sure one element (axis or domain) be able to have several similar transformation

Test
+) On Curie
+) test_new_feature: test passed with correct data written

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/filter/axis_inverse.cpp

    r621 r622  
    44 
    55CAxisInverse::CAxisInverse(CAxis* axisDestination, CAxis* axisSource) 
    6  : CConcreteAlgo() 
     6 : CAxisAlgorithmTransformation(axisDestination, axisSource) 
    77{ 
    88  if (axisDestination->size.getValue() != axisSource->size.getValue()) 
     
    2020 
    2121  for (int idx = 0; idx < niDest; ++idx) axisDestGlobalIndex_.push_back(ibeginDest+idx); 
     22  this->computeIndexSourceMapping(); 
    2223} 
    2324 
    24 void CAxisInverse::computeIndexSourceMapping(const std::map<int, std::vector<int> >& transformationMappingOfPreviousAlgo) 
     25void CAxisInverse::computeIndexSourceMapping() 
    2526{ 
    2627  std::map<int, std::vector<int> >& transMap = this->transformationMapping_; 
    27   if (transformationMappingOfPreviousAlgo.empty()) 
    28   { 
    29     int globalIndexSize = axisDestGlobalIndex_.size(); 
    30     for (int idx = 0; idx < globalIndexSize; ++idx) 
    31       transMap[axisDestGlobalIndex_[idx]].push_back(axisDestGlobalSize_-axisDestGlobalIndex_[idx]-1); 
    32   } 
    33   else 
    34   { 
    35     std::map<int, std::vector<int> >::const_iterator itb = transformationMappingOfPreviousAlgo.begin(), it, 
    36                                                      ite = transformationMappingOfPreviousAlgo.end(); 
    37     for (it = itb; it != ite; ++it) 
    38     { 
    39       transMap[it->first].push_back(axisDestGlobalSize_-it->first-1); 
    40     } 
    41   } 
     28 
     29  int globalIndexSize = axisDestGlobalIndex_.size(); 
     30  for (int idx = 0; idx < globalIndexSize; ++idx) 
     31    transMap[axisDestGlobalIndex_[idx]].push_back(axisDestGlobalSize_-axisDestGlobalIndex_[idx]-1); 
    4232} 
    4333 
Note: See TracChangeset for help on using the changeset viewer.