- Timestamp:
- 01/07/21 23:17:23 (4 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate.cpp
r1988 r2009 51 51 52 52 CAxisAlgorithmInterpolate::CAxisAlgorithmInterpolate(bool isSource, CAxis* axisDestination, CAxis* axisSource, CInterpolateAxis* interpAxis) 53 : CA xisAlgorithmTransformation(isSource, axisDestination, axisSource), coordinate_(), transPosition_()53 : CAlgorithmTransformationWeight(isSource), coordinate_(), transPosition_(), axisSrc_(axisSource), axisDest_(axisDestination) 54 54 TRY 55 55 { 56 56 interpAxis->checkValid(axisSource); 57 axisDestination->checkAttributes() ; 58 57 59 order_ = interpAxis->order.getValue(); 58 60 if (!interpAxis->coordinate.isEmpty()) 59 61 { 60 62 coordinate_ = interpAxis->coordinate.getValue(); 61 this->idAuxInputs_.resize(1); 62 this->idAuxInputs_[0] = coordinate_; 63 } 63 // this->idAuxInputs_.resize(1); 64 // this->idAuxInputs_[0] = coordinate_; 65 } 66 std::vector<CArray<double,1>* > dataAuxInputs ; 67 computeRemap(dataAuxInputs) ; 68 this->computeAlgorithm(axisSource->getLocalView(CElementView::WORKFLOW), axisDestination->getLocalView(CElementView::WORKFLOW)) ; 64 69 } 65 70 CATCH … … 68 73 Compute the index mapping between axis on grid source and one on grid destination 69 74 */ 70 void CAxisAlgorithmInterpolate::compute IndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)75 void CAxisAlgorithmInterpolate::computeRemap(const std::vector<CArray<double,1>* >& dataAuxInputs) 71 76 TRY 72 77 { … … 179 184 TRY 180 185 { 181 TransformationIndexMap& transMap = this->transformationMapping_ [transPos];182 TransformationWeightMap& transWeight = this->transformationWeight_ [transPos];186 TransformationIndexMap& transMap = this->transformationMapping_; 187 TransformationWeightMap& transWeight = this->transformationWeight_; 183 188 std::map<int, std::vector<std::pair<int,double> > >::const_iterator itb = interpolatingIndexValues.begin(), it, 184 189 ite = interpolatingIndexValues.end(); … … 205 210 transMap[globalIndexDest][idx] = index; 206 211 transWeight[globalIndexDest][idx] = weight; 212 /* 207 213 if (!transPosition_.empty()) 208 214 { 209 215 (this->transformationPosition_[transPos])[globalIndexDest] = transPosition_[transPos]; 210 216 } 211 } 212 } 217 */ 218 } 219 } 220 /* 213 221 if (!transPosition_.empty() && this->transformationPosition_[transPos].empty()) 214 222 (this->transformationPosition_[transPos])[0] = transPosition_[transPos]; 215 223 */ 216 224 } 217 225 CATCH … … 308 316 vecAxisValue[0].resize(axisSrc_->value.numElements()); 309 317 vecAxisValue[0] = axisSrc_->value; 310 this->transformationMapping_.resize(1);311 this->transformationWeight_.resize(1);318 // this->transformationMapping_.resize(1); 319 // this->transformationWeight_.resize(1); 312 320 } 313 321 else 314 322 { 323 /* 315 324 CField* field = CField::get(coordinate_); 316 325 CGrid* grid = field->getGrid(); … … 388 397 } 389 398 } 390 } 391 } 392 CATCH 393 394 } 399 */ 400 } 401 } 402 CATCH 403 404 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate.hpp
r1988 r2009 10 10 #define __XIOS_AXIS_ALGORITHM_INTERPOLATE_HPP__ 11 11 12 #include "a xis_algorithm_transformation.hpp"12 #include "algorithm_transformation_weight.hpp" 13 13 #include "transformation.hpp" 14 14 … … 24 24 The values on axis source are assumed monotonic 25 25 */ 26 class CAxisAlgorithmInterpolate : public CA xisAlgorithmTransformation26 class CAxisAlgorithmInterpolate : public CAlgorithmTransformationWeight 27 27 { 28 28 public: … … 32 32 33 33 static bool registerTrans(); 34 protected:35 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);36 34 37 35 private: 36 void computeRemap(const std::vector<CArray<double,1>* >& dataAuxInputs) ; 38 37 void retrieveAllAxisValue(const CArray<double,1>& axisValue, const CArray<bool,1>& axisMask, 39 38 std::vector<double>& recvBuff, std::vector<int>& indexVec); … … 48 47 StdString coordinate_; 49 48 std::vector<std::vector<int> > transPosition_; 49 CAxis* axisSrc_=nullptr ; 50 CAxis* axisDest_=nullptr; 51 private: 50 52 51 private:52 53 static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 53 54 CTransformation<CAxis>* transformation,
Note: See TracChangeset
for help on using the changeset viewer.