source: XIOS/dev/dev_olga/src/transformation/axis_algorithm_reduce_domain.hpp @ 1158

Last change on this file since 1158 was 1158, checked in by oabramkina, 3 years ago

Two server levels: merging with trunk r1137.
There are bugs.

File size: 2.3 KB
Line 
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 "axis_algorithm_transformation.hpp"
13#include "transformation.hpp"
14
15namespace xios {
16
17class CAxis;
18class CDomain;
19class CReduceDomainToAxis;
20class CReductionAlgorithm;
21
22/*!
23  \class CAxisAlgorithmReduceDomain
24  Reduce a domain to an axis
25*/
26class CAxisAlgorithmReduceDomain : public CAxisAlgorithmTransformation
27{
28public:
29  CAxisAlgorithmReduceDomain(CAxis* axisDestination, CDomain* domainSource, CReduceDomainToAxis* algo);
30
31  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
32                     const double* dataInput,
33                     CArray<double,1>& dataOut,
34                     std::vector<bool>& flagInitial,                     
35                     bool ignoreMissingValue);
36
37  virtual void updateData(CArray<double,1>& dataOut);
38 
39  virtual ~CAxisAlgorithmReduceDomain();
40
41  static bool registerTrans();
42protected:
43  enum ReduceDirection {
44    undefined = 0,
45    iDir = 1,
46    jDir = 2
47  };
48
49  ReduceDirection dir_;
50protected:
51  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
52 
53protected:
54  CReductionAlgorithm* reduction_;
55
56private:
57  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
58                                                CTransformation<CAxis>* transformation,
59                                                int elementPositionInGrid,
60                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
61                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
62                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
63                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
64                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
65                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
66};
67
68}
69#endif // __XIOS_AXIS_ALGORITHM_REDUCE_DOMAIN_HPP__
Note: See TracBrowser for help on using the repository browser.