source: XIOS/trunk/src/transformation/axis_algorithm_zoom.hpp @ 933

Last change on this file since 933 was 933, checked in by mhnguyen, 4 years ago

Improving transformation selection. Instead of modifying directly grid_transformation
we only need to register a new transformation with the framework

+) Update all transformations with this new method

Test
+) On Curie
+) Basic tests pass

File size: 2.0 KB
Line 
1/*!
2   \file axis_algorithm_zoom.hpp
3   \author Ha NGUYEN
4   \since 03 June 2015
5   \date 12 June 2015
6
7   \brief Algorithm for zooming on an axis.
8 */
9#ifndef __XIOS_AXIS_ALGORITHM_ZOOM_HPP__
10#define __XIOS_AXIS_ALGORITHM_ZOOM_HPP__
11
12#include "axis_algorithm_transformation.hpp"
13#include "transformation.hpp"
14
15namespace xios {
16class CAxis;
17class CZoomAxis;
18
19/*!
20  \class CAxisAlgorithmZoom
21  Implementing zoom on axis
22  A zoomed region can be considered as region that isn't masked.
23  Only this zoomed region is extracted to write on Netcdf.
24*/
25class CAxisAlgorithmZoom : public CAxisAlgorithmTransformation
26{
27public:
28  CAxisAlgorithmZoom(CAxis* axisDestination, CAxis* axisSource, CZoomAxis* zoomAxis);
29
30  virtual ~CAxisAlgorithmZoom() {}
31
32  static bool registerTrans();
33protected:
34  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
35
36private:
37  void updateAxisDestinationMask();
38  void updateZoom();
39
40private:
41  //! Global zoom begin on axis
42  StdSize zoomBegin_;
43
44  //! Global zoom end on axis
45  StdSize zoomEnd_;
46
47  //! Global zoom size on axis
48  StdSize zoomSize_;
49
50private:
51
52  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
53                                                CTransformation<CAxis>* transformation,
54                                                int elementPositionInGrid,
55                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
56                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
57                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
58                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
59                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
60                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
61};
62
63}
64#endif // __XIOS_AXIS_ALGORITHM_ZOOM_HPP__
Note: See TracBrowser for help on using the repository browser.