Ignore:
Timestamp:
03/23/16 16:10:45 (8 years ago)
Author:
mhnguyen
Message:

Implementing dynamic interpolation on axis

+) Change grid transformation to make it more flexible
+) Make some small improvements

Test
+) On Curie
+) All test pass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/transformation/axis_algorithm_inverse.cpp

    r666 r827  
    2525  } 
    2626 
    27   this->computeIndexSourceMapping(); 
     27//  this->computeIndexSourceMapping(); 
     28} 
     29 
     30void CAxisAlgorithmInverse::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     31{ 
     32  this->transformationMapping_.resize(1); 
     33  this->transformationWeight_.resize(1); 
     34 
     35  std::map<int, std::vector<int> >& transMap = this->transformationMapping_[0]; 
     36  std::map<int, std::vector<double> >& transWeight = this->transformationWeight_[0]; 
     37 
     38  int globalIndexSize = axisDestGlobalIndex_.size(); 
     39  for (int idx = 0; idx < globalIndexSize; ++idx) 
     40  { 
     41    transMap[axisDestGlobalIndex_[idx]].push_back(axisDestGlobalSize_-axisDestGlobalIndex_[idx]-1); 
     42    transWeight[axisDestGlobalIndex_[idx]].push_back(1.0); 
     43  } 
     44 
    2845  int niSrc   = axisSrc_->n.getValue(); 
    2946  int sizeSrc = axisSrc_->n_glo.getValue(); 
     
    3552      axisDest_->value(idx) = axisSrc_->value(sizeSrc-idx-1); 
    3653    } 
    37   } 
    38 } 
    39  
    40 void CAxisAlgorithmInverse::computeIndexSourceMapping() 
    41 { 
    42   std::map<int, std::vector<int> >& transMap = this->transformationMapping_; 
    43   std::map<int, std::vector<double> >& transWeight = this->transformationWeight_; 
    44  
    45   int globalIndexSize = axisDestGlobalIndex_.size(); 
    46   for (int idx = 0; idx < globalIndexSize; ++idx) 
    47   { 
    48     transMap[axisDestGlobalIndex_[idx]].push_back(axisDestGlobalSize_-axisDestGlobalIndex_[idx]-1); 
    49     transWeight[axisDestGlobalIndex_[idx]].push_back(1.0); 
    5054  } 
    5155} 
     
    6569  CTransformationMapping transformationMap(axisDest_, axisSrc_); 
    6670 
    67   std::map<int, std::vector<int> >& transMap = this->transformationMapping_; 
    68   std::map<int, std::vector<double> >& transWeight = this->transformationWeight_; 
     71  std::map<int, std::vector<int> >& transMap = this->transformationMapping_[0]; 
     72  std::map<int, std::vector<double> >& transWeight = this->transformationWeight_[0]; 
    6973 
    7074  std::map<size_t, std::vector<std::pair<size_t,double> > > globaIndexMapFromDestToSource; 
Note: See TracChangeset for help on using the changeset viewer.