1 | /*! |
---|
2 | \file domain_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 domain. |
---|
8 | */ |
---|
9 | #ifndef __XIOS_DOMAIN_ALGORITHM_ZOOM_HPP__ |
---|
10 | #define __XIOS_DOMAIN_ALGORITHM_ZOOM_HPP__ |
---|
11 | |
---|
12 | #include "domain_algorithm_transformation.hpp" |
---|
13 | #include "transformation.hpp" |
---|
14 | |
---|
15 | namespace xios { |
---|
16 | |
---|
17 | class CDomain; |
---|
18 | class CZoomDomain; |
---|
19 | |
---|
20 | /*! |
---|
21 | \class CDomainAlgorithmZoom |
---|
22 | Implementing zoom on domain |
---|
23 | A zoomed region can be considered as region that isnt masked. |
---|
24 | Only this zoomed region is extracted to write on Netcdf. |
---|
25 | */ |
---|
26 | class CDomainAlgorithmZoom : public CDomainAlgorithmTransformation |
---|
27 | { |
---|
28 | public: |
---|
29 | CDomainAlgorithmZoom(CDomain* domainDestination, CDomain* domainSource, CZoomDomain* zoomDomain); |
---|
30 | |
---|
31 | virtual ~CDomainAlgorithmZoom() {} |
---|
32 | |
---|
33 | static bool registerTrans(); |
---|
34 | protected: |
---|
35 | void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); |
---|
36 | |
---|
37 | private: |
---|
38 | void updateDomainDestinationMask(); |
---|
39 | void updateZoom(); |
---|
40 | |
---|
41 | private: |
---|
42 | //! Global zoom begin on domain |
---|
43 | int zoomIBegin_; |
---|
44 | int zoomJBegin_; |
---|
45 | |
---|
46 | //! Global zoom end on domain |
---|
47 | int zoomIEnd_; |
---|
48 | int zoomJEnd_; |
---|
49 | |
---|
50 | //! Global zoom size on domain |
---|
51 | int zoomNi_; |
---|
52 | int zoomNj_; |
---|
53 | |
---|
54 | private: |
---|
55 | |
---|
56 | static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc, |
---|
57 | CTransformation<CDomain>* transformation, |
---|
58 | int elementPositionInGrid, |
---|
59 | std::map<int, int>& elementPositionInGridSrc2ScalarPosition, |
---|
60 | std::map<int, int>& elementPositionInGridSrc2AxisPosition, |
---|
61 | std::map<int, int>& elementPositionInGridSrc2DomainPosition, |
---|
62 | std::map<int, int>& elementPositionInGridDst2ScalarPosition, |
---|
63 | std::map<int, int>& elementPositionInGridDst2AxisPosition, |
---|
64 | std::map<int, int>& elementPositionInGridDst2DomainPosition); |
---|
65 | }; |
---|
66 | |
---|
67 | } |
---|
68 | #endif // __XIOS_DOMAIN_ALGORITHM_ZOOM_HPP__ |
---|