source: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm/domain_algorithm_generate_rectilinear.hpp

Last change on this file was 2028, checked in by yushan, 10 months ago

Graph intermediate commit to a tmp branch.

  • Property svn:executable set to *
File size: 2.7 KB
Line 
1/*!
2   \file domain_algorithm_generate_rectilinear.hpp
3   \author Ha NGUYEN
4   \since 31 Aug 2015
5   \date 01 Sep 2015
6
7   \brief Algorithm for automatic generation of rectilinear domain.
8 */
9#ifndef __XIOS_DOMAIN_ALGORITHM_GENERATE_RECTILINEAR_HPP__
10#define __XIOS_DOMAIN_ALGORITHM_GENERATE_RECTILINEAR_HPP__
11
12#include "algorithm_transformation_no_data_modification.hpp"
13#include "transformation.hpp"
14
15namespace xios {
16
17class CGrid;
18class CDomain;
19class CGenerateRectilinearDomain;
20
21/*!
22  \class CDomainAlgorithmGenerateRectilinear
23  Generate a rectilinear or CURVILINEAR domain and fill in necessary its attributes automatically
24  A new rectilinear (or CURVILINEAR) domain will also be distributed automatically among the processes.
25  The number of processes is deduced from the distribution of the grid source.
26*/
27class CDomainAlgorithmGenerateRectilinear : public CAlgorithmTransformationNoDataModification
28{
29public:
30  CDomainAlgorithmGenerateRectilinear(bool isSource, CDomain* domainDestination, CDomain* domainSource,
31                                      CGrid* gridDest, CGrid* gridSource,
32                                      CGenerateRectilinearDomain* zoomDomain);
33
34  virtual ~CDomainAlgorithmGenerateRectilinear() {}
35  static bool registerTrans();
36  virtual bool isGenerateTransformation(void) { return true ;}
37  virtual StdString getAlgoName() {return "\\ngenerate_rectilinear_domain";}
38protected:
39  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
40
41private:
42  void computeDistributionGridSource(CGrid* gridSrc);
43  void computeDistributionGridDestination(CGrid* gridDest);
44  void fillInAttributesDomainDestination();
45
46public:
47  static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
48                                                CTransformation<CDomain>* transformation,
49                                                int elementPositionInGrid,
50                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
51                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
52                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
53                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
54                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
55                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
56private:
57  int nbDomainDistributedPart_; //! Number of local domain.
58  CDomain* domainDest_ ;
59
60  static bool dummyRegistered_;
61};
62
63}
64#endif // __XIOS_DOMAIN_ALGORITHM_GENERATE_RECTILINEAR_HPP__
Note: See TracBrowser for help on using the repository browser.