source: XIOS/trunk/src/filter/transformation_mapping.hpp @ 622

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

Implementing generic transformation algorithm (local commit)

+) Implement 3 important classes:

-gridTransformation to read transformation info from grid and interface with the rest of XIOS
-transformationMapping to be in charge of sending/receiving transformation info among clients
-transformationAlgorithm to represent various algorithms

+) Make some change on field to use the new classes

Test
+) Only test_new_features with inversed axis

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