Changeset 621 for XIOS/trunk/src/filter/grid_transformation.cpp
- Timestamp:
- 06/22/15 13:36:21 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/filter/grid_transformation.cpp
r620 r621 2 2 #include "axis_inverse.hpp" 3 3 #include "transformation_mapping.hpp" 4 #include "transformation_enum.hpp" 5 #include "axis_algorithm_transformation.hpp" 4 6 5 7 namespace xios { … … 86 88 if (axisListDestP[i]->hasTransformation()) 87 89 { 88 CGenericAlgorithmTransformation* algo = new CAxisInverse(axisListDestP[i], axisListSrcP[i]); 90 CGenericAlgorithmTransformation* algo = 0; 91 CAxis::TransMapTypes trans = axisListDestP[i]->getAllTransformations(); 92 CAxis::TransMapTypes::const_iterator itb = trans.begin(), it, 93 ite = trans.end(); 94 std::vector<ETranformationType> algoAxis; 95 for (it = itb; it != ite; ++it) 96 { 97 algoAxis.push_back(it->first); 98 } 99 algo = new CAxisAlgorithmTransformation(axisListDestP[i], axisListSrcP[i], algoAxis); 89 100 algoTransformation_[axisPositionInGrid[i]].push_back(algo); 90 101 } … … 98 109 } 99 110 111 /*! 112 Compute index mapping representing transformation between two grids 113 Each domain and each axis can contain some information of transformation, these information are then converted into 114 form of global index mapping reprensenting transformation between two grids. 115 */ 100 116 void CGridTransformation::computeTransformation() 101 117 { … … 122 138 } 123 139 140 /*! 141 Compute transformation mapping between grid source and grid destination 142 The transformation between grid source and grid destination is represented in form of mapping between global index 143 of two grids. Then local index mapping between data on each grid will be found out thanks to these global indexes 144 */ 124 145 void CGridTransformation::computeTransformationMapping() 125 146 { … … 141 162 CArray<size_t,1> globalIndexOnClientSrc = gridSource_->getDistributionClient()->getGlobalDataIndexSendToServer(); 142 163 143 144 164 std::vector<size_t>::const_iterator itbVec, itVec, iteVec; 145 165 CArray<size_t, 1>::iterator itbArr, itArr, iteArr; 146 166 147 167 std::map<int,std::vector<std::vector<size_t> > >::const_iterator itbMapRecv, itMapRecv, iteMapRecv; 168 148 169 // Find out local index on grid destination (received) 149 170 itbMapRecv = globalIndexToReceive.begin(); … … 166 187 { 167 188 int localIdx = std::distance(itbArr, itArr); 168 (*localIndexToReceiveOnGridDest_[sourceRank][i])(idx) = localIndexOnClientDest(localIdx); 189 // (*localIndexToReceiveOnGridDest_[sourceRank][i])(idx) = localIndexOnClientDest(localIdx); // Local index of un-extracted data (only domain) 190 (*localIndexToReceiveOnGridDest_[sourceRank][i])(idx) = (localIdx); // Local index of extracted data 169 191 } 170 192 } 171 193 } 172 173 194 } 174 195 … … 183 204 CArray<int,1>* ptr = new CArray<int,1>((itMap->second).size()); 184 205 localIndexToSendFromGridSource_[itMap->first] = ptr; 206 int destRank = itMap->first; 185 207 int vecSize = (itMap->second).size(); 186 208 for (int idx = 0; idx < vecSize; ++idx) … … 190 212 { 191 213 int localIdx = std::distance(itbArr, itArr); 192 (*localIndexToSendFromGridSource_[itMap->first])(idx) = localIndexOnClientSrc(localIdx); 193 } 194 } 195 } 196 } 197 214 // (*localIndexToSendFromGridSource_[destRank])(idx) = localIndexOnClientSrc(localIdx); 215 (*localIndexToSendFromGridSource_[destRank])(idx) = (localIdx); 216 } 217 } 218 } 219 } 220 221 /*! 222 Local index of data which need sending from the grid source 223 \return local index of data 224 */ 198 225 std::map<int, CArray<int,1>* > CGridTransformation::getLocalIndexToSendFromGridSource() 199 226 { … … 201 228 } 202 229 230 /*! 231 Local index of data which will be received on the grid destination 232 \return local index of data 233 */ 203 234 std::map<int, std::vector<CArray<int,1>* > > CGridTransformation::getLocalIndexToReceiveOnGridDest() 204 235 {
Note: See TracChangeset
for help on using the changeset viewer.