Changeset 2033 for XIOS/trunk/src/transformation
- Timestamp:
- 02/11/21 13:20:03 (4 years ago)
- Location:
- XIOS/trunk/src/transformation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/transformation/axis_algorithm_interpolate.cpp
r1980 r2033 55 55 interpAxis->checkValid(axisSource); 56 56 order_ = interpAxis->order.getValue(); 57 if (interpAxis->extrapolate.isEmpty()) extrapolate_=false ; 58 else extrapolate_=interpAxis->extrapolate ; 59 57 60 this->idAuxInputs_.clear(); 58 61 if (!interpAxis->coordinate.isEmpty()) … … 132 135 if(!coordinateDST_.empty()) 133 136 { 134 int nDomPoint = (*dataAuxInputs[0]).numElements()/numValue ;135 137 int dst_position_in_data = dataAuxInputs.size()-1; 138 int nDomPoint = (*dataAuxInputs[dst_position_in_data]).numElements()/numValue ; 136 139 for(int ii=0; ii<numValue; ii++) 137 140 { … … 192 195 193 196 } 194 } 195 computeWeightedValueAndMapping(interpolatingIndexValues, transPos); 197 else 198 { 199 it=itb ; 200 if (destValue <= *it) 201 { 202 int numVal=0 ; 203 while(numVal <= order_ && it!=ite) 204 { 205 if (*it != sfmax) 206 { 207 interpolatingIndexValues[idx+ibegin].push_back(make_pair(indexVec[std::distance(itb, it)],*it)); 208 ++numVal ; 209 } 210 ++it ; 211 } 212 } 213 214 it=ite ; 215 --it ; 216 if (destValue >= *it) 217 { 218 int numVal=0 ; 219 do 220 { 221 if (*it != sfmax) 222 { 223 interpolatingIndexValues[idx+ibegin].push_back(make_pair(indexVec[std::distance(itb, it)],*it)); 224 ++numVal ; 225 } 226 --it ; 227 } while(it!=itb && numVal<=order_) ; 228 } 229 } 230 } 231 232 computeWeightedValueAndMapping(axisDestValue, interpolatingIndexValues, transPos); 196 233 } 197 234 CATCH … … 203 240 \param [in] interpolatingIndexValues the necessary axis value to calculate the coeffs 204 241 */ 205 void CAxisAlgorithmInterpolate::computeWeightedValueAndMapping( const std::map<int, std::vector<std::pair<int,double> > >& interpolatingIndexValues, int transPos)242 void CAxisAlgorithmInterpolate::computeWeightedValueAndMapping(CArray<double,1>& axisDestValue, const std::map<int, std::vector<std::pair<int,double> > >& interpolatingIndexValues, int transPos) 206 243 TRY 207 244 { … … 214 251 { 215 252 int globalIndexDest = it->first; 216 double localValue = axisDest_->value(globalIndexDest - ibegin); 253 // double localValue = axisDest_->value(globalIndexDest - ibegin); 254 double localValue = axisDestValue(globalIndexDest - ibegin); 217 255 const std::vector<std::pair<int,double> >& interpVal = it->second; 218 256 int interpSize = interpVal.size(); -
XIOS/trunk/src/transformation/axis_algorithm_interpolate.hpp
r1982 r2033 18 18 class CGrid; 19 19 class CInterpolateAxis; 20 20 21 21 /*! 22 22 \class CAxisAlgorithmInterpolate … … 45 45 void computeInterpolantPoint(const std::vector<double>& recvBuff, const std::vector<int>&, 46 46 const std::vector<CArray<double,1>* >& dataAuxInputs, int transPos = 0); 47 void computeWeightedValueAndMapping( const std::map<int, std::vector<std::pair<int,double> > >& interpolatingIndexValues, int transPos = 0);47 void computeWeightedValueAndMapping(CArray<double,1>& axisDestValue, const std::map<int, std::vector<std::pair<int,double> > >& interpolatingIndexValues, int transPos = 0); 48 48 void fillInAxisValue(std::vector<CArray<double,1> >& vecAxisValue, 49 49 const std::vector<CArray<double,1>* >& dataAuxInputs); … … 52 52 // Interpolation order 53 53 int order_; 54 bool extrapolate_ ; 54 55 StdString coordinate_; 55 56 StdString coordinateDST_;
Note: See TracChangeset
for help on using the changeset viewer.