Ignore:
Timestamp:
06/09/16 11:33:19 (8 years ago)
Author:
mhnguyen
Message:

Various clean up

+) Remove some redundant codes

Test
+) On Curie
+) tests pass

File:
1 edited

Legend:

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

    r866 r867  
    2222  This function computes the global indexes of grid source, which the grid destination is in demand. 
    2323  \param[in] elementPositionInGrid position of an element in a grid .E.g: if grid is composed of domain and axis (in order), 
    24                 then position of axis in grid is 2 (since a domain is considered to contain 2 elements (axis) 
    25   \param[in] gridDestGlobalDim global size of each dimension of grid source (all dimension must have the same size except of the one on which transformation is performed) 
    26   \param[in] gridSrcGlobalDim dimension size of source grid (it should share the same size for all dimension, maybe except the domain on which transformation is performed) 
    27   \param[in] globalLocalIndexGridDestSendToServer global and local index mapping of grid destination on the current client to send to server 
    28   \param[in/out] globaIndexWeightFromDestToSource mapping between transformed global index of grid destination 
    29              and the weighted value as well as global index from grid index source 
    30 */ 
    31 //void CGenericAlgorithmTransformation::computeGlobalSourceIndex(int elementPositionInGrid, 
    32 //                                                               const std::vector<int>& gridDestGlobalDim, 
    33 //                                                               const std::vector<int>& gridSrcGlobalDim, 
    34 //                                                               const GlobalLocalMap& globalLocalIndexGridDestSendToServer, 
    35 //                                                               DestinationIndexMap& globaIndexWeightFromDestToSource) 
    36 //{ 
    37 //  bool isTransPosEmpty = transformationPosition_.empty(); 
    38 //  for (size_t idxTrans = 0; idxTrans < transformationMapping_.size(); ++idxTrans) 
    39 //  { 
    40 //    TransformationIndexMap::const_iterator itbTransMap = transformationMapping_[idxTrans].begin(), itTransMap, 
    41 //                                                     iteTransMap = transformationMapping_[idxTrans].end(); 
    42 //    TransformationWeightMap::const_iterator itTransWeight = transformationWeight_[idxTrans].begin(); 
    43 // 
    44 //    // If transformation position exists 
    45 //    TransformationIndexMap::const_iterator itTransPos, iteTransPos; 
    46 //    if (!isTransPosEmpty) 
    47 //    { 
    48 //      itTransPos  = transformationPosition_[idxTrans].begin(), 
    49 //      iteTransPos = transformationPosition_[idxTrans].end(); 
    50 //    } 
    51 //    std::vector<int> emptyTransPos; 
    52 // 
    53 //    std::vector<std::vector<size_t> > globalIndexSrcGrid; 
    54 //    std::vector<std::pair<size_t,int> > globalLocalIndexDest; 
    55 //    for (itTransMap = itbTransMap; itTransMap != iteTransMap; ++itTransMap, ++itTransWeight) 
    56 //    { 
    57 //      if (!isTransPosEmpty) 
    58 //      { 
    59 //        this->computeGlobalGridIndexFromGlobalIndexElement(itTransMap->first, 
    60 //                                                           itTransMap->second, 
    61 //                                                           itTransPos->second, 
    62 //                                                           elementPositionInGrid, 
    63 //                                                           gridDestGlobalDim, 
    64 //                                                           gridSrcGlobalDim, 
    65 //                                                           globalLocalIndexGridDestSendToServer, 
    66 //                                                           globalLocalIndexDest, 
    67 //                                                           globalIndexSrcGrid); 
    68 //        ++itTransPos; 
    69 //      } 
    70 //      else 
    71 //      { 
    72 //        this->computeGlobalGridIndexFromGlobalIndexElement(itTransMap->first, 
    73 //                                                           itTransMap->second, 
    74 //                                                           emptyTransPos, 
    75 //                                                           elementPositionInGrid, 
    76 //                                                           gridDestGlobalDim, 
    77 //                                                           gridSrcGlobalDim, 
    78 //                                                           globalLocalIndexGridDestSendToServer, 
    79 //                                                           globalLocalIndexDest, 
    80 //                                                           globalIndexSrcGrid); 
    81 //      } 
    82 //      std::vector<std::pair<size_t,int> >::const_iterator it = globalLocalIndexDest.begin(), ite = globalLocalIndexDest.end(); 
    83 //      const std::vector<double>& currentVecWeight = itTransWeight->second; 
    84 // 
    85 //      for (size_t idx = 0; it != ite; ++it, ++idx) 
    86 //      { 
    87 //        size_t srcGridSize = globalIndexSrcGrid[idx].size(); 
    88 ////        globaIndexWeightFromDestToSource[(it->first)].resize(srcGridSize); 
    89 //        DestinationGlobalIndex& tmp = globaIndexWeightFromDestToSource[(it->first)]; 
    90 //        tmp.resize(srcGridSize); 
    91 //        for (int i = 0; i < srcGridSize; ++i) 
    92 //        { 
    93 //          tmp[i].first = it->second; 
    94 //          tmp[i].second = make_pair(globalIndexSrcGrid[idx][i], currentVecWeight[i]); 
    95 ////          globaIndexWeightFromDestToSource[(it->first)][i] = (make_pair(it->second, make_pair(globalIndexSrcGrid[idx][i], currentVecWeight[i]))); 
    96 //        } 
    97 //      } 
    98 //    } 
    99 //  } 
    100 //} 
    101  
    102 /*! 
    103   This function computes the global indexes of grid source, which the grid destination is in demand. 
    104   \param[in] elementPositionInGrid position of an element in a grid .E.g: if grid is composed of domain and axis (in order), 
    10524                then position of axis in grid is 1 and domain is positioned at 0. 
    10625  \param[in] gridSrc Grid source 
    10726  \param[in] gridDst Grid destination 
    108   \param[in] globaIndexWeightFromSrcToDst mapping of each global index source and weight to index destination 
     27  \param[in\out] globaIndexWeightFromSrcToDst mapping of each global index source and weight to index destination 
    10928*/ 
    11029void CGenericAlgorithmTransformation::computeGlobalSourceIndex(int elementPositionInGrid, 
Note: See TracChangeset for help on using the changeset viewer.