Changeset 2291 for XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_axis.cpp
- Timestamp:
- 02/01/22 15:28:48 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_axis.cpp
r2270 r2291 79 79 80 80 } 81 82 bool local=false ; 83 if (!algo->local.isEmpty()) local=algo->local ; 81 84 82 int globalIndexSize = axisSource-> n_glo; 83 for (int idx = 0; idx < globalIndexSize; ++idx) transformationMapping_[0].push_back(idx); 85 auto& transMap = this->transformationMapping_; 86 87 if (local) 88 { 89 scalarDestination->n=1 ; // no mask 90 scalarDestination->mask.reset() ; 91 92 CArray<size_t,1> srcGlobalIndex ; 93 axisSource->getLocalView(CElementView::WORKFLOW)->getGlobalIndexView(srcGlobalIndex) ; 94 size_t nbIdx = srcGlobalIndex.numElements(); 95 if (nbIdx==0) scalarDestination->n=0 ; 96 scalarDestination->checkAttributes() ; 84 97 85 scalarDestination->checkAttributes() ; 98 for (size_t idx = 0; idx < nbIdx; ++idx) 99 { 100 size_t globalIdx = srcGlobalIndex(idx); 101 transformationMapping_[0].push_back(globalIdx); 102 } 103 104 } 105 else 106 { 107 scalarDestination->checkAttributes() ; 108 109 int globalIndexSize = axisSource->getLocalView(CElementView::WORKFLOW)->getGlobalSize(); 110 CArray<size_t,1> dstGlobalIndex ; 111 scalarDestination->getLocalView(CElementView::WORKFLOW)->getGlobalIndexView(dstGlobalIndex) ; 112 if (dstGlobalIndex.numElements()!=0) 113 for (int idx = 0; idx < globalIndexSize; ++idx) transformationMapping_[0].push_back(idx); 114 } 115 86 116 this->computeAlgorithm(axisSource->getLocalView(CElementView::WORKFLOW), scalarDestination->getLocalView(CElementView::WORKFLOW)) ; 87 117
Note: See TracChangeset
for help on using the changeset viewer.