source: XIOS/trunk/src/transformation/scalar_algorithm_reduce_scalar.hpp @ 1704

Last change on this file since 1704 was 1704, checked in by yushan, 5 years ago

Introducing the new graph functionality. Attribute build_workflow_graph=.TRUE. is used in the field definition section in the xml file to enable the workflow graph of the field and other fields referecing to it. A more detailed document will be available soon on the graph fuctionality.

File size: 2.2 KB
Line 
1/*!
2   \file scalar_algorithm_reduce_scalar.hpp
3   \brief Algorithm for reduce an scalar to a scalar
4 */
5#ifndef __XIOS_SCALAR_ALGORITHM_REDUCE_SCALAR_HPP__
6#define __XIOS_SCALAR_ALGORITHM_REDUCE_SCALAR_HPP__
7
8#include "scalar_algorithm_transformation.hpp"
9#include "transformation.hpp"
10
11namespace xios {
12
13class CScalar;
14class CReduceScalarToScalar;
15class CReductionAlgorithm;
16
17/*!
18  \class CScalarAlgorithmReduceScalar
19  Reducing an scalar to a scalar
20*/
21class CScalarAlgorithmReduceScalar : public CScalarAlgorithmTransformation
22{
23public:
24  CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo);
25
26  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
27                     const double* dataInput,
28                     CArray<double,1>& dataOut,
29                     std::vector<bool>& flagInitial,
30                     bool ignoreMissingValue, bool firstPass);
31
32  virtual void updateData(CArray<double,1>& dataOut);
33 
34  virtual ~CScalarAlgorithmReduceScalar();
35
36  static bool registerTrans();
37
38  virtual StdString getName() {return "Scalar Trans. Filter \\n Reduce Scalar";}
39
40protected:
41  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
42
43protected:
44  CReductionAlgorithm* reduction_;
45
46private:
47
48  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
49                                                CTransformation<CScalar>* transformation,
50                                                int elementPositionInGrid,
51                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
52                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
53                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
54                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
55                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
56                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
57};
58
59}
60#endif // __XIOS_SCALAR_ALGORITHM_REDUCE_SCALAR_HPP__
Note: See TracBrowser for help on using the repository browser.