source: XIOS/trunk/src/transformation/domain_algorithm_transformation.hpp @ 862

Last change on this file since 862 was 862, checked in by mhnguyen, 5 years ago

Chaning the way to process transformation to improve the performance.
Instead of exchanging global index and weights on full GRID, each process only
sends and receives the global index and weights on each ELEMENT, which can reduce
the message size of DHT.

+) Domain and axis now have their own exchange function to transfer global index and weight
+) Generic transformation now plays the role of "synthesizer" for all elements
+) Grid transformation now plays the role of transformation mapping, e.x: exchange final global index and weight
among processes.

Test
+) On Curie
+) Pass on all basic tests
+) Dynamic interpolation on axis hasn't been tested (and it seems to need more change to make it rework)

File size: 2.2 KB
Line 
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 "domain.hpp"
14
15namespace xios {
16
17/*!
18  \class CDomainAlgorithmTransformation
19  Algorithms for domain.
20*/
21class CDomainAlgorithmTransformation : public virtual CGenericAlgorithmTransformation
22{
23public:
24  CDomainAlgorithmTransformation(CDomain* domainDestination, CDomain* domainSource);
25
26  virtual ~CDomainAlgorithmTransformation();
27
28protected:
29  virtual void computeGlobalGridIndexFromGlobalIndexElement(int domainDestGlobalIndex,
30                                                        const std::vector<int>& domainSrcGlobalIndex,
31                                                        const std::vector<int>& destGlobalIndexPositionInGrid,
32                                                        int domainPositionInGrid,
33                                                        const std::vector<int>& gridDestGlobalDim,
34                                                        const std::vector<int>& gridSrcGlobalDim,
35                                                        const GlobalLocalMap& globalLocalIndexDestSendToServerMap,
36                                                        std::vector<std::pair<size_t,int> >& globalLocalIndexDestMap,
37                                                        std::vector<std::vector<size_t> >& globalIndexSrcGrid);
38
39  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >&);
40
41  void computeExchangeGlobalIndex(const CArray<size_t,1>& globalDomainIndex,
42                                  boost::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc);
43protected:
44  inline void domainGlobalIndex(const int& index, const int& niGlob, const int& njGlob,
45                                int& iIndex, int& jIndex);
46
47protected:
48    //! Domain on grid destination
49  CDomain* domainDest_;
50
51  //! Domain on grid source
52  CDomain* domainSrc_;
53};
54
55}
56#endif // __XIOS_DOMAIN_ALGORITHM_TRANSFORMATION_HPP__
Note: See TracBrowser for help on using the repository browser.