Changeset 1998


Ignore:
Timestamp:
12/17/20 13:18:57 (10 months ago)
Author:
ymipsl
Message:

Adapt transformation algorithm to new infrastructure (on going...)

YM

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

Legend:

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

    r1988 r1998  
    4444 
    4545CAxisAlgorithmDuplicateScalar::CAxisAlgorithmDuplicateScalar(bool isSource, CAxis* axisDestination, CScalar* scalarSource, CDuplicateScalarToAxis* algo) 
    46  : CAxisAlgorithmTransformation(isSource, axisDestination, scalarSource) 
     46 : CAlgorithmTransformationTransfer(isSource) 
    4747{ 
     48   
     49  CArray<int,1>& axisDstIndex = axisDest_->index; 
    4850 
     51  int nbAxisIdx = axisDstIndex.numElements(); 
     52  for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis) 
     53  { 
     54    int globalAxisIdx = axisDstIndex(idxAxis); 
     55    this->transformationMapping_[globalAxisIdx] = 0 ; 
     56  } 
     57 
     58  axisDestination->checkAttributes() ; 
     59  this->computeAlgorithm(scalarSource->getLocalView(CElementView::WORKFLOW), axisDestination->getLocalView(CElementView::WORKFLOW)) ; 
    4960} 
    5061 
     
    5465} 
    5566 
    56 void CAxisAlgorithmDuplicateScalar::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    57 TRY 
    58 { 
    59   this->transformationMapping_.resize(1); 
    60   this->transformationWeight_.resize(1); 
    61  
    62   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    63   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
    64  
    65   CArray<int,1>& axisDstIndex = axisDest_->index; 
    66  
    67   int nbAxisIdx = axisDstIndex.numElements(); 
    68   for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis) 
    69   { 
    70     int globalAxisIdx = axisDstIndex(idxAxis); 
    71     transMap[globalAxisIdx].resize(1); 
    72     transWeight[globalAxisIdx].resize(1); 
    73     transMap[globalAxisIdx][0] = 0 ; 
    74     transWeight[globalAxisIdx][0] = 1.0 ; 
    75   } 
    7667} 
    77 CATCH 
    78 } 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_duplicate_scalar.hpp

    r1988 r1998  
    1010#define __XIOS_AXIS_ALGORITHM_DUPLICATE_SCALAR_HPP__ 
    1111 
    12 #include "axis_algorithm_transformation.hpp" 
     12#include "algorithm_transformation_transfer.hpp" 
    1313#include "transformation.hpp" 
    1414 
     
    2424  Duplicate scalar into axis destination 
    2525*/ 
    26 class CAxisAlgorithmDuplicateScalar : public CAxisAlgorithmTransformation 
     26class CAxisAlgorithmDuplicateScalar : public CAlgorithmTransformationTransfer 
    2727{ 
    2828public: 
     
    3333  static bool registerTrans(); 
    3434 
    35 protected: 
    36   void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
    3735 
    3836private: 
     37 
     38  CAxis* axisSrc_; 
     39  CAxis* axisDest_; 
     40 
    3941  static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 
    4042                                                CTransformation<CAxis>* transformation, 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_extract.cpp

    r1988 r1998  
    4141 
    4242CAxisAlgorithmExtract::CAxisAlgorithmExtract(bool isSource, CAxis* axisDestination, CAxis* axisSource, CExtractAxis* extractAxis) 
    43 : CAxisAlgorithmTransformation(isSource, axisDestination, axisSource) 
     43: CAlgorithmTransformationTransfer(isSource), axisDest_(axisDestination), axisSrc_(axisSource) 
    4444TRY 
    4545{ 
     
    8383  if (axisSrc_->hasBounds) axisDest_->bounds.resize(2,nDest); 
    8484 
    85   this->transformationMapping_.resize(1); 
    86   this->transformationWeight_.resize(1); 
    87   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    88   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
     85  auto& transMap = this->transformationMapping_; 
    8986 
    9087  for (int iDest = 0; iDest < nDest; iDest++) 
     
    106103    indGloDest = axisDest_->index(iDest); 
    107104    indGloSrc = axisSrc_->index(iSrc); 
    108     transMap[indGloDest].push_back(indGloSrc); 
    109     transWeight[indGloDest].push_back(1.0); 
     105     
     106    transMap[indGloDest]=indGloSrc; 
    110107 
    111108  } 
     109 
     110  axisDestination->checkAttributes() ; 
     111 
     112  this->computeAlgorithm(axisSource->getLocalView(CElementView::WORKFLOW), axisDestination->getLocalView(CElementView::WORKFLOW)) ; 
    112113} 
    113114CATCH 
    114115 
    115 /*! 
    116   Compute the index mapping between domain on grid source and one on grid destination 
    117 */ 
    118 void CAxisAlgorithmExtract::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    119 { 
    120 } 
     116 
    121117 
    122118} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_extract.hpp

    r1988 r1998  
    66#define __XIOS_AXIS_ALGORITHM_EXTRACT_HPP__ 
    77 
    8 #include "axis_algorithm_transformation.hpp" 
     8#include "algorithm_transformation_transfer.hpp" 
    99#include "transformation.hpp" 
    1010 
     
    1919  Only this extracted region is extracted to write on Netcdf. 
    2020*/ 
    21 class CAxisAlgorithmExtract : public CAxisAlgorithmTransformation 
     21class CAxisAlgorithmExtract : public CAlgorithmTransformationTransfer 
    2222{ 
    2323public: 
     
    2727 
    2828  static bool registerTrans(); 
    29 protected: 
    30   void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
    3129 
    3230private: 
     
    4543 
    4644private: 
    47  
     45  CAxis* axisSrc_; 
     46  CAxis* axisDest_; 
    4847  static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 
    4948                                                CTransformation<CAxis>* transformation, 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_zoom.cpp

    r1988 r1998  
    4141 
    4242CAxisAlgorithmZoom::CAxisAlgorithmZoom(bool isSource, CAxis* axisDestination, CAxis* axisSource, CZoomAxis* zoomAxis) 
    43 : CAxisAlgorithmTransformation(isSource, axisDestination, axisSource) 
     43: CAlgorithmTransformationTransfer(isSource), axisDest_(axisDestination), axisSrc_(axisSource) 
    4444TRY 
    4545{ 
     
    8383  if (axisSrc_->hasBounds) axisDest_->bounds.resize(2,nDest); 
    8484 
    85   this->transformationMapping_.resize(1); 
    86   this->transformationWeight_.resize(1); 
    87   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    88   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
     85  auto& transMap = this->transformationMapping_; 
    8986 
    9087  for (int iDest = 0; iDest < nDest; iDest++) 
     
    106103    indGloDest = axisDest_->index(iDest); 
    107104    indGloSrc = axisSrc_->index(iSrc); 
    108     transMap[indGloDest].push_back(indGloSrc); 
    109     transWeight[indGloDest].push_back(1.0); 
     105    transMap[indGloDest]=indGloSrc; 
    110106 
    111107  } 
     108 
     109  axisDestination->checkAttributes() ; 
     110 
     111  this->computeAlgorithm(axisSource->getLocalView(CElementView::WORKFLOW), axisDestination->getLocalView(CElementView::WORKFLOW)) ; 
    112112} 
    113113CATCH 
    114114 
    115 /*! 
    116   Compute the index mapping between domain on grid source and one on grid destination 
    117 */ 
    118 void CAxisAlgorithmZoom::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    119 { 
    120 } 
    121115 
    122116} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_zoom.hpp

    r1988 r1998  
    66#define __XIOS_AXIS_ALGORITHM_ZOOM_HPP__ 
    77 
    8 #include "axis_algorithm_transformation.hpp" 
     8#include "algorithm_transformation_transfer.hpp" 
    99#include "transformation.hpp" 
    1010 
     
    1919  Only this zoomed region is zoomed to write on Netcdf. 
    2020*/ 
    21 class CAxisAlgorithmZoom : public CAxisAlgorithmTransformation 
     21class CAxisAlgorithmZoom : public CAlgorithmTransformationTransfer 
    2222{ 
    2323public: 
     
    2727 
    2828  static bool registerTrans(); 
    29 protected: 
    30   void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
    3129 
    3230private: 
     
    4543 
    4644private: 
     45   
     46  CAxis* axisSrc_; 
     47  CAxis* axisDest_; 
    4748 
    4849  static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_compute_connectivity.cpp

    r1988 r1998  
    4747CDomainAlgorithmComputeConnectivity::CDomainAlgorithmComputeConnectivity(bool isSource, CDomain* domainDestination, CDomain* domainSource, 
    4848                                                                         CComputeConnectivityDomain* compute_connectivityDomain) 
    49 : CDomainAlgorithmTransformation(isSource, domainDestination, domainSource) 
     49: CAlgorithmTransformationNoDataModification(isSource) 
    5050TRY 
    5151{ 
     
    103103CATCH 
    104104 
    105 /*! 
    106   Compute the index mapping between domain on grid source and one on grid destination 
    107 */ 
    108 void CDomainAlgorithmComputeConnectivity::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    109 { 
    110105} 
    111  
    112 } 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_compute_connectivity.hpp

    r1988 r1998  
    1010#define __XIOS_DOMAIN_ALGORITHM_COMPUTE_CONNECTIVITY_HPP__ 
    1111 
    12 #include "domain_algorithm_transformation.hpp" 
     12#include "algorithm_transformation_no_data_modification.hpp" 
    1313#include "transformation.hpp" 
    1414 
     
    2020  \class CDomainAlgorithmComputeConnectivity 
    2121*/ 
    22 class CDomainAlgorithmComputeConnectivity : public CDomainAlgorithmTransformation 
     22class CDomainAlgorithmComputeConnectivity : public CAlgorithmTransformationNoDataModification 
    2323{ 
    2424public: 
     
    2828 
    2929  static bool registerTrans(); 
    30 protected: 
    31   void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
    3230 
    3331protected: 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_expand.cpp

    r1988 r1998  
    5050                                               CDomain* domainSource, 
    5151                                               CExpandDomain* expandDomain) 
    52 : CDomainAlgorithmTransformation(isSource, domainDestination, domainSource), 
    53   isXPeriodic_(false), isYPeriodic_(false) 
     52: CAlgorithmTransformationTransfer(isSource), isXPeriodic_(false), isYPeriodic_(false) 
    5453TRY 
    5554{ 
     
    6160           << "Domain destination " <<domainDestination->getId() << std::endl); 
    6261  } 
    63  
    64   this->type_ = (ELEMENT_MODIFICATION_WITH_DATA); 
    6562  // Make sure domain source have all valid attributes 
    6663  // domainSource->checkAllAttributes(); 
     
    8279      break; 
    8380  } 
     81 
     82  domainDestination->checkAttributes() ; 
     83  this->computeAlgorithm(domainSource->getLocalView(CElementView::WORKFLOW), domainDestination->getLocalView(CElementView::WORKFLOW)) ; 
    8484} 
    8585CATCH 
     
    291291  // 1. Fill in array relating to global index (i_index, j_index, transmap, etc, ...) 
    292292  // Global index mapping between destination and source 
    293   this->transformationMapping_.resize(1); 
    294   this->transformationWeight_.resize(1); 
    295   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    296   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
    297  
    298   transMap.rehash(std::ceil(newNbLocalDst/transMap.max_load_factor())); 
    299   transWeight.rehash(std::ceil(newNbLocalDst/transWeight.max_load_factor())); 
     293   
     294  transformationMapping_.rehash(std::ceil(newNbLocalDst/transformationMapping_.max_load_factor())); 
    300295   
    301296  // Index mapping for local domain 
     
    311306    globalIndexSrcOnDstDomain(idx) = globIndexSrc; 
    312307 
    313     transMap[globIndexDst].push_back(globIndexSrc); 
    314     transWeight[globIndexDst].push_back(1.0);  
     308    transformationMapping_[globIndexDst] = globIndexSrc; 
    315309  } 
    316310 
     
    569563  // 1. Fill in array relating to global index (i_index, j_index, transmap, etc, ...) 
    570564  // Global index mapping between destination and source 
    571   this->transformationMapping_.resize(1); 
    572   this->transformationWeight_.resize(1); 
    573   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    574   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
    575  
    576   transMap.rehash(std::ceil(newNbLocalDst/transMap.max_load_factor())); 
    577   transWeight.rehash(std::ceil(newNbLocalDst/transWeight.max_load_factor())); 
     565   
     566  transformationMapping_.rehash(std::ceil(newNbLocalDst/transformationMapping_.max_load_factor())); 
    578567  // First, index mapping for local domain 
    579568  for (int idx = 0; idx < oldNbLocal; ++idx) 
    580569  { 
    581570    index = i_index_dst(idx); 
    582     transMap[index].push_back(index); 
    583     transWeight[index].push_back(1.0); 
     571    transformationMapping_[index] = index ; 
    584572  } 
    585573  // Then, index mapping for extended part 
     
    590578    i_index_dst(index) = globalIndex; 
    591579    j_index_dst(index) = 0; 
    592     transMap[globalIndex].push_back(globalIndex); 
    593     transWeight[globalIndex].push_back(1.0); 
     580    transformationMapping_[globalIndex]=globalIndex; 
    594581  } 
    595582 
     
    704691CATCH 
    705692 
    706 /*! 
    707   Compute the index mapping between domain on grid source and one on grid destination 
    708 */ 
    709 void CDomainAlgorithmExpand::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    710 { 
    711  
    712 } 
    713  
    714 } 
     693 
     694} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_expand.hpp

    r1988 r1998  
    1010#define __XIOS_DOMAIN_ALGORITHM_EXPAND_HPP__ 
    1111 
    12 #include "domain_algorithm_transformation.hpp" 
     12#include "algorithm_transformation_transfer.hpp" 
    1313#include "transformation.hpp" 
    1414 
     
    2020  \class CDomainAlgorithmExpand 
    2121*/ 
    22 class CDomainAlgorithmExpand : public CDomainAlgorithmTransformation 
     22class CDomainAlgorithmExpand : public CAlgorithmTransformationTransfer 
    2323{ 
    2424public: 
     
    4444                                          CArray<int,2>& neighborsDomainSrc); 
    4545 
    46 protected: 
    47   void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
    48  
    4946private: 
    5047  static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_extract.cpp

    r1988 r1998  
    3838 
    3939CDomainAlgorithmExtract::CDomainAlgorithmExtract(bool isSource, CDomain* domainDestination, CDomain* domainSource, CExtractDomain* extractDomain) 
    40 : CDomainAlgorithmTransformation(isSource, domainDestination, domainSource) 
     40: CAlgorithmTransformationTransfer(isSource), domainSrc_(domainSource), domainDest_(domainDestination) 
    4141TRY 
    4242{ 
     
    151151  } 
    152152  if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest); 
    153  
    154   this->transformationMapping_.resize(1); 
    155   this->transformationWeight_.resize(1); 
    156   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    157   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
    158  
     153   
    159154  for (int iDest = 0; iDest < niDest; iDest++) 
    160155  { 
     
    219214      } 
    220215 
    221       transMap[indGloDest].push_back(indGloSrc); 
    222       transWeight[indGloDest].push_back(1.0); 
     216      transformationMapping_[indGloDest]=indGloSrc; 
    223217 
    224218    } 
     
    242236CATCH 
    243237 
    244 /*! 
    245   Compute the index mapping between domain on grid source and one on grid destination 
    246 */ 
    247 void CDomainAlgorithmExtract::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    248 { 
    249 } 
    250  
    251  
    252 } 
     238 
     239} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_extract.hpp

    r1988 r1998  
    33#define __XIOS_DOMAIN_ALGORITHM_EXTRACT_HPP__ 
    44 
    5 #include "domain_algorithm_transformation.hpp" 
    65#include "transformation.hpp" 
     6#include "algorithm_transformation_transfer.hpp" 
    77 
    88namespace xios { 
     
    1515  Implementing extract (alternative zoom) on domain 
    1616*/ 
    17 class CDomainAlgorithmExtract : public CDomainAlgorithmTransformation 
     17class CDomainAlgorithmExtract : public CAlgorithmTransformationTransfer 
    1818{ 
    1919public: 
     
    2323 
    2424  static bool registerTrans(); 
    25 protected: 
    26   void updateDomainAttributes(); 
    27   void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
    28  
    29 private: 
    30   void updateExtract(); 
    3125 
    3226private: 
     
    4236  int extractNi_; 
    4337  int extractNj_; 
     38   
     39  CDomain* domainSrc_ ; 
     40  CDomain* domainDest_ ; 
    4441 
    4542private: 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_generate_rectilinear.cpp

    r1988 r1998  
    5454                                                                         CGrid* gridDest, CGrid* gridSource, 
    5555                                                                         CGenerateRectilinearDomain* genRectDomain) 
    56 : CDomainAlgorithmTransformation(isSource, domainDestination, domainSource), nbDomainDistributedPart_(0) 
     56: CAlgorithmTransformationNoDataModification(isSource), nbDomainDistributedPart_(0), domainDest_(domainDestination) 
    5757TRY 
    5858{ 
    59   type_ = ELEMENT_GENERATION; 
    6059  genRectDomain->checkValid(domainDestination); 
    6160  if (0 != gridSource) computeDistributionGridSource(gridSource); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_generate_rectilinear.hpp

    r1988 r1998  
    1010#define __XIOS_DOMAIN_ALGORITHM_GENERATE_RECTILINEAR_HPP__ 
    1111 
    12 #include "domain_algorithm_transformation.hpp" 
     12#include "algorithm_transformation_no_data_modification.hpp" 
    1313#include "transformation.hpp" 
    1414 
     
    2525  The number of processes is deduced from the distribution of the grid source. 
    2626*/ 
    27 class CDomainAlgorithmGenerateRectilinear : public CDomainAlgorithmTransformation 
     27class CDomainAlgorithmGenerateRectilinear : public CAlgorithmTransformationNoDataModification 
    2828{ 
    2929public: 
     
    5353private: 
    5454  int nbDomainDistributedPart_; //! Number of local domain. 
     55  CDomain* domainDest_ ; 
    5556 
    5657  static bool dummyRegistered_; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_interpolate.cpp

    r1988 r1998  
    5353 
    5454CDomainAlgorithmInterpolate::CDomainAlgorithmInterpolate(bool isSource, CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain) 
    55 : CDomainAlgorithmTransformation(isSource, domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false), readFromFile_(false) 
     55: CAlgorithmTransformationWeight(isSource), interpDomain_(interpDomain), writeToFile_(false), readFromFile_(false), domainSrc_(domainSource), domainDest_(domainDestination) 
    5656TRY 
    5757{ 
     
    9797 
    9898  writeToFile_ = interpDomain_->write_weight;   
     99  domainDestination->checkAttributes() ; 
     100   
     101  if (readFromFile_)  readRemapInfo(); 
     102  else computeRemap();  
     103 
     104    this->computeAlgorithm(domainSource->getLocalView(CElementView::WORKFLOW), domainDestination->getLocalView(CElementView::WORKFLOW)) ; 
    99105     
    100106} 
     
    504510CATCH 
    505511 
    506 /*! 
    507   Compute the index mapping between domain on grid source and one on grid destination 
    508 */ 
    509 void CDomainAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    510 TRY 
    511 { 
    512   if (readFromFile_)   
    513     readRemapInfo(); 
    514   else 
    515   { 
    516     computeRemap();  
    517   } 
    518 } 
    519 CATCH 
    520512 
    521513void CDomainAlgorithmInterpolate::writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
     
    542534  int clientRank = context->intraCommRank_; 
    543535 
    544   this->transformationMapping_.resize(1); 
    545   this->transformationWeight_.resize(1); 
    546  
    547   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    548   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
     536  TransformationIndexMap& transMap = this->transformationMapping_; 
     537  TransformationWeightMap& transWeight = this->transformationWeight_; 
    549538 
    550539  std::map<int,std::vector<std::pair<int,double> > >::const_iterator itb = interpMapValue.begin(), it, 
     
    573562  int nbClient = context-> intraCommSize_; 
    574563 
    575   this->transformationMapping_.resize(1); 
    576   this->transformationWeight_.resize(1); 
    577  
    578   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    579   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
     564  TransformationIndexMap& transMap = this->transformationMapping_; 
     565  TransformationWeightMap& transWeight = this->transformationWeight_; 
    580566 
    581567  std::unordered_map<size_t,int> globalIndexOfDomainDest; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_interpolate.hpp

    r1988 r1998  
    1010#define __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_HPP__ 
    1111 
    12 #include "domain_algorithm_transformation.hpp" 
     12#include "algorithm_transformation_weight.hpp" 
    1313#include "transformation.hpp" 
    1414#include "nc4_data_output.hpp" 
     
    2424  Reading interpolation from file then apply on a domain 
    2525*/ 
    26 class CDomainAlgorithmInterpolate : public CDomainAlgorithmTransformation 
     26class CDomainAlgorithmInterpolate : public CAlgorithmTransformationWeight 
    2727{ 
    2828public: 
     
    3939 
    4040  static bool registerTrans(); 
    41 protected: 
    42   void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
    4341 
    4442private: 
     
    9896                                                std::map<int, int>& elementPositionInGridDst2DomainPosition); 
    9997  static bool dummyRegistered_; 
     98 
     99  CDomain* domainSrc_ ; 
     100  CDomain* domainDest_ ; 
     101 
    100102}; 
    101103 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp

    r1988 r1998  
    4141 
    4242CDomainAlgorithmReorder::CDomainAlgorithmReorder(bool isSource, CDomain* domainDestination, CDomain* domainSource, CReorderDomain* reorderDomain) 
    43 : CDomainAlgorithmTransformation(isSource, domainDestination, domainSource) 
     43: CAlgorithmTransformationNoDataModification(isSource) 
    4444TRY 
    4545{ 
     
    118118CATCH 
    119119 
    120 /*! 
    121   Compute the index mapping between domain on grid source and one on grid destination 
    122 */ 
    123 void CDomainAlgorithmReorder::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    124 { 
    125 /* 
    126   this->transformationMapping_.resize(1); 
    127   this->transformationWeight_.resize(1); 
    128  
    129   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    130   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
    131 */ 
    132 } 
    133  
    134120 
    135121} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.hpp

    r1988 r1998  
    55#define __XIOS_DOMAIN_ALGORITHM_REORDER_HPP__ 
    66 
    7 #include "domain_algorithm_transformation.hpp" 
     7#include "algorithm_transformation_no_data_modification.hpp" 
    88#include "transformation.hpp" 
    99 
    10 namespace xios { 
     10namespace xios  
     11{ 
    1112 
    12 class CDomain; 
    13 class CReorderDomain; 
     13  class CDomain; 
     14  class CReorderDomain; 
    1415 
    15 /*! 
    16   \class CDomainAlgorithmReorder 
    17   Reordering data on domain 
    18 */ 
    19 class CDomainAlgorithmReorder : public CDomainAlgorithmTransformation 
    20 { 
    21 public: 
    22   CDomainAlgorithmReorder(bool isSource, CDomain* domainDestination, CDomain* domainSource, CReorderDomain* reorderDomain); 
     16  /*! 
     17    \class CDomainAlgorithmReorder 
     18    Reordering data on domain 
     19  */ 
     20  class CDomainAlgorithmReorder : public CAlgorithmTransformationNoDataModification   
     21  { 
     22    public: 
     23      CDomainAlgorithmReorder(bool isSource, CDomain* domainDestination, CDomain* domainSource, CReorderDomain* reorderDomain); 
    2324 
    24   virtual ~CDomainAlgorithmReorder() {} 
     25      virtual ~CDomainAlgorithmReorder() {} 
    2526 
    26   static bool registerTrans(); 
     27      static bool registerTrans(); 
    2728 
    28 protected: 
    29   void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
     29    private: 
    3030 
    31  
    32 private: 
    33  
    34   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 
    35                                                 CTransformation<CDomain>* transformation, 
    36                                                 int elementPositionInGrid, 
    37                                                 std::map<int, int>& elementPositionInGridSrc2ScalarPosition, 
    38                                                 std::map<int, int>& elementPositionInGridSrc2AxisPosition, 
    39                                                 std::map<int, int>& elementPositionInGridSrc2DomainPosition, 
    40                                                 std::map<int, int>& elementPositionInGridDst2ScalarPosition, 
    41                                                 std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    42                                                 std::map<int, int>& elementPositionInGridDst2DomainPosition); 
    43   static bool dummyRegistered_; 
     31      static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 
     32                                                     CTransformation<CDomain>* transformation, 
     33                                                     int elementPositionInGrid, 
     34                                                     std::map<int, int>& elementPositionInGridSrc2ScalarPosition, 
     35                                                     std::map<int, int>& elementPositionInGridSrc2AxisPosition, 
     36                                                     std::map<int, int>& elementPositionInGridSrc2DomainPosition, 
     37                                                     std::map<int, int>& elementPositionInGridDst2ScalarPosition, 
     38                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
     39                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition); 
     40      static bool dummyRegistered_; 
    4441}; 
    4542 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_zoom.cpp

    r1988 r1998  
    3838 
    3939CDomainAlgorithmZoom::CDomainAlgorithmZoom(bool isSource, CDomain* domainDestination, CDomain* domainSource, CZoomDomain* zoomDomain) 
    40 : CDomainAlgorithmTransformation(isSource, domainDestination, domainSource) 
     40: CAlgorithmTransformationTransfer(isSource), domainSrc_(domainSource), domainDest_(domainDestination) 
    4141TRY 
    4242{ 
     
    175175  if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest); 
    176176 
    177   this->transformationMapping_.resize(1); 
    178   this->transformationWeight_.resize(1); 
    179   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    180   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
    181177 
    182178  for (int iDest = 0; iDest < niDest; iDest++) 
     
    252248      } 
    253249 
    254       transMap[indGloDest].push_back(indGloSrc); 
    255       transWeight[indGloDest].push_back(1.0); 
     250      transformationMapping_[indGloDest]=indGloSrc; 
     251 
    256252    } 
    257253 
     
    276272 
    277273  domainDestination->checkAttributes() ; 
     274 
    278275  this->computeAlgorithm(domainSource->getLocalView(CElementView::WORKFLOW), domainDestination->getLocalView(CElementView::WORKFLOW)) ; 
    279276   
     
    281278CATCH 
    282279 
    283 /*! 
    284   Compute the index mapping between domain on grid source and one on grid destination 
    285 */ 
    286 void CDomainAlgorithmZoom::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    287 { 
    288 } 
    289  
    290  
    291 } 
     280} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_zoom.hpp

    r1988 r1998  
    33#define __XIOS_DOMAIN_ALGORITHM_ZOOM_HPP__ 
    44 
    5 #include "domain_algorithm_transformation.hpp" 
     5#include "algorithm_transformation_transfer.hpp" 
    66#include "transformation.hpp" 
    77 
     
    1515  Implementing zoom (alternative zoom) on domain 
    1616*/ 
    17 class CDomainAlgorithmZoom : public CDomainAlgorithmTransformation 
     17class CDomainAlgorithmZoom : public CAlgorithmTransformationTransfer 
    1818{ 
    1919public: 
     
    2525protected: 
    2626  void updateDomainAttributes(); 
    27   void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
    28  
     27  
    2928private: 
    3029  void updateZoom(); 
     
    4241  int zoomNi_; 
    4342  int zoomNj_; 
     43  CDomain* domainSrc_ ; 
     44  CDomain* domainDest_ ; 
    4445 
    4546private: 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.hpp

    r1988 r1998  
    5252 
    5353public: 
    54   CGenericAlgorithmTransformation(); 
     54  //CGenericAlgorithmTransformation(); 
    5555  CGenericAlgorithmTransformation(bool isSource); 
    5656 
     
    100100 
    101101protected: 
    102   virtual void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >&) = 0; 
     102  virtual void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >&) {}; 
    103103 
    104104  /*! 
     
    110110  virtual void computeExchangeGlobalIndex(const CArray<size_t,1>& globalElementIndex, 
    111111                                          int elementType, 
    112                                           CClientClientDHTInt::Index2VectorInfoTypeMap& globalElementIndexOnProc) = 0; 
     112                                          CClientClientDHTInt::Index2VectorInfoTypeMap& globalElementIndexOnProc){}; 
    113113 
    114114protected: 
     
    181181  public :  
    182182   
    183     void computeAlgorithm(CLocalView* srcView, CLocalView* dstView) ; 
    184     void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut); 
     183    virtual void computeAlgorithm(CLocalView* srcView, CLocalView* dstView) ; 
     184    virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut); 
    185185     
    186186    CTransformConnector* transformConnector_ ; 
Note: See TracChangeset for help on using the changeset viewer.