source: XIOS/trunk/src/transformation/scalar_algorithm_reduce_domain.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.3 KB
Line 
1/*!
2   \file scalar_algorithm_reduce_scalar.hpp
3   \author Ha NGUYEN
4   \since 13 Oct 2016
5   \date 13 Oct 2016
6
7   \brief Algorithm for reduce an DOMAIN to a scalar
8 */
9#ifndef __XIOS_SCALAR_ALGORITHM_REDUCE_DOMAIN_HPP__
10#define __XIOS_SCALAR_ALGORITHM_REDUCE_DOMAIN_HPP__
11
12#include "scalar_algorithm_transformation.hpp"
13#include "transformation.hpp"
14
15namespace xios {
16
17class CScalar;
18class CDomain;
19class CReduceDomainToScalar;
20class CReductionAlgorithm;
21
22/*!
23  \class CScalarAlgorithmReduceDomain
24  Reducing an DOMAIN to a scalar
25*/
26class CScalarAlgorithmReduceDomain : public CScalarAlgorithmTransformation
27{
28public:
29  CScalarAlgorithmReduceDomain(CScalar* scalarDestination, CDomain* domainSource, CReduceDomainToScalar* 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                     bool ignoreMissingValue, bool firstPass);
36
37  virtual void updateData(CArray<double,1>& dataOut);
38 
39  virtual ~CScalarAlgorithmReduceDomain();
40
41  static bool registerTrans();
42
43  virtual StdString getName() {return "Scalar Trans. Filter \\n Reduce Domain";}
44
45protected:
46  bool local ;
47  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
48
49protected:
50  CReductionAlgorithm* reduction_;
51
52private:
53
54  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
55                                                CTransformation<CScalar>* transformation,
56                                                int elementPositionInGrid,
57                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
58                                                std::map<int, int>& elementPositionInGridSrc2DOMAINPosition,
59                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
60                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
61                                                std::map<int, int>& elementPositionInGridDst2DOMAINPosition,
62                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
63};
64
65}
66#endif // __XIOS_SCALAR_ALGORITHM_REDUCE_DOMAIN_HPP__
Note: See TracBrowser for help on using the repository browser.