1 | /*! |
---|
2 | \file domain_algorithm_transformation.hpp |
---|
3 | \author Ha NGUYEN |
---|
4 | \since 02 Jul 2015 |
---|
5 | \date 02 Jul 2015 |
---|
6 | |
---|
7 | \brief Interface for all domain transformation algorithms. |
---|
8 | */ |
---|
9 | #ifndef __XIOS_DOMAIN_ALGORITHM_TRANSFORMATION_HPP__ |
---|
10 | #define __XIOS_DOMAIN_ALGORITHM_TRANSFORMATION_HPP__ |
---|
11 | |
---|
12 | #include "generic_algorithm_transformation.hpp" |
---|
13 | #include "client_client_dht_template.hpp" |
---|
14 | |
---|
15 | namespace xios { |
---|
16 | |
---|
17 | class CDomain; |
---|
18 | /*! |
---|
19 | \class CDomainAlgorithmTransformation |
---|
20 | Algorithms for domain. |
---|
21 | */ |
---|
22 | class CDomainAlgorithmTransformation : public virtual CGenericAlgorithmTransformation |
---|
23 | { |
---|
24 | public: |
---|
25 | CDomainAlgorithmTransformation(CDomain* domainDestination, CDomain* domainSource); |
---|
26 | |
---|
27 | virtual ~CDomainAlgorithmTransformation(); |
---|
28 | |
---|
29 | protected: |
---|
30 | virtual void computeGlobalGridIndexFromGlobalIndexElement(int domainDestGlobalIndex, |
---|
31 | const std::vector<int>& domainSrcGlobalIndex, |
---|
32 | const std::vector<int>& destGlobalIndexPositionInGrid, |
---|
33 | int domainPositionInGrid, |
---|
34 | const std::vector<int>& gridDestGlobalDim, |
---|
35 | const std::vector<int>& gridSrcGlobalDim, |
---|
36 | const GlobalLocalMap& globalLocalIndexDestSendToServerMap, |
---|
37 | std::vector<std::pair<size_t,int> >& globalLocalIndexDestMap, |
---|
38 | std::vector<std::vector<size_t> >& globalIndexSrcGrid); |
---|
39 | |
---|
40 | void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >&); |
---|
41 | |
---|
42 | void computeExchangeGlobalIndex(const CArray<size_t,1>& globalDomainIndex, |
---|
43 | CClientClientDHTInt::Index2VectorInfoTypeMap& globalDomainIndexOnProc); |
---|
44 | protected: |
---|
45 | inline void domainGlobalIndex(const int& index, const int& niGlob, const int& njGlob, |
---|
46 | int& iIndex, int& jIndex); |
---|
47 | |
---|
48 | protected: |
---|
49 | //! Domain on grid destination |
---|
50 | CDomain* domainDest_; |
---|
51 | |
---|
52 | //! Domain on grid source |
---|
53 | CDomain* domainSrc_; |
---|
54 | }; |
---|
55 | |
---|
56 | } |
---|
57 | #endif // __XIOS_DOMAIN_ALGORITHM_TRANSFORMATION_HPP__ |
---|