- Timestamp:
- 07/05/16 15:59:02 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/transformation/generic_algorithm_transformation.cpp
r871 r887 84 84 std::vector<CAxis*> axisListDestP = gridDst->getAxis(); 85 85 std::vector<CDomain*> domainListDestP = gridDst->getDomains(); 86 CArray< bool,1> axisDomainDstOrder = gridDst->axis_domain_order;86 CArray<int,1> axisDomainDstOrder = gridDst->axis_domain_order; 87 87 std::vector<CAxis*> axisListSrcP = gridSrc->getAxis(); 88 88 std::vector<CDomain*> domainListSrcP = gridSrc->getDomains(); … … 96 96 if (idx == elementPositionInGrid) 97 97 computeExchangeGlobalIndex(indexSrc, globalIndexOfTransformedElementOnProc); //globalElementIndexOnProc[idx]); 98 if ( axisDomainDstOrder(idx)) // It's domain98 if (2 == axisDomainDstOrder(idx)) // It's domain 99 99 { 100 100 if (idx != elementPositionInGrid) … … 106 106 107 107 } 108 else //it's an axis108 else if (1 == axisDomainDstOrder(idx))//it's an axis 109 109 { 110 110 if (idx != elementPositionInGrid) … … 226 226 SourceDestinationIndexMap& globaIndexWeightFromSrcToDst) 227 227 { 228 std::vector<CDomain*> domainListSrcP = gridSrc->getDomains(); 229 std::vector<CAxis*> axisListSrcP = gridSrc->getAxis(); 230 std::vector<CScalar*> scalarListSrcP = gridSrc->getScalars(); 231 CArray<int,1> axisDomainSrcOrder = gridSrc->axis_domain_order; 232 233 size_t nbElement = axisDomainSrcOrder.numElements(); 234 std::vector<size_t> nGlobSrc(nbElement); 235 size_t globalSrcSize = 1; 236 int domainIndex = 0, axisIndex = 0, scalarIndex = 0; 237 for (int idx = 0; idx < nbElement; ++idx) 238 { 239 nGlobSrc[idx] = globalSrcSize; 240 int elementDimension = axisDomainSrcOrder(idx); 241 242 // If this is a domain 243 if (2 == elementDimension) 244 { 245 globalSrcSize *= domainListSrcP[domainIndex]->nj_glo.getValue() * domainListSrcP[domainIndex]->ni_glo.getValue(); 246 ++domainIndex; 247 } 248 else if (1 == elementDimension) // So it's an axis 249 { 250 globalSrcSize *= axisListSrcP[axisIndex]->n_glo.getValue(); 251 ++axisIndex; 252 } 253 else 254 { 255 globalSrcSize *= 1; 256 ++scalarIndex; 257 } 258 } 259 260 std::vector<CDomain*> domainListDestP = gridDst->getDomains(); 228 261 std::vector<CAxis*> axisListDestP = gridDst->getAxis(); 229 std::vector<CDomain*> domainListDestP = gridDst->getDomains(); 230 CArray<bool,1> axisDomainDstOrder = gridDst->axis_domain_order; 231 std::vector<CAxis*> axisListSrcP = gridSrc->getAxis(); 232 std::vector<CDomain*> domainListSrcP = gridSrc->getDomains(); 233 CArray<bool,1> axisDomainSrcOrder = gridDst->axis_domain_order; 234 size_t nbElement = axisDomainSrcOrder.numElements(); 235 std::vector<size_t> nGlobSrc(nbElement), nGlobDst(nbElement); 236 size_t globalSrcSize = 1, globalDstSize = 1; 237 int domainIndex = 0; 238 int axisIndex = 0; 262 std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); 263 CArray<int,1> axisDomainDstOrder = gridDst->axis_domain_order; 264 265 std::vector<size_t> nGlobDst(nbElement); 266 size_t globalDstSize = 1; 267 domainIndex = axisIndex = scalarIndex = 0; 239 268 for (int idx = 0; idx < nbElement; ++idx) 240 269 { 241 nGlobSrc[idx] = globalSrcSize;242 270 nGlobDst[idx] = globalDstSize; 243 bool isDomain = axisDomainSrcOrder(idx);271 int elementDimension = axisDomainSrcOrder(idx); 244 272 245 273 // If this is a domain 246 if (isDomain) 247 { 248 globalSrcSize *= domainListSrcP[domainIndex]->nj_glo.getValue() * domainListSrcP[domainIndex]->ni_glo.getValue(); 274 if (2 == elementDimension) 275 { 249 276 globalDstSize *= domainListDestP[domainIndex]->nj_glo.getValue() * domainListDestP[domainIndex]->ni_glo.getValue(); 250 277 ++domainIndex; 251 278 } 252 else // So it's an axis 253 { 254 globalSrcSize *= axisListSrcP[axisIndex]->n_glo.getValue(); 279 else if (1 == elementDimension) // So it's an axis 280 { 255 281 globalDstSize *= axisListDestP[axisIndex]->n_glo.getValue(); 256 282 ++axisIndex; 283 } 284 else 285 { 286 globalDstSize *= 1; 287 ++scalarIndex; 257 288 } 258 289 }
Note: See TracChangeset
for help on using the changeset viewer.