[689] | 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" |
---|
[933] | 13 | #include "transformation.hpp" |
---|
[689] | 14 | |
---|
| 15 | namespace xios { |
---|
[933] | 16 | |
---|
| 17 | class CDomain; |
---|
| 18 | class CInterpolateDomain; |
---|
| 19 | |
---|
[689] | 20 | /*! |
---|
| 21 | \class CDomainAlgorithmInterpolate |
---|
| 22 | Reading interpolation from file then apply on a domain |
---|
| 23 | */ |
---|
| 24 | class CDomainAlgorithmInterpolate : public CDomainAlgorithmTransformation |
---|
| 25 | { |
---|
| 26 | public: |
---|
| 27 | CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain); |
---|
| 28 | |
---|
| 29 | virtual ~CDomainAlgorithmInterpolate() {} |
---|
| 30 | |
---|
[933] | 31 | static bool registerTrans(); |
---|
[827] | 32 | protected: |
---|
| 33 | void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); |
---|
[689] | 34 | |
---|
| 35 | private: |
---|
| 36 | void readInterpolationInfo(std::string& filename, std::map<int,std::vector<std::pair<int,double> > >& interpMapValue); |
---|
[743] | 37 | void processPole(std::map<int,std::vector<std::pair<int,double> > >& interMapValuePole, |
---|
| 38 | int nbGlobalPointOnPole); |
---|
[689] | 39 | void computeRemap(); |
---|
| 40 | void readRemapInfo(); |
---|
[856] | 41 | void exchangeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue); |
---|
[689] | 42 | private: |
---|
| 43 | CInterpolateDomain* interpDomain_; |
---|
| 44 | |
---|
[933] | 45 | private: |
---|
| 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); |
---|
[689] | 56 | }; |
---|
| 57 | |
---|
| 58 | } |
---|
| 59 | #endif // __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_HPP__ |
---|