source: XIOS/trunk/src/transformation/transformation_mapping.hpp @ 630

Last change on this file since 630 was 630, checked in by mhnguyen, 9 years ago

Implementing interpolation (polynomial) and correct some bugs

+) Implement interpolation (polynomial)
+) Correct some minor bugs relating to memory allocation
+) Clear some redundant codes

Test
+) On Curie
+) test_client and test_complete pass

File size: 2.1 KB
Line 
1/*!
2   \file transformation_mapping.hpp
3   \author Ha NGUYEN
4   \since 14 May 2015
5   \date 09 June 2015
6
7   \brief Take charge of communication among clients to exchange transformed data.
8 */
9#ifndef __XIOS_TRANSFORMATION_MAPPING_HPP__
10#define __XIOS_TRANSFORMATION_MAPPING_HPP__
11
12#include <map>
13#include <set>
14#include "grid.hpp"
15#include "axis.hpp"
16#include "array_new.hpp"
17#include "client_server_mapping_distributed.hpp"
18
19namespace xios {
20
21/*!
22  \class CTransformationMapping
23  This class is in charge of transfer the global index form grid from grid source to grid destination in a rather generic way.
24In order to make a transformation, the grid destination will make a request to grid source about the global indexes which it needs.
25The same discovering algorithm as the case of client-server is applied to find the corresponding client which contains the demanding global index.
26*/
27class CTransformationMapping
28{
29public:
30  /** Default constructor */
31  CTransformationMapping(CGrid* destination, CGrid* source);
32  CTransformationMapping(CAxis* destination, CAxis* source);
33
34  ~CTransformationMapping();
35
36  void computeTransformationMapping(const std::map<size_t, std::vector<std::pair<size_t,double> > >& globaIndexMapFromDestToSource);
37  const std::map<int,std::vector<std::vector<std::pair<size_t,double> > > >& getGlobalIndexReceivedOnGridDestMapping() const;
38  const std::map<int,std::vector<size_t> >& getGlobalIndexSendToGridDestMapping() const;
39
40protected:
41  CGrid* gridSource_;  // Grid source
42  CGrid* gridDestination_; // Grid destination demande the necessary global index from grid source
43
44  //! Global index mapping of grid source and grid destination between two clients
45  CClientServerMappingDistributed* gridIndexClientClientMapping_;
46
47  //! Mapping of client rank of grid source and global index received in grid destination
48  std::map<int,std::vector<std::vector<std::pair<size_t,double> > > > globalIndexReceivedOnGridDestMapping_;
49
50  //! Mapping of client rank of grid destination and global index to send from grid source
51  std::map<int,std::vector<size_t> > globalIndexSendToGridDestMapping_;
52};
53
54}
55#endif // __XIOS_TRANSFORMATION_MAPPING_HPP__
Note: See TracBrowser for help on using the repository browser.