Ignore:
Timestamp:
07/05/16 15:59:10 (8 years ago)
Author:
mhnguyen
Message:

Adding new transformation for scalar: Reducing an axis to a scalar

+) Add new xml node for new transformation
+) Add new algorithms for axis reduction
+) Make change in some place to make sure everything work fine

Test
+) On Curie
+) Tests pass and are correct

File:
1 edited

Legend:

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

    r867 r888  
    1919  class CDomain; 
    2020  class CAxis; 
     21  class CScalar; 
    2122 
    2223  /*! 
     
    5253                               SourceDestinationIndexMap& globaIndexWeightFromSrcToDst); 
    5354 
     55    /*! 
     56    Apply a reduction operation on local data. 
     57    \param [in] localIndex vector contains local index of local data output and the corresponding weight 
     58    \param [in] dataInput Pointer to the first element of data input array (in form of buffer) 
     59    \param [in/out] dataOut Array contains local data 
     60    \param [in/out] flagInitial vector of boolean to mark the local index already initialized. True means there is a need for initalization 
     61  */ 
     62  virtual void apply(const std::vector<std::pair<int,double> >& localIndex, 
     63                     const double* dataInput, 
     64                     CArray<double,1>& dataOut, 
     65                     std::vector<bool>& flagInitial); 
     66 
    5467  std::vector<StdString> getIdAuxInputs(); 
    5568 
     
    6578  Compute proc which contains global index of an element 
    6679    \param[in] globalElementIndex demanding global index of an element of source grid 
     80    \param[in] elementType type of source element, 2: domain, 1: axis and 0: scalar 
    6781    \param[out] globalElementIndexOnProc Proc contains the demanding global index 
    6882  */ 
    6983  virtual void computeExchangeGlobalIndex(const CArray<size_t,1>& globalElementIndex, 
     84                                          int elementType, 
    7085                                          CClientClientDHTInt::Index2VectorInfoTypeMap& globalElementIndexOnProc) = 0; 
    7186 
     
    89104                                boost::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc); 
    90105 
     106  void computeExchangeScalarIndex(CScalar* scalarDst, 
     107                                  CScalar* scalarSrc, 
     108                                  CArray<size_t,1>& destGlobalIndexPositionInGrid, 
     109                                  boost::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc); 
     110 
     111  void computePositionElements(CGrid* dst, CGrid* src); 
     112 
    91113protected: 
    92114  //! Map between global index of destination element and source element 
     
    100122  //! Id of auxillary inputs which helps doing transformation dynamically 
    101123  std::vector<StdString> idAuxInputs_; 
     124 
     125  std::map<int, int> elementPositionInGridSrc2AxisPosition_, elementPositionInGridSrc2DomainPosition_, elementPositionInGridSrc2ScalarPosition_; 
     126  std::map<int, int> elementPositionInGridDst2AxisPosition_, elementPositionInGridDst2DomainPosition_, elementPositionInGridDst2ScalarPosition_; 
    102127}; 
    103128 
Note: See TracChangeset for help on using the changeset viewer.