source: XIOS/trunk/src/transformation/domain_algorithm_interpolate.hpp @ 933

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

Improving transformation selection. Instead of modifying directly grid_transformation
we only need to register a new transformation with the framework

+) Update all transformations with this new method

Test
+) On Curie
+) Basic tests pass

File size: 2.3 KB
Line 
1/*!
2   \file domain_algorithm_interpolate_from_file.hpp
3   \author Ha NGUYEN
4   \since 09 July 2015
5   \date 09 Sep 2015
6
7   \brief Algorithm for interpolation on a domain.
8 */
9#ifndef __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_HPP__
10#define __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_HPP__
11
12#include "domain_algorithm_transformation.hpp"
13#include "transformation.hpp"
14
15namespace xios {
16
17class CDomain;
18class CInterpolateDomain;
19
20/*!
21  \class CDomainAlgorithmInterpolate
22  Reading interpolation from file then apply on a domain
23*/
24class CDomainAlgorithmInterpolate : public CDomainAlgorithmTransformation
25{
26public:
27  CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain);
28
29  virtual ~CDomainAlgorithmInterpolate() {}
30
31  static bool registerTrans();
32protected:
33  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
34
35private:
36  void readInterpolationInfo(std::string& filename, std::map<int,std::vector<std::pair<int,double> > >& interpMapValue);
37  void processPole(std::map<int,std::vector<std::pair<int,double> > >& interMapValuePole,
38                   int nbGlobalPointOnPole);
39  void computeRemap();
40  void readRemapInfo();
41  void exchangeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue);
42private:
43  CInterpolateDomain* interpDomain_;
44
45private:
46
47  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
48                                                CTransformation<CDomain>* transformation,
49                                                int elementPositionInGrid,
50                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
51                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
52                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
53                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
54                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
55                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
56};
57
58}
59#endif // __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_HPP__
Note: See TracBrowser for help on using the repository browser.