VTK
vtkMFIXReader.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkMFIXReader.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
38#ifndef vtkMFIXReader_h
39#define vtkMFIXReader_h
40
41#include "vtkIOGeometryModule.h" // For export macro
43
45class vtkDoubleArray;
46class vtkStringArray;
47class vtkIntArray;
48class vtkFloatArray;
50class vtkWedge;
51class vtkQuad;
52class vtkHexahedron;
53class vtkPoints;
54class vtkStdString;
55
56class VTKIOGEOMETRY_EXPORT vtkMFIXReader : public vtkUnstructuredGridAlgorithm
57{
58public:
59 static vtkMFIXReader *New();
61 void PrintSelf(ostream& os, vtkIndent indent);
62
64
67 vtkSetStringMacro(FileName);
70
72
76 vtkGetMacro(NumberOfCells,int);
78
80
84 vtkGetMacro(NumberOfPoints,int);
86
88
91 vtkGetMacro(NumberOfCellFields,int);
93
95
98 vtkSetMacro(TimeStep, int);
99 vtkGetMacro(TimeStep, int);
101
103
106 vtkGetMacro(NumberOfTimeSteps, int);
108
110
113 vtkGetVector2Macro(TimeStepRange, int);
114 vtkSetVector2Macro(TimeStepRange, int);
116
121
126 const char* GetCellArrayName(int index);
127
129
133 int GetCellArrayStatus(const char* name);
134 void SetCellArrayStatus(const char* name, int status);
136
138
144
148 void GetCellDataRange(int cellComp, float *min, float *max);
149
150protected:
157
158 //
159 // ParaView Variables
160 //
161
162 char *FileName;
177 int TimeStepRange[2];
179
180 //
181 // MFIX Variables
182 //
183
184 vtkFloatArray **CellDataArray; // Arrays for variables that will
185 //attach to mesh
186 vtkPoints *Points; // Points array for building grid
187 vtkUnstructuredGrid *Mesh; // Unstructured Grid
188 vtkHexahedron *AHexahedron; // Hexahedron type cell
189 vtkWedge *AWedge; // Wedge type cell
190 vtkQuad *AQuad; // Quad type cell
191 vtkIntArray *Flag; // Cell Flag array
192 vtkDoubleArray *Dx; // Cell widths in x axis
193 vtkDoubleArray *Dy; // Cell widths in y axis
194 vtkDoubleArray *Dz; // Cell widths in z axis
195 vtkIntArray *NMax; // Array to hold number of species per phase
196 vtkDoubleArray *C; // Array used to parse restart file
197 vtkIntArray *TempI; // Array used to parse restart file
198 vtkDoubleArray *TempD; // Array used to parse restart file
199 vtkIntArray *SpxFileExists; // Array for keeping track of
200 // what spx files exist.
201
202 char FileExtension[15];
203 char DataBuffer[513];
204 char Version[120];
210 double Ce;
211 double Cf;
212 double Phi;
213 double PhiW;
214 double DeltaTime;
215 double XMinimum;
216 char RunName[256];
233 int MMAX;
235 double XLength;
236 double YLength;
237 double ZLength;
241 char CoordinateSystem[17];
242 char Units[17];
243
244 //
245 // SPX Variables
246 //
247
248 int MaximumTimestep; // maximum timesteps amongst the variables
249 int SPXRecordsPerTimestep; // number of records in a single
250 // timestep for a variable
251 vtkIntArray *SPXToNVarTable; // number of variables in each spx file
252 vtkIntArray *VariableToSkipTable; // skip value for each variable, this
253 // is needed in spx files
254 // with more than one variable.
255 vtkIntArray *VariableTimesteps; // number of timesteps for each variable
256 vtkIntArray *VariableTimestepTable; // Since the number of timesteps
257 // vary between variables
258 // this is a table that looks
259 // up the appropriate timestep
260 // for the particular variable.
261 vtkIntArray *variableIndexToSPX; // This gives the spx file number for the
262 // particular variable.
263 vtkIntArray *VariableIndexToSPX; // This gives the spx file number for the
264 // particular variable.
265 vtkIntArray *SPXTimestepIndexTable; // This a table look up for the index
266 // into a file for a certain variable.
267
268private:
269 vtkMFIXReader(const vtkMFIXReader&) VTK_DELETE_FUNCTION;
270 void operator=(const vtkMFIXReader&) VTK_DELETE_FUNCTION;
271
272 void MakeMesh(vtkUnstructuredGrid *output);
273 void SwapDouble(double &value);
274 void SwapFloat(float &value);
275 void SwapInt(int &value);
276 vtkStdString ConvertIntToString(int in);
277 int ConvertCharToInt(char in);
278 int ConvertStringToInt(const vtkStdString & in);
279 void GetInt(istream& in, int &val);
280 void GetDouble(istream& in, double& val);
281 void GetFloat(istream& in, float& val);
282 void SkipBytes(istream& in, int n);
283 void RestartVersionNumber(const char* buffer);
284 void GetBlockOfDoubles(istream& in, vtkDoubleArray *v, int n);
285 void GetBlockOfFloats(istream& in, vtkFloatArray *v, int n);
286 void GetBlockOfInts(istream& in, vtkIntArray *v, int n);
287 void ReadRestartFile();
288 void GetVariableAtTimestep(int vari , int tstep, vtkFloatArray *v);
289 void CreateVariableNames();
290 void GetTimeSteps();
291 void MakeTimeStepTable(int nvars);
292 void SetProjectName (const char *infile);
293 void MakeSPXTimeStepIndexTable(int nvars);
294 void CalculateMaxTimeStep();
295 void GetNumberOfVariablesInSPXFiles();
296 void FillVectorVariable( int xindex, int yindex, int zindex,
297 vtkFloatArray *v);
298 void ConvertVectorFromCylindricalToCartesian( int xindex, int zindex);
299 void GetAllTimes(vtkInformationVector *outputVector);
300
301};
302
303#endif
Store on/off settings for data arrays for a vtkSource.
dynamic, self-adjusting array of double
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:48
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:46
reads a dataset in MFIX file format
Definition: vtkMFIXReader.h:57
const char * GetCellArrayName(int index)
Get the name of the cell array with the given index in the input.
vtkIntArray * SPXToNVarTable
vtkQuad * AQuad
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkIntArray * Flag
vtkHexahedron * AHexahedron
int GetNumberOfCellArrays(void)
Get the number of cell arrays available in the input.
void SetCellArrayStatus(const char *name, int status)
int GetCellArrayStatus(const char *name)
Get/Set whether the cell array with the given name is to be read.
vtkUnstructuredGrid * Mesh
int NumberOfReactionRates
vtkIntArray * VariableToSkipTable
vtkIntArray * SPXTimestepIndexTable
vtkDoubleArray * TempD
vtkDoubleArray * Dz
vtkIntArray * VariableTimestepTable
vtkWedge * AWedge
vtkDoubleArray * Dx
vtkStringArray * VariableNames
vtkIntArray * VariableTimesteps
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkDataArraySelection * CellDataArraySelection
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkIntArray * NMax
vtkIntArray * VariableComponents
vtkFloatArray ** CellDataArray
int SPXRecordsPerTimestep
vtkDoubleArray * Dy
vtkIntArray * SpxFileExists
void EnableAllCellArrays()
vtkFloatArray * Maximum
vtkIntArray * VectorLength
static vtkMFIXReader * New()
vtkIntArray * VariableIndexToSPX
int RequestInformationFlag
vtkFloatArray * Minimum
void DisableAllCellArrays()
Turn on/off all cell arrays.
vtkPoints * Points
int NumberOfSPXFilesUsed
vtkDoubleArray * C
vtkIntArray * variableIndexToSPX
vtkIntArray * TempI
void GetCellDataRange(int cellComp, float *min, float *max)
Get the range of cell data.
represent and manipulate 3D points
Definition: vtkPoints.h:40
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:42
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
a vtkAbstractArray subclass for strings
Superclass for algorithms that produce only unstructured grid as output.
dataset represents arbitrary combinations of all possible cell types
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:50
Write VTK XML UnstructuredGrid files.
@ value
Definition: vtkX3D.h:220
@ name
Definition: vtkX3D.h:219
@ index
Definition: vtkX3D.h:246
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
#define max(a, b)