# source:XIOS/trunk/src/transformation/scalar_algorithm_extract_axis.hpp@960

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

New transformation: Extract a point on axis to a scalar

+) Add new node and new transformation algorithm

Test
+) On Curie
+) Work

File size: 2.2 KB
Line
1/*!
2   \file scalar_algorithm_extract_scalar.hpp
3   \author Ha NGUYEN
4   \since 23 June 2016
5   \date 23 June 2016
6
7   \brief Algorithm for extract an axis to a scalar
8 */
9#ifndef __XIOS_SCALAR_ALGORITHM_EXTRACT_AXIS_HPP__
10#define __XIOS_SCALAR_ALGORITHM_EXTRACT_AXIS_HPP__
11
12#include "scalar_algorithm_transformation.hpp"
13#include "transformation.hpp"
14
15namespace xios {
16
17class CScalar;
18class CAxis;
19class CExtractAxisToScalar;
20class CReductionAlgorithm;
21
22/*!
23  \class CScalarAlgorithmExtractScalar
24  Extract a scalar from an axis
25*/
26class CScalarAlgorithmExtractScalar : public CScalarAlgorithmTransformation
27{
28public:
29  CScalarAlgorithmExtractScalar(CScalar* scalarDestination, CAxis* axisSource, CExtractAxisToScalar* algo);
30
31  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
32                     const double* dataInput,
33                     CArray<double,1>& dataOut,
34                     std::vector<bool>& flagInitial,
35                     const double& defaultValue);
36
37  virtual ~CScalarAlgorithmExtractScalar();
38
39  static bool registerTrans();
40
41protected:
42  int pos_;
43
44protected:
45  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
46
47protected:
48  CReductionAlgorithm* reduction_;
49
50private:
51  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
52                                                CTransformation<CScalar>* transformation,
53                                                int elementPositionInGrid,
54                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
55                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
56                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
57                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
58                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
59                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
60};
61
62}
63#endif // __XIOS_SCALAR_ALGORITHM_EXTRACT_AXIS_HPP__
Note: See TracBrowser for help on using the repository browser.