1 | /*! |
---|

2 | \file axis_algorithm_reduce_domain.hpp |
---|

3 | \author Ha NGUYEN |
---|

4 | \since 23 June 2016 |
---|

5 | \date 23 June 2016 |
---|

6 | |
---|

7 | \brief Algorithm for reduce an axis to a axis |
---|

8 | */ |
---|

9 | #ifndef __XIOS_AXIS_ALGORITHM_REDUCE_DOMAIN_HPP__ |
---|

10 | #define __XIOS_AXIS_ALGORITHM_REDUCE_DOMAIN_HPP__ |
---|

11 | |
---|

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

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

14 | |
---|

15 | namespace xios { |
---|

16 | |
---|

17 | class CAxis; |
---|

18 | class CDomain; |
---|

19 | class CReduceDomainToAxis; |
---|

20 | class CReductionAlgorithm; |
---|

21 | |
---|

22 | /*! |
---|

23 | \class CAxisAlgorithmReduceDomain |
---|

24 | Reduce a domain to an axis |
---|

25 | */ |
---|

26 | class CAxisAlgorithmReduceDomain : public CAlgorithmTransformationReduce |
---|

27 | { |
---|

28 | public: |
---|

29 | CAxisAlgorithmReduceDomain(bool isSource, CAxis* axisDestination, CDomain* domainSource, CReduceDomainToAxis* algo); |
---|

30 | |
---|

31 | virtual ~CAxisAlgorithmReduceDomain(); |
---|

32 | |
---|

33 | static bool registerTrans(); |
---|

34 | virtual StdString getAlgoName() {return "\\nreduce_domain";} |
---|

35 | |
---|

36 | protected: |
---|

37 | enum ReduceDirection { |
---|

38 | undefined = 0, |
---|

39 | iDir = 1, |
---|

40 | jDir = 2 |
---|

41 | }; |
---|

42 | |
---|

43 | ReduceDirection dir_; |
---|

44 | bool local ; |
---|

45 | |
---|

46 | CDomain* domainSrc_ ; |
---|

47 | CAxis* axisDest_ ; |
---|

48 | |
---|

49 | public: |
---|

50 | static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, |
---|

51 | CTransformation<CAxis>* transformation, |
---|

52 | int elementPositionInGrid, |
---|

53 | std::map<int, int>& elementPositionInGridSrc2ScalarPosition, |
---|

54 | std::map<int, int>& elementPositionInGridSrc2AxisPosition, |
---|

55 | std::map<int, int>& elementPositionInGridSrc2DomainPosition, |
---|

56 | std::map<int, int>& elementPositionInGridDst2ScalarPosition, |
---|

57 | std::map<int, int>& elementPositionInGridDst2AxisPosition, |
---|

58 | std::map<int, int>& elementPositionInGridDst2DomainPosition); |
---|

59 | static bool dummyRegistered_; |
---|

60 | }; |
---|

61 | |
---|

62 | } |
---|

63 | #endif // __XIOS_AXIS_ALGORITHM_REDUCE_DOMAIN_HPP__ |
---|