Changeset 829 for XIOS/trunk/src/transformation/axis_algorithm_inverse.cpp
- Timestamp:
- 03/23/16 16:11:01 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/transformation/axis_algorithm_inverse.cpp
r827 r829 72 72 std::map<int, std::vector<double> >& transWeight = this->transformationWeight_[0]; 73 73 74 std::map<size_t, std::vector<std::pair<size_t,double> > >globaIndexMapFromDestToSource;74 CTransformationMapping::DestinationIndexMap globaIndexMapFromDestToSource; 75 75 std::map<int, std::vector<int> >::const_iterator it = transMap.begin(), ite = transMap.end(); 76 int localIndex = 0; 76 77 for (; it != ite; ++it) 77 78 { 78 globaIndexMapFromDestToSource[it->first].push_back(make_pair((it->second)[0], (transWeight[it->first])[0])); 79 globaIndexMapFromDestToSource[it->first].push_back(make_pair(localIndex,make_pair((it->second)[0], (transWeight[it->first])[0]))); 80 ++localIndex; 79 81 } 80 82 81 83 transformationMap.computeTransformationMapping(globaIndexMapFromDestToSource); 82 84 83 const std::map<int,std::vector<std::vector<std::pair<size_t,double> > > >& globalIndexToReceive = transformationMap.getGlobalIndexReceivedOnGridDestMapping();84 const std::map<int,std::vector<size_t> >& globalIndexToSend = transformationMap.getGlobalIndexSendToGridDestMapping();85 const CTransformationMapping::ReceivedIndexMap& globalIndexToReceive = transformationMap.getGlobalIndexReceivedOnGridDestMapping(); 86 const CTransformationMapping::SentIndexMap& globalIndexToSend = transformationMap.getGlobalIndexSendToGridDestMapping(); 85 87 86 88 // Sending global index of original grid source 87 std::map<int,std::vector<size_t> >::const_iterator itbSend = globalIndexToSend.begin(), itSend,88 iteSend = globalIndexToSend.end();89 CTransformationMapping::SentIndexMap::const_iterator itbSend = globalIndexToSend.begin(), itSend, 90 iteSend = globalIndexToSend.end(); 89 91 int sendBuffSize = 0; 90 92 for (itSend = itbSend; itSend != iteSend; ++itSend) sendBuffSize += (itSend->second).size(); … … 99 101 { 100 102 int destRank = itSend->first; 101 const std::vector<s ize_t>& globalIndexOfCurrentGridSourceToSend = itSend->second;103 const std::vector<std::pair<int,size_t> >& globalIndexOfCurrentGridSourceToSend = itSend->second; 102 104 int countSize = globalIndexOfCurrentGridSourceToSend.size(); 103 105 for (int idx = 0; idx < (countSize); ++idx) 104 106 { 105 int index = globalIndexOfCurrentGridSourceToSend[idx] - ibeginSrc;107 int index = globalIndexOfCurrentGridSourceToSend[idx].first; 106 108 sendBuff[idx+currentBuffPosition] = (axisSrc_->value)(index); 107 109 } … … 112 114 113 115 // Receiving global index of grid source sending from current grid source 114 std::map<int,std::vector<std::vector<std::pair<size_t,double> > > >::const_iterator itbRecv = globalIndexToReceive.begin(), itRecv,115 116 CTransformationMapping::ReceivedIndexMap::const_iterator itbRecv = globalIndexToReceive.begin(), itRecv, 117 iteRecv = globalIndexToReceive.end(); 116 118 int recvBuffSize = 0; 117 119 for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv) recvBuffSize += (itRecv->second).size();
Note: See TracChangeset
for help on using the changeset viewer.