source: XIOS/trunk/src/transformation/grid_generate.hpp @ 687

Last change on this file since 687 was 687, checked in by mhnguyen, 9 years ago

Implementing auto-generate rectilinear domain

+) Add a new special transformation to generate (complete) rectilinear domain

Test
+) On Curie
+) test_new_feature passed

File size: 2.3 KB
Line 
1/*!
2   \file grid_generate.hpp
3   \author Ha NGUYEN
4   \since 28 Aug 2015
5   \date 28 Aug 2015
6
7   \brief A special transformation to generate a grid.
8 */
9#ifndef __XIOS_GRID_GENERATE_HPP__
10#define __XIOS_GRID_GENERATE_HPP__
11
12#include "xios_spl.hpp"
13#include "transformation_enum.hpp"
14#include "generic_algorithm_transformation.hpp"
15
16namespace xios {
17
18class CGrid;
19
20/*!
21  \class CGridGenerate
22  This class creates a grid from scratch, e.g: only global dimension of grid and its type are provided,
23then the generated grid plays the destination in a transformation. Not only some attributes of grid and its subcomponents are filled in
24automatically but it also have a distribution which might be different from one of grid source.
25This class only plays a role of interface between XIOS and specific algorithm of auto filling-in and auto distributing on sub-component
26*/
27class CGridGenerate
28{
29public:
30  typedef std::list<std::pair<int,std::pair<ETranformationType,int> > > ListAlgoType;
31
32public:
33  /** Default constructor */
34  CGridGenerate(CGrid* destination, CGrid* source);
35  ~CGridGenerate();
36
37  void completeGrid();
38  ListAlgoType getAlgoList() const {return listAlgos_; }
39
40protected:
41  void initializeAlgorithms();
42  void initializeAxisAlgorithms(int axisPositionInGrid);
43  void initializeDomainAlgorithms(int domPositionInGrid);
44
45  void selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
46  void selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
47  void selectAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder, bool isDomainAlgo);
48
49protected:
50  //! Grid source on transformation
51  CGrid* gridSource_;
52
53  //! Grid destination on transformation
54  CGrid* gridDestination_;
55
56protected:
57  //! List of algorithm types and their order
58  ListAlgoType listAlgos_;
59  // true if domain algorithm and false if axis algorithm (can be replaced by tuple with listAlgos_
60  std::vector<bool> algoTypes_;
61
62  // Mapping between position of an element in grid and its transformation (if any)
63  std::list<CGenericAlgorithmTransformation*> algoTransformation_;
64
65  //! Position of axis and domain in grid
66  std::map<int, int> elementPosition2AxisPositionInGrid_, elementPosition2DomainPositionInGrid_;
67};
68
69}
70#endif // __XIOS_GRID_GENERATE_HPP__
Note: See TracBrowser for help on using the repository browser.