Changeset 2001


Ignore:
Timestamp:
01/05/21 10:03:56 (9 months ago)
Author:
ymipsl
Message:

Bug fix when introducing gridAlgorithm

YM

Location:
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algorithm_transformation_reduce.cpp

    r1999 r2001  
    1515  void CAlgorithmTransformationReduce::apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut) 
    1616  { 
    17    // CArray<double,1> dataOutTmp ; 
    18    // transformConnector_->transfer(dimBefore, dimAfter, dataIn, dataOutTmp) ; 
    1917    reduceTransformConnector_ -> transfer(dimBefore, dimAfter, dataIn, dataOut) ; 
    2018  } 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algorithm_transformation_reduce.hpp

    r1999 r2001  
    2626      EReduction operator_ ; 
    2727      TransformationIndexMap transformationMapping_; 
    28       CTransformConnector* transformConnector_ ; 
    2928      CReduceTransformConnector* reduceTransformConnector_ ; 
    3029      bool detectMissingValue_=true ; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algorithm_transformation_transfer.cpp

    r1999 r2001  
    88{ 
    99  
    10  void CAlgorithmTransformationTransfer::computeAlgorithm(CLocalView* srcView, CLocalView* dstView) 
    11  { 
    12    set<size_t> srcIndex ; 
    13    for(auto& it : transformationMapping_) srcIndex.insert(it.second) ; 
    14  
    15     CArray<size_t,1> srcArrayIndex(srcIndex.size()) ; 
    16     int i=0 ; 
    17     for(size_t index : srcIndex) { srcArrayIndex(i) = index ; i++ ;} 
    18     CLocalElement recvElement(CContext::getCurrent()->getIntraCommRank(), srcView->getGlobalSize(), srcArrayIndex) ; 
    19     recvElement.addFullView() ; 
    20  
    21     transformConnector_ = new CTransformConnector(srcView, recvElement.getView(CElementView::FULL), CContext::getCurrent()->getIntraComm())  ; 
    22     transformConnector_->computeConnector() ; 
    23     transferTransformConnector_ = new  CTransferTransformConnector( recvElement.getView(CElementView::FULL), dstView, transformationMapping_) ;  
     10  void CAlgorithmTransformationTransfer::computeAlgorithm(CLocalView* srcView, CLocalView* dstView) 
     11  { 
     12   this->computeRecvElement(srcView, dstView) ; 
     13   transferTransformConnector_ = new  CTransferTransformConnector( recvElement.getView(CElementView::FULL), dstView, transformationMapping_) ;  
    2414  } 
    2515  
     
    2717  void CAlgorithmTransformationTransfer::apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut) 
    2818  { 
    29     CArray<double,1> dataOutTmp ; 
    30     transformConnector_->transfer(dimBefore, dimAfter, dataIn, dataOutTmp) ;   
    31     transferTransformConnector_ -> transfer(dimBefore, dimAfter, dataOutTmp, dataOut) ;  
     19    transferTransformConnector_ -> transfer(dimBefore, dimAfter, dataOutIn, dataOut) ;  
    3220  } 
    3321   
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algorithm_transformation_transfer.hpp

    r1999 r2001  
    2323      //! Map between global index of destination element and source element 
    2424      unordered_map<int,int> transformationMapping_; 
    25      
    26       CTransformConnector* transformConnector_ ; 
    2725      CTransferTransformConnector* transferTransformConnector_ ; 
    2826  }; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algorithm_transformation_weight.cpp

    r1999 r2001  
    77 
    88  void CAlgorithmTransformationWeight::computeAlgorithm(CLocalView* srcView, CLocalView* dstView) 
    9  { 
     9  { 
    1010    this->computeRecvElement(srcView, dstView) ; 
    1111    weightTransformConnector_ = new  CWeightTransformConnector( recvElement_->getView(CElementView::FULL), dstView, transformationMapping_, transformationWeight_) ;  
     
    1515  void CAlgorithmTransformationWeight::apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut) 
    1616  { 
    17     CArray<double,1> dataOutTmp ; 
    18     transformConnector_->transfer(dimBefore, dimAfter, dataIn, dataOutTmp) ; 
    19     weightTransformConnector_ -> transfer(dimBefore, dimAfter, dataOutTmp, dataOut) ; 
     17    weightTransformConnector_ -> transfer(dimBefore, dimAfter, dataIn, dataOut) ; 
    2018  } 
    2119 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algorithm_transformation_weight.hpp

    r1999 r2001  
    2626      //! Weight corresponding of source to destination 
    2727      TransformationWeightMap transformationWeight_; 
    28       CTransformConnector* transformConnector_ ; 
    2928      CWeightTransformConnector* weightTransformConnector_ ; 
    3029       
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_algorithm.cpp

    r1999 r2001  
    33#include "grid_local_view.hpp" 
    44#include "grid.hpp" 
     5#include "algo_types.hpp" 
    56#include "context.hpp" 
    67 
     
    1112  : gridSrc_(gridSrc), gridDst_(gridDst), pos_(pos), algorithm_(algo) 
    1213  { 
     14    //! Scalar 
     15    CScalarAlgorithmReduceAxis::registerTrans(); 
     16    CScalarAlgorithmExtractAxis::registerTrans(); 
     17    CScalarAlgorithmReduceDomain::registerTrans(); 
     18    CScalarAlgorithmReduceScalar::registerTrans(); 
     19 
     20    //! Axis 
     21    CAxisAlgorithmZoom::registerTrans(); 
     22    CAxisAlgorithmExtractDomain::registerTrans(); 
     23    CAxisAlgorithmInterpolate::registerTrans(); 
     24    CAxisAlgorithmExtract::registerTrans(); 
     25    CAxisAlgorithmInverse::registerTrans(); 
     26    CAxisAlgorithmReduceDomain::registerTrans(); 
     27    CAxisAlgorithmReduceAxis::registerTrans(); 
     28    CAxisAlgorithmTemporalSplitting::registerTrans(); 
     29    CAxisAlgorithmDuplicateScalar::registerTrans(); 
     30 
     31    //! Domain 
     32    CDomainAlgorithmComputeConnectivity::registerTrans(); 
     33    CDomainAlgorithmInterpolate::registerTrans(); 
     34    CDomainAlgorithmZoom::registerTrans(); 
     35    CDomainAlgorithmExpand::registerTrans(); 
     36    CDomainAlgorithmReorder::registerTrans(); 
     37    CDomainAlgorithmExtract::registerTrans(); 
     38 
    1339    this->computeAlgorithm() ; 
    1440  } 
Note: See TracChangeset for help on using the changeset viewer.