Changeset 1999 for XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_inverse.cpp
- Timestamp:
- 01/03/21 18:00:43 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_inverse.cpp
r1988 r1999 49 49 50 50 CAxisAlgorithmInverse::CAxisAlgorithmInverse(bool isSource, CAxis* axisDestination, CAxis* axisSource, CInverseAxis* inverseAxis) 51 : CA xisAlgorithmTransformation(isSource, axisDestination,axisSource)51 : CAlgorithmTransformationTransfer(isSource), axisDest_(axisDestination), axisSrc_(axisSource) 52 52 TRY 53 53 { … … 59 59 << "Size of axis destination " <<axisDestination->getId() << " is " << axisDestination->n_glo.getValue()); 60 60 } 61 } 62 CATCH 63 64 void CAxisAlgorithmInverse::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 65 TRY 66 { 67 this->transformationMapping_.resize(1); 68 this->transformationWeight_.resize(1); 69 70 TransformationIndexMap& transMap = this->transformationMapping_[0]; 71 TransformationWeightMap& transWeight = this->transformationWeight_[0]; 72 73 int globalIndexSize = axisDestGlobalIndex_.size(); 61 62 auto& transMap = this->transformationMapping_; 63 64 int globalIndexSize = axisDestination->index.size(); 74 65 for (int idx = 0; idx < globalIndexSize; ++idx) 75 66 { 76 transMap[axisDestGlobalIndex_[idx]].push_back(axisDestGlobalSize_-axisDestGlobalIndex_[idx]-1); 77 transWeight[axisDestGlobalIndex_[idx]].push_back(1.0); 67 transMap[axisDestination->index(idx)] = globalIndexSize-axisDestination->index(idx)-1; 78 68 } 79 69 … … 88 78 } 89 79 } 90 } 91 CATCH 80 81 axisDestination->checkAttributes() ; 82 this->computeAlgorithm(axisSource->getLocalView(CElementView::WORKFLOW), axisDestination->getLocalView(CElementView::WORKFLOW)) ; 83 84 } 85 CATCH 86 92 87 93 88 /*! … … 118 113 typedef std::unordered_map<size_t, std::vector<double> > GlobalIndexMapFromSrcToDest; 119 114 GlobalIndexMapFromSrcToDest globalIndexMapFromSrcToDest; 120 TransformationIndexMap& transMap = this->transformationMapping_[0]; 121 TransformationIndexMap::const_iterator itb = transMap.begin(), ite = transMap.end(), it; 115 auto& transMap = this->transformationMapping_; 122 116 CArray<size_t,1> globalSrcIndex(transMap.size()); 123 117 int localIndex = 0; 124 for ( it = itb; it != ite; ++it)125 { 126 size_t srcIndex = it->second [0];118 for (auto it = transMap.begin(); it != transMap.end(); ++it) 119 { 120 size_t srcIndex = it->second; 127 121 globalIndexMapFromSrcToDest[srcIndex].resize(1); 128 122 globalIndexMapFromSrcToDest[srcIndex][0] = it->first;
Note: See TracChangeset
for help on using the changeset viewer.