Changeset 2007


Ignore:
Timestamp:
01/07/21 11:52:55 (9 months ago)
Author:
ymipsl
Message:
  • fix some problem in transformation
  • implement new temporal splitting transformation

YM

Location:
XIOS/dev/dev_ym/XIOS_COUPLING/src
Files:
7 added
18 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/transform_filter.hpp

    r1999 r2007  
    2222      */ 
    2323      CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data) ; 
    24       void apply(const CArray<double, 1>& dataSrc, CArray<double,1>& dataDest); 
    25  
    26     private : 
     24//      void apply(const CArray<double, 1>& dataSrc, CArray<double,1>& dataDest); 
    2725      
    28      CGridAlgorithm* algorithm_ ; 
    29      bool detectMissingValues_ ; 
    30      bool defaultValue_ ; 
     26      CGridAlgorithm* algorithm_ ; 
     27      bool detectMissingValues_ ; 
     28      bool defaultValue_ ; 
    3129 
    3230  }; // class CTransformFilter 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.hpp

    r1984 r2007  
    146146        CGenericAlgorithmTransformation* transformationAlgorithm_ = nullptr ; 
    147147      public: 
    148         void setTransformationAlgorithm(CGenericAlgorithmTransformation* transformationAlgorithm) { transformationAlgorithm=transformationAlgorithm ;} 
     148        void setTransformationAlgorithm(CGenericAlgorithmTransformation* transformationAlgorithm) { transformationAlgorithm_=transformationAlgorithm ;} 
    149149        CGenericAlgorithmTransformation* getTransformationAlgorithm(void) { return transformationAlgorithm_ ;}    
    150150      private: 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp

    r2002 r2007  
    2727#include "transform_filter.hpp" 
    2828#include "grid_algorithm.hpp" 
     29#include "grid_algorithm_generic.hpp" 
     30#include "generic_algorithm_transformation.hpp" 
     31#include "algo_types.hpp" 
    2932 
    3033 
     
    17041707  TRY 
    17051708  { 
     1709    registerAlgorithmTransformation() ; // needed to enable self-registration of the transformations 
     1710                                        // big mystery why it doesn't work witout that... 
     1711                                        // problem with the linker ??  
     1712     
    17061713    std::shared_ptr<CFilter> inputFilter = std::shared_ptr<CPassThroughFilter>(new CPassThroughFilter(gc)); 
    17071714    std::shared_ptr<CFilter> outputFilter = inputFilter ; 
    1708      
     1715 
     1716 
    17091717    string newId ; 
    17101718    if (gridSrc!=nullptr) newId = gridSrc->getId() + " --> " + this->getId()  ; 
     
    19191927        else gridAlgorithm = newGrid->getGridAlgorithm() ; 
    19201928 
    1921         shared_ptr<CTransformFilter> transformFilter = shared_ptr<CTransformFilter>(new CTransformFilter(gc, gridAlgorithm, detectMissingValues, defaultValue)) ; 
     1929        shared_ptr<CTransformFilter> transformFilter = shared_ptr<CTransformFilter>(gridAlgorithm->createTransformFilter(gc, detectMissingValues, defaultValue)) ; 
    19221930        outputFilter->connectOutput(transformFilter,0) ; 
    19231931        outputFilter = transformFilter ; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algo_types.hpp

    r2002 r2007  
    3434#include "domain_algorithm_extract.hpp" 
    3535 
    36  
    37  
     36namespace xios 
     37{ 
     38  void registerAlgorithmTransformation(void) ; 
     39} 
    3840 
    3941 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algorithm_transformation_no_data_modification.cpp

    r1997 r2007  
    11#include "algorithm_transformation_no_data_modification.hpp" 
     2#include "grid_algorithm_no_data_modification.hpp" 
     3#include "grid.hpp" 
    24 
    35namespace xios 
     
    810  } 
    911   
     12  CGridAlgorithm* CAlgorithmTransformationNoDataModification::createGridAlgorithm(CGrid* gridSrc, CGrid* gridDst, int pos) 
     13  { 
     14    return new CGridAlgorithmNoDataModification(this) ; 
     15  } 
    1016} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algorithm_transformation_no_data_modification.hpp

    r1997 r2007  
    1515      virtual ~CAlgorithmTransformationNoDataModification() {}; 
    1616      virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut); 
     17      virtual CGridAlgorithm* createGridAlgorithm(CGrid* gridSrc, CGrid* newGrid, int pos) ; 
    1718  }; 
    1819 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algorithm_transformation_reduce.hpp

    r2001 r2007  
    1818      virtual ~CAlgorithmTransformationReduce() {}; 
    1919      virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut); 
    20       void computeRecvElement(CLocalView* srcView, CLocalView* dstView) ; 
     20      virtual void computeRecvElement(CLocalView* srcView, CLocalView* dstView) ; 
    2121       
    2222    protected: 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algorithm_transformation_transfer.hpp

    r2001 r2007  
    1616      virtual ~CAlgorithmTransformationTransfer() {}; 
    1717      virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut); 
    18       void computeRecvElement(CLocalView* srcView, CLocalView* dstView) ; 
     18      virtual void computeRecvElement(CLocalView* srcView, CLocalView* dstView) ; 
    1919    
    2020    protected: 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algorithm_transformation_weight.hpp

    r2001 r2007  
    1818      virtual ~CAlgorithmTransformationWeight() {}; 
    1919      virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut); 
    20       void computeRecvElement(CLocalView* srcView, CLocalView* dstView); 
     20      virtual void computeRecvElement(CLocalView* srcView, CLocalView* dstView); 
    2121    protected: 
    2222      virtual void computeAlgorithm(CLocalView* srcView, CLocalView* dstView) ; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_temporal_splitting.cpp

    r1988 r2007  
    1010#include "grid.hpp" 
    1111#include "grid_transformation_factory_impl.hpp" 
     12#include "temporal_transform_filter.hpp" 
    1213 
    1314namespace xios { 
     
    4344 
    4445CAxisAlgorithmTemporalSplitting::CAxisAlgorithmTemporalSplitting(bool isSource, CAxis* axisDestination, CScalar* scalarSource, CTemporalSplitting* algo) 
    45  : CAxisAlgorithmTransformation(isSource, axisDestination, scalarSource) 
     46 : CAlgorithmTransformationNoDataModification(isSource) 
    4647{ 
    47  
     48  nrecords_ = axisDestination->n_glo ; // also axis must not be distributed, make more test later 
    4849} 
    4950 
     51CTransformFilter* CAxisAlgorithmTemporalSplitting::createTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue) 
     52{ 
     53  return new CTemporalTransformFilter(gc, algo, nrecords_, detectMissingValues, defaultValue) ; 
     54} 
    5055 
    5156CAxisAlgorithmTemporalSplitting::~CAxisAlgorithmTemporalSplitting() 
     
    5358} 
    5459 
    55 void CAxisAlgorithmTemporalSplitting::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    56 TRY 
    57 { 
    58   this->transformationMapping_.resize(1); 
    59   this->transformationWeight_.resize(1); 
    60  
    61   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    62   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
    63  
    64   CArray<int,1>& axisDstIndex = axisDest_->index; 
    65  
    66   int nbAxisIdx = axisDstIndex.numElements(); 
    67   for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis) 
    68   { 
    69     int globalAxisIdx = axisDstIndex(idxAxis); 
    70     if (idxAxis==0) 
    71     { 
    72       transMap[globalAxisIdx].resize(1); 
    73       transWeight[globalAxisIdx].resize(1); 
    74       transMap[globalAxisIdx][0] = 0 ; 
    75       transWeight[globalAxisIdx][0] = 1.0 ; 
    76     } 
    77   } 
    78 } 
    79 CATCH 
    8060 
    8161} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_temporal_splitting.hpp

    r1988 r2007  
    1010#define __XIOS_AXIS_ALGORITHM_TEMPORAL_SPLITTING_HPP__ 
    1111 
    12 #include "axis_algorithm_transformation.hpp" 
    1312#include "transformation.hpp" 
     13#include "algorithm_transformation_no_data_modification.hpp"  
     14namespace xios  
     15{ 
    1416 
    15 namespace xios { 
     17  class CAxis; 
     18  class CScalar; 
     19  class CTemporalSplitting; 
    1620 
    17 class CAxis; 
    18 class CScalar; 
    19 class CTemporalSplitting; 
    20  
    21  
    22  
    23 /*! 
    24   \class CAxisAlgorithmExtractDomain 
    25   Extract a domain to an axis 
    26 */ 
    27 class CAxisAlgorithmTemporalSplitting : public CAxisAlgorithmTransformation 
    28 { 
    29 public: 
    30   CAxisAlgorithmTemporalSplitting(bool isSource, CAxis* axisDestination, CScalar* scalarSource, CTemporalSplitting* algo); 
    31  
    32   virtual ~CAxisAlgorithmTemporalSplitting(); 
    33  
    34   static bool registerTrans(); 
    35  
    36 protected: 
    37   void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
    38  
    39 private: 
    40   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 
    41                                                 CTransformation<CAxis>* transformation, 
    42                                                 int elementPositionInGrid, 
    43                                                 std::map<int, int>& elementPositionInGridSrc2ScalarPosition, 
    44                                                 std::map<int, int>& elementPositionInGridSrc2AxisPosition, 
    45                                                 std::map<int, int>& elementPositionInGridSrc2DomainPosition, 
    46                                                 std::map<int, int>& elementPositionInGridDst2ScalarPosition, 
    47                                                 std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    48                                                 std::map<int, int>& elementPositionInGridDst2DomainPosition); 
    49   static bool dummyRegistered_; 
    50 }; 
     21  /*! 
     22    \class CAxisAlgorithmExtractDomain 
     23    Extract a domain to an axis 
     24  */ 
     25  class CAxisAlgorithmTemporalSplitting : public CAlgorithmTransformationNoDataModification   
     26  { 
     27    public: 
     28      CAxisAlgorithmTemporalSplitting(bool isSource, CAxis* axisDestination, CScalar* scalarSource, CTemporalSplitting* algo); 
     29      virtual ~CAxisAlgorithmTemporalSplitting(); 
     30      static bool registerTrans(); 
     31      virtual CTransformFilter* createTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue) ; 
     32     
     33    private: 
     34      static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 
     35                                                     CTransformation<CAxis>* 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    int nrecords_; 
     44    static bool dummyRegistered_; 
     45  }; 
    5146 
    5247} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_compute_connectivity.cpp

    r1998 r2007  
    3838 
    3939bool CDomainAlgorithmComputeConnectivity::dummyRegistered_ = CDomainAlgorithmComputeConnectivity::registerTrans(); 
     40 
    4041bool CDomainAlgorithmComputeConnectivity::registerTrans() 
    4142TRY 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_interpolate.hpp

    r2002 r2007  
    8484 
    8585 
    86 private: 
     86public: 
    8787 
    8888  static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp

    r1998 r2007  
    4545{ 
    4646  reorderDomain->checkValid(domainSource); 
     47  domainDestination->checkAttributes() ; // for now but maybe use domainSource as template for domain destination 
     48 
    4749  if (domainDestination->type !=  CDomain::type_attr::rectilinear) 
    4850  { 
     
    115117    } 
    116118  } 
     119 
     120  domainDestination->checkAttributes() ; 
    117121} 
    118122CATCH 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.cpp

    r1999 r2007  
    1616#include "transform_connector.hpp" 
    1717#include "weight_transform_connector.hpp" 
     18#include "grid_algorithm_generic.hpp" 
     19#include "transform_filter.hpp" 
    1820 
    1921namespace xios  
     
    11451147CGridAlgorithm* CGenericAlgorithmTransformation::createGridAlgorithm(CGrid* gridSrc, CGrid* gridDst, int pos) 
    11461148{ 
    1147   return new CGridAlgorithm(gridSrc, gridDst, pos, this) ; 
    1148 } 
    1149  
    1150  
    1151 void CGenericAlgorithmTransformation::computeAlgorithm(CLocalView* srcView, CLocalView* dstView) 
    1152 { 
    1153   
    1154   this->computeRecvElement(srcView, dstView) ; 
    1155 /* 
    1156   transformConnector_ = new CTransformConnector(srcView, recvElement.getView(CElementView::FULL), CContext::getCurrent()->getIntraComm())  ; 
    1157   transformConnector_->computeConnector() ;  
    1158 */ 
    1159   weightTransformConnector_ = new  CWeightTransformConnector(recvElement_->getView(CElementView::FULL), dstView, transformationMapping_[0], transformationWeight_[0]) ;  
    1160 } 
    1161   
    1162 void CGenericAlgorithmTransformation::computeRecvElement(CLocalView* srcView, CLocalView* dstView) 
    1163 { 
    1164   auto& srcMap = transformationMapping_[0] ; 
    1165   set<size_t> srcIndex ; 
    1166   for(auto& it : srcMap) 
    1167     for(size_t index : it.second) srcIndex.insert(index) ; 
    1168  
    1169   CArray<size_t,1> srcArrayIndex(srcIndex.size()) ; 
    1170   int i=0 ; 
    1171   for(size_t index : srcIndex) { srcArrayIndex(i) = index ; i++ ;} 
    1172   recvElement_ = new CLocalElement(CContext::getCurrent()->getIntraCommRank(), srcView->getGlobalSize(), srcArrayIndex) ; 
    1173   recvElement_->addFullView() ; 
     1149  return new CGridAlgorithmGeneric(gridSrc, gridDst, pos, this) ; 
     1150} 
     1151 
     1152 
     1153 
     1154CTransformFilter* CGenericAlgorithmTransformation::createTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue) 
     1155{ 
     1156  return new CTransformFilter(gc, algo, detectMissingValues, defaultValue) ; 
    11741157} 
    11751158 
    11761159void CGenericAlgorithmTransformation::apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut) 
    11771160{ 
    1178   //CArray<double,1> dataOutTmp ; 
    1179   //transformConnector_->transfer(dimBefore, dimAfter, dataIn, dataOutTmp) ; 
    1180   weightTransformConnector_ -> transfer(dimBefore, dimAfter, dataIn, dataOut) ; 
    1181 } 
    1182  
    1183 } 
     1161  // tranform into pure virtual funtion later 
     1162  abort() ; 
     1163} 
     1164} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.hpp

    r1999 r2007  
    2525  class CScalar; 
    2626  class CGridAlgorithm ; 
     27  class CTransformFilter ; 
     28  class CGarbageCollector ; 
    2729 
    2830  /*! 
     
    182184  public :  
    183185   
    184     virtual void computeAlgorithm(CLocalView* srcView, CLocalView* dstView) ; 
    185     virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut); 
    186186    virtual CGridAlgorithm* createGridAlgorithm(CGrid* gridSrc, CGrid* newGrid, int pos) ; 
    187     virtual void computeRecvElement(CLocalView* srcView, CLocalView* dstView) ; 
     187    virtual CTransformFilter* createTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue) ; 
     188    virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut); // transform into pure virtual function later 
    188189  protected : 
    189190 
     
    192193    CLocalElement* getRecvElement(void) { return recvElement_ ;} 
    193194   
    194   protected: 
    195     CTransformConnector* transformConnector_ ; 
    196     CWeightTransformConnector* weightTransformConnector_ ; 
    197  
    198195}; 
    199196 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_algorithm.cpp

    r2001 r2007  
    11#include "grid_algorithm.hpp" 
    2 #include "grid_elements.hpp" 
    3 #include "grid_local_view.hpp" 
    4 #include "grid.hpp" 
    5 #include "algo_types.hpp" 
    6 #include "context.hpp" 
     2#include "generic_algorithm_transformation.hpp" 
    73 
    84namespace xios 
    95{ 
    106 
    11   CGridAlgorithm::CGridAlgorithm(CGrid* gridSrc, CGrid* gridDst, int pos,  CGenericAlgorithmTransformation* algo) 
    12   : gridSrc_(gridSrc), gridDst_(gridDst), pos_(pos), algorithm_(algo) 
    13   { 
    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  
    39     this->computeAlgorithm() ; 
    40   } 
    41  
    42   void CGridAlgorithm::computeAlgorithm(void) 
    43   { 
    44     CGridLocalElements* gridSrcElements = gridSrc_->getGridLocalElements() ; 
    45     CGridLocalElements* gridDstElements = gridDst_->getGridLocalElements() ; 
    46      
    47     CGridLocalView* srcView = gridSrcElements->getView(CElementView::WORKFLOW) ; 
    48     CGridLocalView* dstView = gridDstElements->getView(CElementView::WORKFLOW) ; 
    49     MPI_Comm comm = CContext::getCurrent()->getIntraComm() ; 
    50     int commSize = CContext::getCurrent()->getIntraCommSize() ; 
    51     int commRank = CContext::getCurrent()->getIntraCommRank() ; 
    52      
    53     auto& elements =  gridSrcElements->getElements() ; 
    54     int nElements = elements.size() ; 
    55     vector<CLocalElement*> remoteElements(nElements) ; 
    56     vector<CLocalView*> remoteViews(nElements) ; 
    57     for(int i=0;i<nElements;i++) 
    58     { 
    59       if (i==pos_) remoteElements[i] = algorithm_->getRecvElement() ; 
    60       else 
    61       {  
    62         CArray<size_t,1> globalIndexView ; 
    63         srcView->getView(i)->getGlobalIndexView(globalIndexView) ; 
    64         remoteElements[i] = new CLocalElement(commRank, srcView->getView(i)->getGlobalSize(),globalIndexView) ; 
    65         remoteElements[i]->addFullView() ; 
    66         if (i>pos_) dimBefore_ *= srcView->getView(i)->getSize() ; 
    67         else dimAfter_ *= srcView->getView(i)->getSize() ; 
    68            
    69       } 
    70       remoteViews[i] = remoteElements[i] -> getView(CElementView::FULL); 
    71     } 
    72  
    73     gridTransformConnector_ = new CGridTransformConnector(srcView->getViews(), remoteViews, comm ) ; 
    74   
    75   } 
    76  
    77   void CGridAlgorithm::apply(const CArray<double,1>& dataIn, CArray<double,1>& dataOut) 
    78   { 
    79     CArray<double,1> dataOutTmp ; 
    80     gridTransformConnector_->transfer(dataIn, dataOutTmp) ; 
    81     algorithm_->apply(dimBefore_, dimAfter_, dataOutTmp, dataOut) ; 
     7  CTransformFilter* CGridAlgorithm::createTransformFilter(CGarbageCollector& gc, bool detectMissingValues, double defaultValue) 
     8  {   
     9    return algorithm_->createTransformFilter(gc, this, detectMissingValues, defaultValue) ; 
    8210  } 
    8311 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_algorithm.hpp

    r1999 r2007  
    1 #ifndef __XIOS_GRID_ALGORITHM_TRANSFORMATION_HPP__ 
    2 #define __XIOS_GRID_ALGORITHM_TRANSFORMATION_HPP__ 
     1#ifndef __XIOS_GRID_ALGORITHM_HPP__ 
     2#define __XIOS_GRID_ALGORITHM_HPP__ 
    33 
    44#include "grid_transform_connector.hpp" 
     
    1616  This class defines the interface for all other inherited algorithms class 
    1717  */ 
     18class CTransformFilter ; 
     19class CGarbageCollector ; 
     20 
    1821class CGridAlgorithm 
    1922{ 
    2023  public: 
    21     CGridAlgorithm(CGrid* gridSrc, CGrid* gridDst, int pos,  CGenericAlgorithmTransformation* algo) ; 
    22     virtual void computeAlgorithm(void) ; 
    23      
    24     void apply(const CArray<double,1>& dataIn, CArray<double,1>& dataOut) ; 
    25  
    26   private: 
    27     CGenericAlgorithmTransformation* algorithm_=nullptr ; 
    28     CGridTransformConnector* gridTransformConnector_=nullptr ; 
    29     CGrid* gridSrc_ = nullptr ; 
    30     CGrid* gridDst_ = nullptr ; 
    31     int pos_ ; 
    32     int dimBefore_=1 ; 
    33     int dimAfter_=1 ; 
    34  
     24    CGridAlgorithm(CGenericAlgorithmTransformation* algorithm) : algorithm_(algorithm)  {} ; 
     25    virtual ~CGridAlgorithm() {} ; 
     26    virtual void apply(const CArray<double,1>& dataIn, CArray<double,1>& dataOut)=0 ; 
     27    virtual CTransformFilter* createTransformFilter(CGarbageCollector& gc, bool detectMissingValues, double defaultValue) ; 
     28    
     29    protected: 
     30      CGenericAlgorithmTransformation* algorithm_=nullptr ; 
    3531}; 
    3632 
Note: See TracChangeset for help on using the changeset viewer.