[1985] | 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 | |
---|
[1998] | 12 | #include "algorithm_transformation_no_data_modification.hpp" |
---|
[1988] | 13 | #include "transformation.hpp" |
---|
[1985] | 14 | |
---|
| 15 | namespace xios { |
---|
| 16 | |
---|
| 17 | class CGrid; |
---|
| 18 | class CDomain; |
---|
| 19 | class 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 | */ |
---|
[1998] | 27 | class CDomainAlgorithmGenerateRectilinear : public CAlgorithmTransformationNoDataModification |
---|
[1985] | 28 | { |
---|
| 29 | public: |
---|
[1988] | 30 | CDomainAlgorithmGenerateRectilinear(bool isSource, CDomain* domainDestination, CDomain* domainSource, |
---|
[1985] | 31 | CGrid* gridDest, CGrid* gridSource, |
---|
| 32 | CGenerateRectilinearDomain* zoomDomain); |
---|
| 33 | |
---|
| 34 | virtual ~CDomainAlgorithmGenerateRectilinear() {} |
---|
[1988] | 35 | static bool registerTrans(); |
---|
[2016] | 36 | virtual bool isGenerateTransformation(void) { return true ;} |
---|
[1985] | 37 | |
---|
| 38 | protected: |
---|
| 39 | void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); |
---|
| 40 | |
---|
| 41 | private: |
---|
| 42 | void computeDistributionGridSource(CGrid* gridSrc); |
---|
| 43 | void computeDistributionGridDestination(CGrid* gridDest); |
---|
| 44 | void fillInAttributesDomainDestination(); |
---|
[2011] | 45 | |
---|
| 46 | public: |
---|
[1988] | 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); |
---|
[1985] | 56 | private: |
---|
| 57 | int nbDomainDistributedPart_; //! Number of local domain. |
---|
[1998] | 58 | CDomain* domainDest_ ; |
---|
[1985] | 59 | |
---|
| 60 | static bool dummyRegistered_; |
---|
| 61 | }; |
---|
| 62 | |
---|
| 63 | } |
---|
| 64 | #endif // __XIOS_DOMAIN_ALGORITHM_GENERATE_RECTILINEAR_HPP__ |
---|