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

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

Final tests of zoom and inverse on axis

+) Modify test_client and test_complete to work with new grid definition
+) Correct some bugs causing memory leak
+) Clean abundant code
+) Add more comments to new files

Test
+) On Curie
+) test_client and test_complete pass with correct results

File size: 2.0 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 "array_new.hpp"
16#include "client_server_mapping_distributed.hpp"
17
18namespace xios {
19
20/*!
21  \class CTransformationMapping
22  This class is in charge of transfer the global index form grid from grid source to grid destination in a rather generic way.
23In order to make a transformation, the grid destination will make a request to grid source about the global indexes which it needs.
24The same discovering algorithm as the case of client-server is applied to find the corresponding client which contains the demanding global index.
25*/
26class CTransformationMapping
27{
28public:
29  /** Default constructor */
30  CTransformationMapping(CGrid* destination, CGrid* source);
31  ~CTransformationMapping();
32
33  void computeTransformationMapping(const std::map<size_t, std::set<size_t> >& globaIndexMapFromDestToSource);
34  const std::map<int,std::vector<std::vector<size_t> > >& getGlobalIndexReceivedOnGridDestMapping() const;
35  const std::map<int,std::vector<size_t> >& getGlobalIndexSendToGridDestMapping() const;
36
37protected:
38  CGrid* gridSource_;  // Grid source
39  CGrid* gridDestination_; // Grid destination demande the necessary global index from grid source
40
41  //! Global index mapping of grid source and grid destination between two clients
42  CClientServerMappingDistributed* gridIndexClientClientMapping_;
43
44  //! Mapping of client rank of grid source and global index received in grid destination
45  std::map<int,std::vector<std::vector<size_t> > > globalIndexReceivedOnGridDestMapping_;
46
47  //! Mapping of client rank of grid destination and global index to send from grid source
48  std::map<int,std::vector<size_t> > globalIndexSendToGridDestMapping_;
49};
50
51}
52#endif // __XIOS_TRANSFORMATION_MAPPING_HPP__
Note: See TracBrowser for help on using the repository browser.