Ignore:
Timestamp:
12/06/20 22:14:56 (4 years ago)
Author:
ymipsl
Message:

intermediate commit for new tranformation engine?
YM

Location:
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation
Files:
9 added
46 deleted
2 edited

Legend:

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

    r1784 r1984  
    1414#include "timer.hpp" 
    1515#include "mpi.hpp" 
    16  
    17 namespace xios { 
     16#include "transform_connector.hpp" 
     17#include "weight_transform_connector.hpp" 
     18 
     19namespace xios  
     20{ 
    1821 
    1922CGenericAlgorithmTransformation::CGenericAlgorithmTransformation() 
     
    11351138CATCH 
    11361139 
    1137 } 
     1140 
     1141/////////////////////////////////////////////////////////////// 
     1142////////// new algorithm for new method               ///////// 
     1143/////////////////////////////////////////////////////////////// 
     1144 
     1145 
     1146 
     1147void CGenericAlgorithmTransformation::computeAlgorithm(CLocalView* srcView, CLocalView* dstView) 
     1148{ 
     1149  auto& srcMap = transformationMapping_[0] ; 
     1150  set<size_t> srcIndex ; 
     1151  for(auto& it : srcMap) 
     1152    for(size_t index : it.second) srcIndex.insert(index) ; 
     1153 
     1154  CArray<size_t,1> srcArrayIndex(srcIndex.size()) ; 
     1155  int i=0 ; 
     1156  for(size_t index : srcIndex) { srcArrayIndex(i) = index ; i++ ;} 
     1157  CLocalElement recvElement(CContext::getCurrent()->getIntraCommRank(), srcView->getGlobalSize(), srcArrayIndex) ; 
     1158  recvElement.addFullView() ; 
     1159 
     1160  transformConnector_ = new CTransformConnector(srcView, recvElement.getView(CElementView::FULL), CContext::getCurrent()->getIntraComm())  ; 
     1161  transformConnector_->computeConnector() ; 
     1162  weightTransformConnector_ = new  CWeightTransformConnector( recvElement.getView(CElementView::FULL), dstView, transformationMapping_[0], transformationWeight_[0]) ;  
     1163} 
     1164  
     1165 
     1166void CGenericAlgorithmTransformation::apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut) 
     1167{ 
     1168  CArray<double,1> dataOutTmp ; 
     1169  transformConnector_->transfer(dimBefore, dimAfter, dataIn, dataOutTmp) ; 
     1170  weightTransformConnector_ -> transfer(dimBefore, dimAfter, dataOutTmp, dataOut) ; 
     1171} 
     1172 
     1173 
     1174 
     1175 
     1176 
     1177 
     1178} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.hpp

    r1637 r1984  
    1414#include "array_new.hpp" 
    1515#include "client_client_dht_template.hpp" 
     16#include "local_view.hpp" 
     17#include "transform_connector.hpp" 
     18#include "weight_transform_connector.hpp" 
    1619 
    17 namespace xios { 
     20namespace xios 
     21{ 
    1822  class CGrid; 
    1923  class CDomain; 
     
    169173  bool eliminateRedondantSrc_ ; // flag to indicate if the transformation must select only one global source point for all proc. 
    170174                               // In this case it will choose preferentially the current process  
     175 
     176   
     177// new methods for new algorithm 
     178 
     179  public :  
     180   
     181    void computeAlgorithm(CLocalView* srcView, CLocalView* dstView) ; 
     182    void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut); 
     183     
     184    CTransformConnector* transformConnector_ ; 
     185    CWeightTransformConnector* weightTransformConnector_ ; 
     186 
    171187}; 
    172188 
Note: See TracChangeset for help on using the changeset viewer.