7 #include "vtkSmartPointer.h" 9 class vtkUnstructuredGrid;
28 template <Gr
idType gr
idType>
42 void SetNLon(
int nlon) { this->NLon = nlon; }
43 void SetNLat(
int nlat) { this->NLat = nlat; }
49 this->Lev =
new double[nlev];
50 std::copy(lev, lev + nlev, this->Lev);
58 void SetAttributeValue(
int chunkSize,
double* lonRad,
double* latRad,
double* psScalar,
59 double* tScalar,
double* uScalar,
double* vScalar);
62 vtkSmartPointer<vtkUnstructuredGrid>
GetGrid2d()
const {
return this->Grid2d; }
64 vtkSmartPointer<vtkUnstructuredGrid>
GetGrid3d()
const {
return this->Grid3d; }
67 vtkSmartPointer<vtkUnstructuredGrid> grid);
74 void SetCubeGridPoints(
int ne,
int np,
int lonSize,
double* lonRad,
int latSize,
double* latRad);
80 int* nstep,
int* chunkCols,
double* lonRad,
double* latRad,
double* psScalar,
double* tScalar);
83 vtkSmartPointer<vtkUnstructuredGrid> CreateGrid2d();
86 vtkSmartPointer<vtkUnstructuredGrid> CreateGrid3d();
94 double LevelToRadius(
double level)
const;
98 void GetLevMinusPlus(
int levIndex,
double* levMinus,
double* levPlus)
const;
99 void GetLatMinusPlus(
int latIndex,
double* latMinus,
double* latPlus)
const;
100 void GetLonMinusPlus(
int lonIndex,
double* lonMinus,
double* lonPlus)
const;
104 void GetValueIndex(
double lonRad,
double latRad, std::vector<std::vector<int> >& index)
const;
107 void GetCellPoints(
const int index[3],
double cellPoints[4][3])
const;
108 void GetCellPoints(
const int index[3],
int level,
double cell[8][3])
const;
111 void GetPointIds(
const int index[3],
int pointIndexes[4])
const;
112 void GetPointIds(
const int index[3],
int level,
int pointIndexes[8])
const;
115 int GetCellId(
const int index[3])
const;
116 int GetCellId(
const int index[3],
int level)
const;
121 size_t CubeToIndex(
double side,
const std::vector<double>& cubeCoordinates,
double v[3],
122 std::vector<std::vector<int> >& index)
const;
126 void IndexToCube(
const std::vector<double>& cubeCoordinates,
double index[3],
double v[3])
const;
127 void CubeToSpherical(
double v[3],
double* lonRad,
double* latRad)
const;
131 void MinFaceIndex(
int side,
int index[3])
const;
137 int NLon, NLat, NLev;
157 vtkSmartPointer<vtkUnstructuredGrid> Grid2d;
158 int RankArrayIndex2d;
159 int CoordArrayIndex2d;
163 vtkSmartPointer<vtkUnstructuredGrid> Grid3d;
164 int RankArrayIndex3d;
165 int CoordArrayIndex3d;
static bool SetToCoprocessor(vtkCPDataDescription *coprocessorData, const char *name, vtkSmartPointer< vtkUnstructuredGrid > grid)
Attach the grid to the coprocessor data.
void SetChunkCapacity(int capacity)
void SetCubeGridPoints(int ne, int np, int lonSize, double *lonRad, int latSize, double *latRad)
used for the SE dynamic core only
void SetLatStep(int step)
void AddPointsAndCells(double lonRad, double latRad)
Adds the points and the cells for a vertical column to the grid.
vtkSmartPointer< vtkUnstructuredGrid > GetGrid2d() const
Returns the 2D grid.
~Grid()
Deletes data used to build the grids.
Creates and accumulates data for a 2D and a 3D grid.
vtkSmartPointer< vtkUnstructuredGrid > GetGrid3d() const
Returns the 3D grid.
void SetLev(int nlev, double *lev)
void SetMpiRank(int rank)
void SetAttributeValue(int chunkSize, double *lonRad, double *latRad, double *psScalar, double *tScalar, double *uScalar, double *vScalar)
Sets attributes for a chunk (a list of vertical columns) to the 2D and 3D grids.
void SetNCells2d(int ncells)
void SetLonStep(int step)
used for the FV dynamic core only
void Create()
Creates a 2D and a 3D grid.
This class provides the description of the data for the coprocessor pipelines.