00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00103 #ifndef __vtkPLOT3DReader_h
00104 #define __vtkPLOT3DReader_h
00105
00106 #include <stdio.h>
00107 #include "vtkStructuredGridSource.h"
00108 #include "vtkScalars.h"
00109 #include "vtkVectors.h"
00110
00111
00112 #define VTK_WHOLE_SINGLE_GRID_NO_IBLANKING 0
00113 #define VTK_WHOLE_MULTI_GRID_NO_IBLANKING 2
00114
00115 class VTK_EXPORT vtkPLOT3DReader : public vtkStructuredGridSource
00116 {
00117 public:
00118 static vtkPLOT3DReader *New();
00119 vtkTypeMacro(vtkPLOT3DReader,vtkStructuredGridSource);
00120 void PrintSelf(ostream& os, vtkIndent indent);
00121
00123 vtkSetClampMacro(FileFormat,int,0,7);
00124 vtkGetMacro(FileFormat,int);
00125
00127 vtkSetStringMacro(XYZFileName);
00128 vtkGetStringMacro(XYZFileName);
00129
00131 vtkSetStringMacro(QFileName);
00132 vtkGetStringMacro(QFileName);
00133
00135 vtkSetStringMacro(FunctionFileName);
00136 vtkGetStringMacro(FunctionFileName);
00137
00139 vtkSetStringMacro(VectorFunctionFileName);
00140 vtkGetStringMacro(VectorFunctionFileName);
00141
00143 vtkSetMacro(GridNumber,int);
00144 vtkGetMacro(GridNumber,int);
00145
00148 vtkSetMacro(ScalarFunctionNumber,int);
00149 vtkGetMacro(ScalarFunctionNumber,int);
00150
00153 vtkSetMacro(VectorFunctionNumber,int);
00154 vtkGetMacro(VectorFunctionNumber,int);
00155
00156
00158 vtkGetMacro(Fsmach,float);
00159
00161 vtkGetMacro(Alpha,float);
00162
00164 vtkGetMacro(Re,float);
00165
00167 vtkGetMacro(Time,float);
00168
00170 vtkSetMacro(R,float);
00171 vtkGetMacro(R,float);
00172
00174 vtkSetMacro(Gamma,float);
00175 vtkGetMacro(Gamma,float);
00176
00178 vtkSetMacro(Uvinf,float);
00179 vtkGetMacro(Uvinf,float);
00180
00182 vtkSetMacro(Vvinf,float);
00183 vtkGetMacro(Vvinf,float);
00184
00186 vtkSetMacro(Wvinf,float);
00187 vtkGetMacro(Wvinf,float);
00188
00191 vtkGetMacro(NumberOfGrids, int);
00192
00193 protected:
00194 vtkPLOT3DReader();
00195 ~vtkPLOT3DReader();
00196 vtkPLOT3DReader(const vtkPLOT3DReader&) {};
00197 void operator=(const vtkPLOT3DReader&) {};
00198
00199 void ExecuteInformation();
00200 void Execute();
00201 int GetFileType(FILE *fp);
00202
00203
00204 int FileFormat;
00205 char *XYZFileName;
00206 char *QFileName;
00207 char *FunctionFileName;
00208 char *VectorFunctionFileName;
00209
00210
00211 int GridNumber;
00212 int ScalarFunctionNumber;
00213 int VectorFunctionNumber;
00214 int FunctionFileFunctionNumber;
00215 void MapFunction(int fNumber,vtkPointData *outputPD);
00216
00217
00218 float *TempStorage;
00219 int NumberOfPoints;
00220 int NumberOfGrids;
00221
00222
00223 float Fsmach;
00224 float Alpha;
00225 float Re;
00226 float Time;
00227
00228
00229 float R;
00230 float Gamma;
00231 float Uvinf;
00232 float Vvinf;
00233 float Wvinf;
00234
00235
00236 int ReadBinaryGrid(FILE *fp,vtkStructuredGrid *output);
00237 int ReadBinaryGridDimensions(FILE *fp, vtkStructuredGrid *output);
00238 int ReadBinarySolution(FILE *fp, vtkStructuredGrid *output);
00239 int ReadBinaryFunctionFile(FILE *fp, vtkStructuredGrid *output);
00240 int ReadBinaryVectorFunctionFile(FILE *fp, vtkStructuredGrid *output);
00241
00242 vtkPoints *Grid;
00243 vtkScalars *Density;
00244 vtkScalars *Energy;
00245 vtkVectors *Momentum;
00246
00247
00248 void ComputeDensity(vtkPointData *outputPD);
00249 void ComputePressure(vtkPointData *outputPD);
00250 void ComputeTemperature(vtkPointData *outputPD);
00251 void ComputeEnthalpy(vtkPointData *outputPD);
00252 void ComputeInternalEnergy(vtkPointData *outputPD);
00253 void ComputeKineticEnergy(vtkPointData *outputPD);
00254 void ComputeVelocityMagnitude(vtkPointData *outputPD);
00255 void ComputeStagnationEnergy(vtkPointData *outputPD);
00256 void ComputeEntropy(vtkPointData *outputPD);
00257 void ComputeSwirl(vtkPointData *outputPD);
00258
00259 void ComputeVelocity(vtkPointData *outputPD);
00260 void ComputeVorticity(vtkPointData *outputPD);
00261 void ComputeMomentum(vtkPointData *outputPD);
00262 void ComputePressureGradient(vtkPointData *outputPD);
00263 };
00264
00265 #endif
00266
00267