1 | /*! |
---|

2 | \file axis_algorithm_transformation.hpp |
---|

3 | \author Ha NGUYEN |
---|

4 | \since 14 May 2015 |
---|

5 | \date 29 June 2015 |
---|

6 | |
---|

7 | \brief Interface for all axis transformation algorithms. |
---|

8 | */ |
---|

9 | #ifndef __XIOS_AXIS_ALGORITHM_TRANSFORMATION_HPP__ |
---|

10 | #define __XIOS_AXIS_ALGORITHM_TRANSFORMATION_HPP__ |
---|

11 | |
---|

12 | #include "generic_algorithm_transformation.hpp" |
---|

13 | #include "axis.hpp" |
---|

14 | |
---|

15 | namespace xios { |
---|

16 | |
---|

17 | /*! |
---|

18 | \class CAxisAlgorithmTransformation |
---|

19 | Algorithms for axis. |
---|

20 | */ |
---|

21 | class CAxisAlgorithmTransformation : public virtual CGenericAlgorithmTransformation |
---|

22 | { |
---|

23 | public: |
---|

24 | CAxisAlgorithmTransformation(CAxis* axisDestination, CAxis* axisSource); |
---|

25 | |
---|

26 | virtual ~CAxisAlgorithmTransformation(); |
---|

27 | |
---|

28 | protected: |
---|

29 | virtual void computeGlobalGridIndexFromGlobalIndexElement(int axisDestGlobalIndex, |
---|

30 | const std::vector<int>& axisSrcGlobalIndex, |
---|

31 | int axisPositionInGrid, |
---|

32 | const std::vector<int>& gridDestGlobalDim, |
---|

33 | const std::vector<int>& gridSrcGlobalDim, |
---|

34 | const std::vector<size_t>& globalIndexGridDestSendToServer, |
---|

35 | CArray<size_t,1>& globalIndexDestGrid, |
---|

36 | std::vector<std::vector<size_t> >& globalIndexSrcGrid); |
---|

37 | void computeIndexSourceMapping(); |
---|

38 | |
---|

39 | protected: |
---|

40 | //! Global index of an axis on grid destination |
---|

41 | std::vector<int> axisDestGlobalIndex_; |
---|

42 | |
---|

43 | //! Size of |
---|

44 | int axisDestGlobalSize_; |
---|

45 | |
---|

46 | //! Axis on grid destination |
---|

47 | CAxis* axisDest_; |
---|

48 | |
---|

49 | //! Axis on grid source |
---|

50 | CAxis* axisSrc_; |
---|

51 | }; |
---|

52 | |
---|

53 | } |
---|

54 | #endif // __XIOS_AXIS_ALGORITHM_TRANSFORMATION_HPP__ |
---|