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

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

Graph intermediate 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  virtual StdString getAlgoName() {return "\\ninterpolate_axis";}
35
36private:
37  void computeRemap(const std::vector<CArray<double,1>* >& dataAuxInputs) ;
38  void retrieveAllAxisValue(const CArray<double,1>& axisValue, const CArray<bool,1>& axisMask,
39                            std::vector<double>& recvBuff, std::vector<int>& indexVec);
40  void computeInterpolantPoint(const std::vector<double>& recvBuff, const std::vector<int>&, int transPos = 0);
41  void computeWeightedValueAndMapping(const std::map<int, std::vector<std::pair<int,double> > >& interpolatingIndexValues, int transPos = 0);
42  void fillInAxisValue(std::vector<CArray<double,1> >& vecAxisValue,
43                       const std::vector<CArray<double,1>* >& dataAuxInputs);
44
45private:
46  // Interpolation order
47  int order_;
48  StdString coordinate_;
49  std::vector<std::vector<int> > transPosition_;
50  CAxis* axisSrc_=nullptr ;
51  CAxis* axisDest_=nullptr;
52
53public:
54  static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
55                                                CTransformation<CAxis>* transformation,
56                                                int elementPositionInGrid,
57                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
58                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
59                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
60                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
61                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
62                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
63  static bool dummyRegistered_;
64};
65
66}
67
68#endif // __XIOS_AXIS_ALGORITHM_INTERPOLATE_HPP__
Note: See TracBrowser for help on using the repository browser.