Changeset 912


Ignore:
Timestamp:
08/03/16 15:49:10 (5 years ago)
Author:
mhnguyen
Message:

Fixing bug in axis interpolation

+) Correct index for searching interpolant values

Test
+) On local
+) Ok

Location:
XIOS/trunk/src/transformation
Files:
2 edited

Legend:

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

    r896 r912  
    5454    XIOSAlgorithms::sortWithIndex<double, CVectorStorage>(recvBuff, indexVec); 
    5555    for (int i = 0; i < srcSize; ++i) valueSrc[i] = recvBuff[indexVec[i]]; 
    56     computeInterpolantPoint(valueSrc, idx); 
     56    computeInterpolantPoint(valueSrc, indexVec, idx); 
    5757  } 
    5858} 
     
    6464  \param [in] tranPos position of axis on a domain 
    6565*/ 
    66 void CAxisAlgorithmInterpolate::computeInterpolantPoint(const std::vector<double>& axisValue, int transPos) 
     66void CAxisAlgorithmInterpolate::computeInterpolantPoint(const std::vector<double>& axisValue, 
     67                                                        const std::vector<int>& indexVec, 
     68                                                        int transPos) 
    6769{ 
    6870  std::vector<double>::const_iterator itb = axisValue.begin(), ite = axisValue.end(); 
     
    117119    { 
    118120      int index = std::distance(itb, it); 
    119       interpolatingIndexValues[idx+ibegin].push_back(make_pair(index,*it)); 
     121      interpolatingIndexValues[idx+ibegin].push_back(make_pair(indexVec[index],*it)); 
    120122    } 
    121123  } 
  • XIOS/trunk/src/transformation/axis_algorithm_interpolate.hpp

    r896 r912  
    3333  void retrieveAllAxisValue(const CArray<double,1>& axisValue, const CArray<bool,1>& axisMask, 
    3434                            std::vector<double>& recvBuff, std::vector<int>& indexVec); 
    35   void computeInterpolantPoint(const std::vector<double>& recvBuff, int transPos = 0); 
     35  void computeInterpolantPoint(const std::vector<double>& recvBuff, const std::vector<int>&, int transPos = 0); 
    3636  void computeWeightedValueAndMapping(const std::map<int, std::vector<std::pair<int,double> > >& interpolatingIndexValues, int transPos = 0); 
    3737  void fillInAxisValue(std::vector<CArray<double,1> >& vecAxisValue, 
Note: See TracChangeset for help on using the changeset viewer.