source: XIOS/trunk/src/transformation/axis_algorithm_interpolate.hpp @ 827

Last change on this file since 827 was 827, checked in by mhnguyen, 8 years ago

Implementing dynamic interpolation on axis

+) Change grid transformation to make it more flexible
+) Make some small improvements

Test
+) On Curie
+) All test pass

File size: 1.6 KB
RevLine 
[630]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 "axis_algorithm_transformation.hpp"
13#include "axis.hpp"
14#include "interpolate_axis.hpp"
15
16namespace xios {
17/*!
18  \class CAxisAlgorithmInterpolate
19  Implementing interpolation on axis
20  The values on axis source are assumed monotonic
21*/
22class CAxisAlgorithmInterpolate : public CAxisAlgorithmTransformation
23{
24public:
25  CAxisAlgorithmInterpolate(CAxis* axisDestination, CAxis* axisSource, CInterpolateAxis* interpAxis);
26
27  virtual ~CAxisAlgorithmInterpolate() {}
28
[827]29protected:
30  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
[630]31
32private:
[827]33  void retrieveAllAxisValue(const CArray<double,1>& axisValue, const CArray<bool,1>& axisMask,
34                            std::vector<double>& recvBuff, std::vector<int>& indexVec);
35  void computeInterpolantPoint(const std::vector<double>& recvBuff, const std::vector<int>& indexVec, int transPos = 0);
36  void computeWeightedValueAndMapping(const std::map<int, std::vector<std::pair<int,double> > >& interpolatingIndexValues, int transPos = 0);
37  void fillInAxisValue(std::vector<CArray<double,1> >& vecAxisValue,
38                       const std::vector<CArray<double,1>* >& dataAuxInputs);
[630]39
40private:
41  // Interpolation order
42  int order_;
[827]43  StdString coordinate_;
44  std::vector<std::vector<int> > transPosition_;
[630]45};
46
47}
48#endif // __XIOS_AXIS_ALGORITHM_INTERPOLATE_HPP__
Note: See TracBrowser for help on using the repository browser.