Ignore:
Timestamp:
09/22/16 10:58:32 (8 years ago)
Author:
mhnguyen
Message:

Improving transformation selection. Instead of modifying directly grid_transformation
we only need to register a new transformation with the framework

+) Update all transformations with this new method

Test
+) On Curie
+) Basic tests pass

File:
1 edited

Legend:

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

    r918 r933  
    2323  /*! 
    2424  \class CGenericAlgorithmTransformation 
    25   This class defines the interface for all other inherted algorithms class 
     25  This class defines the interface for all other inherited algorithms class 
    2626  */ 
    2727class CGenericAlgorithmTransformation 
    2828{ 
    29 protected: 
    30   typedef std::vector<std::pair<int, std::pair<size_t,double> > > DestinationGlobalIndex; 
    3129public: 
    32   // Stupid global index map, it must be replaced by tuple 
     30  enum AlgoTransType { 
     31    ELEMENT_GENERATION = 0, 
     32    ELEMENT_MODIFICATION_WITHOUT_DATA = 1, 
     33    ELEMENT_MODIFICATION_WITH_DATA = 2, 
     34    ELEMENT_NO_MODIFICATION_WITH_DATA = 3, 
     35    ELEMENT_NO_MODIFICATION_WITHOUT_DATA = 4 
     36  } ; 
     37 
     38public: 
    3339  // Mapping between global index map of DESTINATION and its local index with pair of global index of SOURCE and weights 
    34   typedef boost::unordered_map<size_t, DestinationGlobalIndex> DestinationIndexMap; 
    35   // 
    3640  typedef boost::unordered_map<int, boost::unordered_map<size_t, std::vector<std::pair<size_t,double> > > > SourceDestinationIndexMap; 
    3741 
     
    5458 
    5559    /*! 
    56     Apply a reduction operation on local data. 
     60    Apply a operation on local data. 
    5761    \param [in] localIndex vector contains local index of local data output and the corresponding weight 
    5862    \param [in] dataInput Pointer to the first element of data input array (in form of buffer) 
     
    6771 
    6872  std::vector<StdString> getIdAuxInputs(); 
    69  
     73  AlgoTransType type(); 
    7074  /*! 
    7175  Compute global index mapping from one element of destination grid to the corresponding element of source grid 
     
    123127  //! Id of auxillary inputs which helps doing transformation dynamically 
    124128  std::vector<StdString> idAuxInputs_; 
     129  AlgoTransType type_; 
     130 
    125131 
    126132  std::map<int, int> elementPositionInGridSrc2AxisPosition_, elementPositionInGridSrc2DomainPosition_, elementPositionInGridSrc2ScalarPosition_; 
Note: See TracChangeset for help on using the changeset viewer.