Changeset 687 for XIOS/trunk/src/transformation/grid_transformation.cpp
- Timestamp:
- 09/15/15 17:30:55 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/transformation/grid_transformation.cpp
r671 r687 58 58 59 59 gridSource_ = CGrid::createGrid(domainSrc, axisSrc, gridDestination_->axis_domain_order); 60 gridSourceDimensionSize_ = gridSource_->getGlobalDimension();61 gridDestinationDimensionSize_ = gridDestination_->getGlobalDimension();62 60 63 61 initializeMappingOfOriginalGridSource(); … … 77 75 78 76 CDistributionClient distribution(client->clientRank, originalGridSource_); 79 const std::vector<size_t>& globalIndexGrid DestSendToServer = distribution.getGlobalDataIndexSendToServer();80 81 weightOfGlobalIndexOfOriginalGridSource_.resize(globalIndexGrid DestSendToServer.size());82 globalIndexOfCurrentGridSource_ = globalIndexGrid DestSendToServer;83 globalIndexOfOriginalGridSource_ = globalIndexGrid DestSendToServer;77 const std::vector<size_t>& globalIndexGridSrcSendToServer = distribution.getGlobalDataIndexSendToServer(); 78 79 weightOfGlobalIndexOfOriginalGridSource_.resize(globalIndexGridSrcSendToServer.size()); 80 globalIndexOfCurrentGridSource_ = globalIndexGridSrcSendToServer; 81 globalIndexOfOriginalGridSource_ = globalIndexGridSrcSendToServer; 84 82 weightOfGlobalIndexOfOriginalGridSource_ = 1.0; 85 83 } … … 346 344 ite = listAlgos_.end(), it; 347 345 CGenericAlgorithmTransformation* algo = 0; 348 346 int nbAgloTransformation = 0; // Only count for executed transformation. Generate domain is a special one, not executed in the list 349 347 for (it = itb; it != ite; ++it) 350 348 { … … 358 356 algo = algoTransformation_.back(); 359 357 360 // Recalculate the distribution of grid destination 361 CDistributionClient distributionClientDest(client->clientRank, gridDestination_); 362 const std::vector<size_t>& globalIndexGridDestSendToServer = distributionClientDest.getGlobalDataIndexSendToServer(); 363 364 // ComputeTransformation of global index of each element 365 std::vector<int> gridDestinationDimensionSize = gridDestination_->getGlobalDimension(); 366 std::vector<int> gridSrcDimensionSize = gridSource_->getGlobalDimension(); 367 int elementPosition = it->first; 368 algo->computeGlobalSourceIndex(elementPosition, 369 gridDestinationDimensionSize, 370 gridSrcDimensionSize, 371 globalIndexGridDestSendToServer, 372 globaIndexWeightFromDestToSource); 373 374 // Compute transformation of global indexes among grids 375 computeTransformationFromOriginalGridSource(globaIndexWeightFromDestToSource); 376 377 // Now grid destination becomes grid source in a new transformation 378 setUpGrid(elementPositionInGrid, transType); 379 } 380 381 updateFinalGridDestination(); 382 computeFinalTransformationMapping(); 358 if (0 != algo) // Only registered transformation can be executed 359 { 360 // Recalculate the distribution of grid destination 361 CDistributionClient distributionClientDest(client->clientRank, gridDestination_); 362 const std::vector<size_t>& globalIndexGridDestSendToServer = distributionClientDest.getGlobalDataIndexSendToServer(); 363 364 // ComputeTransformation of global index of each element 365 std::vector<int> gridDestinationDimensionSize = gridDestination_->getGlobalDimension(); 366 std::vector<int> gridSrcDimensionSize = gridSource_->getGlobalDimension(); 367 int elementPosition = it->first; 368 algo->computeGlobalSourceIndex(elementPosition, 369 gridDestinationDimensionSize, 370 gridSrcDimensionSize, 371 globalIndexGridDestSendToServer, 372 globaIndexWeightFromDestToSource); 373 374 // Compute transformation of global indexes among grids 375 computeTransformationFromOriginalGridSource(globaIndexWeightFromDestToSource); 376 377 // Now grid destination becomes grid source in a new transformation 378 setUpGrid(elementPositionInGrid, transType); 379 ++nbAgloTransformation; 380 } 381 } 382 383 if (0 != nbAgloTransformation) 384 { 385 updateFinalGridDestination(); 386 computeFinalTransformationMapping(); 387 } 383 388 } 384 389
Note: See TracChangeset
for help on using the changeset viewer.