source: XIOS/trunk/src/transformation/axis_algorithm_extract_domain.hpp @ 913

Last change on this file since 913 was 895, checked in by mhnguyen, 8 years ago

Adding a new transformation: Reduce a domain to an axis

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

File size: 1.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_EXTRACT_DOMAIN_HPP__
10#define __XIOS_AXIS_ALGORITHM_EXTRACT_DOMAIN_HPP__
11
12#include "axis_algorithm_transformation.hpp"
13
14namespace xios {
15
16class CAxis;
17class CDomain;
18class CExtractDomainToAxis;
19class CReductionAlgorithm;
20
21/*!
22  \class CAxisAlgorithmExtractDomain
23  Extract a domain to an axis
24*/
25class CAxisAlgorithmExtractDomain : public CAxisAlgorithmTransformation
26{
27public:
28  CAxisAlgorithmExtractDomain(CAxis* axisDestination, CDomain* domainSource, CExtractDomainToAxis* algo);
29
30  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
31                     const double* dataInput,
32                     CArray<double,1>& dataOut,
33                     std::vector<bool>& flagInitial);
34
35  virtual ~CAxisAlgorithmExtractDomain();
36
37protected:
38  enum ExtractDirection {
39    undefined = 0,
40    iDir = 1,
41    jDir = 2
42  };
43
44  ExtractDirection dir_;
45  int pos_; //! Position to extract
46protected:
47  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
48
49protected:
50  CReductionAlgorithm* reduction_;
51
52};
53
54}
55#endif // __XIOS_AXIS_ALGORITHM_EXTRACT_DOMAIN_HPP__
Note: See TracBrowser for help on using the repository browser.