7 #include "vtkSmartPointer.h" 9 class vtkUnstructuredGrid;
10 class vtkCPDataDescription;
30 template<Gr
idType gr
idType>
48 this->ChunkCapacity = capacity;
52 this->NCells2d = ncells;
67 this->Lev =
new double[nlev];
68 std::copy(lev, lev + nlev, this->Lev);
77 double* lonRad,
double* latRad,
78 double* psScalar,
double *tScalar,
double* uScalar,
82 vtkSmartPointer<vtkUnstructuredGrid>
GetGrid2d()
const 87 vtkSmartPointer<vtkUnstructuredGrid>
GetGrid3d()
const 93 vtkCPDataDescription* coprocessorData,
const char* name,
94 vtkSmartPointer<vtkUnstructuredGrid> grid);
101 this->LonStep = step;
105 this->LatStep = step;
109 int ne,
int np,
int lonSize,
double* lonRad,
int latSize,
double* latRad);
115 int* nstep,
int* chunkCols,
116 double* lonRad,
double* latRad,
double* psScalar,
double *tScalar);
119 vtkSmartPointer<vtkUnstructuredGrid> CreateGrid2d();
122 vtkSmartPointer<vtkUnstructuredGrid> CreateGrid3d();
130 double LevelToRadius(
double level)
const;
134 void GetLevMinusPlus(
int levIndex,
double* levMinus,
double* levPlus)
const;
135 void GetLatMinusPlus(
int latIndex,
double* latMinus,
double* latPlus)
const;
136 void GetLonMinusPlus(
int lonIndex,
double* lonMinus,
double* lonPlus)
const;
140 void GetValueIndex(
double lonRad,
double latRad,
141 std::vector<std::vector<int> >& index)
const;
144 void GetCellPoints(
const int index[3],
double cellPoints[4][3])
const;
145 void GetCellPoints(
const int index[3],
int level,
double cell[8][3])
const;
148 void GetPointIds(
const int index[3],
int pointIndexes[4])
const;
149 void GetPointIds(
const int index[3],
int level,
int pointIndexes[8])
const;
152 int GetCellId(
const int index[3])
const;
153 int GetCellId(
const int index[3],
int level)
const;
158 size_t CubeToIndex (
double side,
const std::vector<double>& cubeCoordinates,
double v[3],
159 std::vector<std::vector<int> >& index)
const;
163 void IndexToCube (
const std::vector<double>& cubeCoordinates,
164 double index[3],
double v[3])
const;
165 void CubeToSpherical (
double v[3],
double* lonRad,
double* latRad)
const;
169 void MinFaceIndex(
int side,
int index[3])
const;
175 int NLon, NLat, NLev;
195 vtkSmartPointer<vtkUnstructuredGrid> Grid2d;
196 int RankArrayIndex2d;
197 int CoordArrayIndex2d;
201 vtkSmartPointer<vtkUnstructuredGrid> Grid3d;
202 int RankArrayIndex3d;
203 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.