VTK  9.2.6
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=========================================================================*/
37
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) override;
62
64
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:
152 ~vtkMFIXReader() override;
155
156 //
157 // ParaView Variables
158 //
159
160 char* FileName;
177
178 //
179 // MFIX Variables
180 //
181
182 vtkFloatArray** CellDataArray; // Arrays for variables that will
183 // attach to mesh
184 vtkPoints* Points; // Points array for building grid
185 vtkUnstructuredGrid* Mesh; // Unstructured Grid
186 vtkHexahedron* AHexahedron; // Hexahedron type cell
187 vtkWedge* AWedge; // Wedge type cell
188 vtkQuad* AQuad; // Quad type cell
189 vtkIntArray* Flag; // Cell Flag array
190 vtkDoubleArray* Dx; // Cell widths in x axis
191 vtkDoubleArray* Dy; // Cell widths in y axis
192 vtkDoubleArray* Dz; // Cell widths in z axis
193 vtkIntArray* NMax; // Array to hold number of species per phase
194 vtkDoubleArray* C; // Array used to parse restart file
195 vtkIntArray* TempI; // Array used to parse restart file
196 vtkDoubleArray* TempD; // Array used to parse restart file
197 vtkIntArray* SpxFileExists; // Array for keeping track of
198 // what spx files exist.
199
201 char DataBuffer[513];
202 char Version[120];
208 double Ce;
209 double Cf;
210 double Phi;
211 double PhiW;
212 double DeltaTime;
213 double XMinimum;
214 char RunName[256];
231 int MMAX;
233 double XLength;
234 double YLength;
235 double ZLength;
240 char Units[17];
241
242 //
243 // SPX Variables
244 //
245
246 int MaximumTimestep; // maximum timesteps amongst the variables
247 int SPXRecordsPerTimestep; // number of records in a single
248 // timestep for a variable
249 vtkIntArray* SPXToNVarTable; // number of variables in each spx file
250 vtkIntArray* VariableToSkipTable; // skip value for each variable, this
251 // is needed in spx files
252 // with more than one variable.
253 vtkIntArray* VariableTimesteps; // number of timesteps for each variable
254 vtkIntArray* VariableTimestepTable; // Since the number of timesteps
255 // vary between variables
256 // this is a table that looks
257 // up the appropriate timestep
258 // for the particular variable.
259 vtkIntArray* variableIndexToSPX; // This gives the spx file number for the
260 // particular variable.
261 vtkIntArray* VariableIndexToSPX; // This gives the spx file number for the
262 // particular variable.
263 vtkIntArray* SPXTimestepIndexTable; // This a table look up for the index
264 // into a file for a certain variable.
265
266private:
267 vtkMFIXReader(const vtkMFIXReader&) = delete;
268 void operator=(const vtkMFIXReader&) = delete;
269
270 void MakeMesh(vtkUnstructuredGrid* output);
271 void SwapDouble(double& value);
272 void SwapFloat(float& value);
273 void SwapInt(int& value);
274 vtkStdString ConvertIntToString(int in);
275 int ConvertCharToInt(char in);
276 int ConvertStringToInt(const vtkStdString& in);
277 void GetInt(istream& in, int& val);
278 void GetDouble(istream& in, double& val);
279 void GetFloat(istream& in, float& val);
280 void SkipBytes(istream& in, int n);
281 void RestartVersionNumber(const char* buffer);
282 void GetBlockOfDoubles(istream& in, vtkDoubleArray* v, int n);
283 void GetBlockOfFloats(istream& in, vtkFloatArray* v, int n);
284 void GetBlockOfInts(istream& in, vtkIntArray* v, int n);
285 void ReadRestartFile();
286 void GetVariableAtTimestep(int vari, int tstep, vtkFloatArray* v);
287 void CreateVariableNames();
288 void GetTimeSteps();
289 void MakeTimeStepTable(int numberOfVariables);
290 void SetProjectName(const char* infile);
291 void MakeSPXTimeStepIndexTable(int nvars);
292 void CalculateMaxTimeStep();
293 void GetNumberOfVariablesInSPXFiles();
294 void FillVectorVariable(int xindex, int yindex, int zindex, vtkFloatArray* v);
295 void ConvertVectorFromCylindricalToCartesian(int xindex, int zindex);
296 void GetAllTimes(vtkInformationVector* outputVector);
297};
298
299#endif
Store on/off settings for data arrays, etc.
dynamic, self-adjusting array of double
dynamic, self-adjusting array of float
a cell that represents a linear 3D hexahedron
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
~vtkMFIXReader() override
const char * GetCellArrayName(int index)
Get the name of the cell array with the given index in the input.
vtkGetFilePathMacro(FileName)
Specify the file name of the MFIX Restart data file to read.
vtkIntArray * SPXToNVarTable
char DataBuffer[513]
vtkQuad * AQuad
vtkIntArray * Flag
vtkSetFilePathMacro(FileName)
Specify the file name of the MFIX Restart data file to read.
vtkHexahedron * AHexahedron
int GetNumberOfCellArrays(void)
Get the number of cell arrays available in the input.
void SetCellArrayStatus(const char *name, int status)
Get/Set whether the cell array with the given name is to be read.
int GetCellArrayStatus(const char *name)
Get/Set whether the cell array with the given name is to be read.
vtkUnstructuredGrid * Mesh
vtkIntArray * VariableToSkipTable
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkIntArray * SPXTimestepIndexTable
vtkDoubleArray * TempD
vtkDoubleArray * Dz
vtkIntArray * VariableTimestepTable
vtkWedge * AWedge
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkDoubleArray * Dx
vtkStringArray * VariableNames
vtkIntArray * VariableTimesteps
char CoordinateSystem[17]
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDataArraySelection * CellDataArraySelection
vtkIntArray * NMax
vtkIntArray * VariableComponents
vtkFloatArray ** CellDataArray
vtkDoubleArray * Dy
vtkIntArray * SpxFileExists
void EnableAllCellArrays()
Turn on/off all cell arrays.
vtkFloatArray * Maximum
vtkIntArray * VectorLength
char RunName[256]
static vtkMFIXReader * New()
vtkIntArray * VariableIndexToSPX
char Version[120]
vtkFloatArray * Minimum
void DisableAllCellArrays()
Turn on/off all cell arrays.
char FileExtension[15]
vtkPoints * Points
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:39
Wrapper around std::string to keep symbols short.
a vtkAbstractArray subclass for strings
dataset represents arbitrary combinations of all possible cell types
a 3D cell that represents a linear wedge
Definition vtkWedge.h:47
Write VTK XML UnstructuredGrid files.
#define max(a, b)