Ignore:
Timestamp:
06/08/17 16:57:44 (4 years ago)
Author:
ymipsl
Message:

Bug fix when using domain interpolation to a destination domain with overlapping (data indexed domain).

MH. N & YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp

    r1114 r1163  
    388388  } 
    389389 
    390   if (writeToFile_ && !readFromFile_) 
    391      writeRemapInfo(interpMapValue); 
    392   exchangeRemapInfo(interpMapValue); 
     390  if (writeToFile_ && !readFromFile_) writeRemapInfo(interpMapValue); 
     391//  exchangeRemapInfo(interpMapValue); 
     392  convertRemapInfo(interpMapValue) ; 
    393393 
    394394  delete [] globalSrc; 
     
    494494} 
    495495 
     496void CDomainAlgorithmInterpolate::convertRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
     497{ 
     498  CContext* context = CContext::getCurrent(); 
     499  CContextClient* client=context->client; 
     500  int clientRank = client->clientRank; 
     501 
     502  this->transformationMapping_.resize(1); 
     503  this->transformationWeight_.resize(1); 
     504 
     505  TransformationIndexMap& transMap = this->transformationMapping_[0]; 
     506  TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
     507 
     508  std::map<int,std::vector<std::pair<int,double> > >::const_iterator itb = interpMapValue.begin(), it, 
     509                                                                     ite = interpMapValue.end(); 
     510   
     511  for (it = itb; it != ite; ++it) 
     512  {     
     513    const std::vector<std::pair<int,double> >& tmp = it->second; 
     514    for (int i = 0; i < tmp.size(); ++i) 
     515    { 
     516      transMap[it->first].push_back(tmp[i].first); 
     517      transWeight[it->first].push_back(tmp[i].second); 
     518    }       
     519  }       
     520} 
    496521 
    497522/*! 
Note: See TracChangeset for help on using the changeset viewer.