source: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm/axis_algorithm_interpolate.hpp @ 2019

Last change on this file since 2019 was 2019, checked in by yushan, 6 months ago

Graph intermedia commit to a tmp branch

  • Property svn:executable set to *
File size: 2.7 KB
Line 
1/*!
2   \file axis_algorithm_interpolate.hpp
3   \author Ha NGUYEN
4   \since 23 June 2015
5   \date 23 June 2015
6
7   \brief Algorithm for interpolation on an axis.
8 */
9#ifndef __XIOS_AXIS_ALGORITHM_INTERPOLATE_HPP__
10#define __XIOS_AXIS_ALGORITHM_INTERPOLATE_HPP__
11
12#include "algorithm_transformation_weight.hpp"
13#include "transformation.hpp"
14
15namespace xios {
16
17class CAxis;
18class CGrid;
19class CInterpolateAxis;
20
21/*!
22  \class CAxisAlgorithmInterpolate
23  Implementing interpolation on axis
24  The values on axis source are assumed monotonic
25*/
26class CAxisAlgorithmInterpolate : public CAlgorithmTransformationWeight
27{
28public:
29  CAxisAlgorithmInterpolate(bool isSource, CAxis* axisDestination, CAxis* axisSource, CInterpolateAxis* interpAxis);
30
31  virtual ~CAxisAlgorithmInterpolate() {}
32
33  static bool registerTrans();
34
35private:
36  void computeRemap(const std::vector<CArray<double,1>* >& dataAuxInputs) ;
37  void retrieveAllAxisValue(const CArray<double,1>& axisValue, const CArray<bool,1>& axisMask,
38                            std::vector<double>& recvBuff, std::vector<int>& indexVec);
39  void computeInterpolantPoint(const std::vector<double>& recvBuff, const std::vector<int>&, int transPos = 0);
40  void computeWeightedValueAndMapping(const std::map<int, std::vector<std::pair<int,double> > >& interpolatingIndexValues, int transPos = 0);
41  void fillInAxisValue(std::vector<CArray<double,1> >& vecAxisValue,
42                       const std::vector<CArray<double,1>* >& dataAuxInputs);
43
44private:
45  // Interpolation order
46  int order_;
47  StdString coordinate_;
48  std::vector<std::vector<int> > transPosition_;
49  CAxis* axisSrc_=nullptr ;
50  CAxis* axisDest_=nullptr;
51
52public:
53  static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
54                                                CTransformation<CAxis>* transformation,
55                                                int elementPositionInGrid,
56                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
57                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
58                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
59                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
60                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
61                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
62  static bool dummyRegistered_;
63};
64
65}
66
67#endif // __XIOS_AXIS_ALGORITHM_INTERPOLATE_HPP__
Note: See TracBrowser for help on using the repository browser.