source: XIOS/dev/dev_trunk_graph/src/transformation/generic_algorithm_transformation.hpp @ 2023

Last change on this file since 2023 was 2023, checked in by yushan, 8 months ago

Graph intermediate commit to a tmp branch.

File size: 2.0 KB
Line 
1/*!
2   \file generic_algorithm_transformation.hpp
3   \author Ha NGUYEN
4   \since 14 May 2015
5   \date 29 June 2015
6
7   \brief Interface for all transformation algorithms.
8 */
9#ifndef __XIOS_GENERIC_ALGORITHM_TRANSFORMATION_HPP__
10#define __XIOS_GENERIC_ALGORITHM_TRANSFORMATION_HPP__
11
12#include <map>
13#include <set>
14#include "array_new.hpp"
15#include "client_client_dht_template.hpp"
16#include "local_view.hpp"
17#include "transform_connector.hpp"
18#include "weight_transform_connector.hpp"
19
20namespace xios
21{
22  class CGrid;
23  class CDomain;
24  class CAxis;
25  class CScalar;
26  class CGridAlgorithm ;
27  class CTransformFilter ;
28  class CGarbageCollector ;
29
30  /*!
31  \class CGenericAlgorithmTransformation
32  This class defines the interface for all other inherited algorithms class
33  */
34class CGenericAlgorithmTransformation
35{
36  public : 
37    CGenericAlgorithmTransformation(bool isSource) ;
38    virtual CGridAlgorithm* createGridAlgorithm(CGrid* gridSrc, CGrid* newGrid, int pos) ;
39    virtual CTransformFilter* createTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue) ;
40    virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut) { abort() ;} //=0
41    virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, const vector<CArray<double,1>>& auxData, CArray<double,1>& dataOut) { abort() ;} //=0
42    virtual bool isGenerateTransformation(void) { return false ;}
43   
44    virtual StdString getAlgoName() { return "\\nGeneric algorithm transformation";}
45
46    virtual vector<string> getAuxFieldId(void) ;
47  protected :
48    typedef std::unordered_map<int, std::vector<int> > TransformationIndexMap;
49    typedef std::unordered_map<int, std::vector<double> > TransformationWeightMap;
50 
51    CLocalElement* recvElement_=nullptr ;
52    bool isSource_ ;
53
54  public:
55    CLocalElement* getRecvElement(void) { return recvElement_ ;}
56 
57};
58
59}
60#endif // __XIOS_GENERIC_ALGORITHM_TRANSFORMATION_HPP__
Note: See TracBrowser for help on using the repository browser.