Ignore:
Timestamp:
07/05/16 15:59:10 (8 years ago)
Author:
mhnguyen
Message:

Adding new transformation for scalar: Reducing an axis to a scalar

+) Add new xml node for new transformation
+) Add new algorithms for axis reduction
+) Make change in some place to make sure everything work fine

Test
+) On Curie
+) Tests pass and are correct

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/distribution_client.cpp

    r887 r888  
    6565  grid->checkMask(); 
    6666  switch (gridDim) { 
     67    case 0: 
     68      gridMask_.resize(1); 
     69      gridMask_(0) = true; 
     70      break; 
    6771    case 1: 
    6872      readGridMaskInfo(grid->mask_1d); 
     
    416420  createLocalDomainDataIndex(); 
    417421  createLocalAxisDataIndex(); 
     422  createLocalScalarDataIndex(); 
    418423 
    419424  int idxDomain = 0, idxAxis = 0; 
     
    579584void CDistributionClient::createGlobalIndex() 
    580585{ 
    581 //  size_t ssize = 1, idx = 0; 
    582 //  for (int i = 0; i < this->dims_; ++i) 
    583 //  ssize *= nLocal_[i]; 
    584 // 
    585 //  this->globalIndex_.resize(ssize); 
    586 //  std::vector<int> idxLoop(this->numElement_,0); 
    587 //  int innnerLoopSize = (infoIndex_[0]).numElements(); 
    588 //  while (idx < ssize) 
    589 //  { 
    590 //    for (int i = 0; i < this->numElement_; ++i) 
    591 ////    { 
    592 //      if (idxLoop[i] == (infoIndex_[indexMap_[i]]).numElements()) 
    593 //      { 
    594 //        idxLoop[i] = 0; 
    595 //        ++idxLoop[i+1]; 
    596 //      } 
    597 //    } 
    598 // 
    599 //    for (int i = 0; i < innnerLoopSize; ++i) 
    600 //    { 
    601 //      size_t globalIndex = (infoIndex_[0])(idxLoop[0]); 
    602 //      size_t mulDim = 1; 
    603 //      for (int idxElement = 0; idxElement < this->numElement_; ++idxElement) 
    604 //      { 
    605 //        if (axisDomainOrder_(idxElement)) 
    606 //        { 
    607 //          int jb = (0 == idxElement) ? 1 : 0; 
    608 //          for (int j = jb; j <= 1; ++j) 
    609 //          { 
    610 //            mulDim *= nGlob_[indexMap_[idxElement]+j-1]; 
    611 //            globalIndex += ((infoIndex_[indexMap_[idxElement]+j])(idxLoop[idxElement]))*mulDim; 
    612 //          } 
    613 //        } 
    614 //        else 
    615 //        { 
    616 //          if (0 != idxElement) 
    617 //          { 
    618 //            mulDim *= nGlob_[indexMap_[idxElement]-1]; 
    619 //            globalIndex += ((infoIndex_[indexMap_[idxElement]])(idxLoop[idxElement]))*mulDim; 
    620 //          } 
    621 //        } 
    622 //      } 
    623 // 
    624 //      this->globalIndex_(idx) = globalIndex; 
    625 //      ++idxLoop[0]; 
    626 //      ++idx; 
    627 //    } 
    628 //  } 
    629586} 
    630587 
Note: See TracChangeset for help on using the changeset viewer.