source: XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_scalar.hpp @ 2291

Last change on this file since 2291 was 2291, checked in by ymipsl, 2 years ago

Improve reduction transformation

  • make the difference between reduction over geometry or reduction between process.
  • geometrical reduction :

domain -> axis
axis -> scalar
domain -> scalar

  • reduction across processes for redondant geometrical cell :

axis -> axis
scalar -> scalar

Reduction can be local (only for the geometrical cell owned by current process) or global, using the "local" attribute (bool) over the reduction.

YM

  • Property svn:executable set to *
File size: 1.9 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 "algorithm_transformation_reduce.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 CAlgorithmTransformationReduce
22{
23public:
24  CScalarAlgorithmReduceScalar(bool isSource, CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo);
25
26  virtual ~CScalarAlgorithmReduceScalar();
27
28  static bool registerTrans();
29
30  virtual StdString getAlgoName() {return "\\nreduce_scalar";}
31protected:
32 
33
34public:
35  static shared_ptr<CGenericAlgorithmTransformation> create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
36                                                CTransformation<CScalar>* transformation,
37                                                int elementPositionInGrid,
38                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
39                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
40                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
41                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
42                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
43                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
44  virtual shared_ptr<CGridAlgorithm> createGridAlgorithm(CGrid* gridSrc, CGrid* gridDst, int pos);
45  static bool dummyRegistered_;
46};
47
48}
49#endif // __XIOS_SCALAR_ALGORITHM_REDUCE_SCALAR_HPP__
Note: See TracBrowser for help on using the repository browser.