VTK  9.4.20250208
vtkMFIXReader.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
26#ifndef vtkMFIXReader_h
27#define vtkMFIXReader_h
28
29#include "vtkIOGeometryModule.h" // For export macro
31
32VTK_ABI_NAMESPACE_BEGIN
34class vtkDoubleArray;
35class vtkStringArray;
36class vtkIntArray;
37class vtkFloatArray;
39class vtkWedge;
40class vtkQuad;
41class vtkHexahedron;
42class vtkPoints;
43
44class VTKIOGEOMETRY_EXPORT vtkMFIXReader : public vtkUnstructuredGridAlgorithm
45{
46public:
47 static vtkMFIXReader* New();
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
52
58
60
64 vtkGetMacro(NumberOfCells, int);
66
68
72 vtkGetMacro(NumberOfPoints, int);
74
76
79 vtkGetMacro(NumberOfCellFields, int);
81
83
86 vtkSetMacro(TimeStep, int);
87 vtkGetMacro(TimeStep, int);
89
91
94 vtkGetMacro(NumberOfTimeSteps, int);
96
98
101 vtkGetVector2Macro(TimeStepRange, int);
102 vtkSetVector2Macro(TimeStepRange, int);
104
109
114 const char* GetCellArrayName(int index);
115
117
121 int GetCellArrayStatus(const char* name);
122 void SetCellArrayStatus(const char* name, int status);
124
126
132
136 void GetCellDataRange(int cellComp, float* min, float* max);
137
138protected:
140 ~vtkMFIXReader() override;
143
144 //
145 // ParaView Variables
146 //
147
148 char* FileName;
163 int TimeStepRange[2];
165
166 //
167 // MFIX Variables
168 //
169
170 vtkFloatArray** CellDataArray; // Arrays for variables that will
171 // attach to mesh
172 vtkPoints* Points; // Points array for building grid
173 vtkUnstructuredGrid* Mesh; // Unstructured Grid
174 vtkHexahedron* AHexahedron; // Hexahedron type cell
175 vtkWedge* AWedge; // Wedge type cell
176 vtkQuad* AQuad; // Quad type cell
177 vtkIntArray* Flag; // Cell Flag array
178 vtkDoubleArray* Dx; // Cell widths in x axis
179 vtkDoubleArray* Dy; // Cell widths in y axis
180 vtkDoubleArray* Dz; // Cell widths in z axis
181 vtkIntArray* NMax; // Array to hold number of species per phase
182 vtkDoubleArray* C; // Array used to parse restart file
183 vtkIntArray* TempI; // Array used to parse restart file
184 vtkDoubleArray* TempD; // Array used to parse restart file
185 vtkIntArray* SpxFileExists; // Array for keeping track of
186 // what spx files exist.
187
188 char FileExtension[15];
189 char DataBuffer[513];
190 char Version[120];
196 double Ce;
197 double Cf;
198 double Phi;
199 double PhiW;
200 double DeltaTime;
201 double XMinimum;
202 char RunName[256];
219 int MMAX;
221 double XLength;
222 double YLength;
223 double ZLength;
227 char CoordinateSystem[17];
228 char Units[17];
229
230 //
231 // SPX Variables
232 //
233
234 int MaximumTimestep; // maximum timesteps amongst the variables
235 int SPXRecordsPerTimestep; // number of records in a single
236 // timestep for a variable
237 vtkIntArray* SPXToNVarTable; // number of variables in each spx file
238 vtkIntArray* VariableToSkipTable; // skip value for each variable, this
239 // is needed in spx files
240 // with more than one variable.
241 vtkIntArray* VariableTimesteps; // number of timesteps for each variable
242 vtkIntArray* VariableTimestepTable; // Since the number of timesteps
243 // vary between variables
244 // this is a table that looks
245 // up the appropriate timestep
246 // for the particular variable.
247 vtkIntArray* variableIndexToSPX; // This gives the spx file number for the
248 // particular variable.
249 vtkIntArray* VariableIndexToSPX; // This gives the spx file number for the
250 // particular variable.
251 vtkIntArray* SPXTimestepIndexTable; // This a table look up for the index
252 // into a file for a certain variable.
253
254private:
255 vtkMFIXReader(const vtkMFIXReader&) = delete;
256 void operator=(const vtkMFIXReader&) = delete;
257
258 void MakeMesh(vtkUnstructuredGrid* output);
259 void SwapDouble(double& value);
260 void SwapFloat(float& value);
261 void SwapInt(int& value);
262 void GetInt(istream& in, int& val);
263 void GetDouble(istream& in, double& val);
264 void SkipBytes(istream& in, int n);
265 void RestartVersionNumber(const char* buffer);
266 void GetBlockOfDoubles(istream& in, vtkDoubleArray* v, int n);
267 void GetBlockOfFloats(istream& in, vtkFloatArray* v, int n);
268 void GetBlockOfInts(istream& in, vtkIntArray* v, int n);
269 void ReadRestartFile();
270 void GetVariableAtTimestep(int vari, int tstep, vtkFloatArray* v);
271 void CreateVariableNames();
272 void GetTimeSteps();
273 void MakeTimeStepTable(int numberOfVariables);
274 void SetProjectName(const char* infile);
275 void MakeSPXTimeStepIndexTable(int nvars);
276 void CalculateMaxTimeStep();
277 void GetNumberOfVariablesInSPXFiles();
278 void FillVectorVariable(int xindex, int yindex, int zindex, vtkFloatArray* v);
279 void ConvertVectorFromCylindricalToCartesian(int xindex, int zindex);
280 void GetAllTimes(vtkInformationVector* outputVector);
281};
282
283VTK_ABI_NAMESPACE_END
284#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:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
reads a dataset in MFIX file format
~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
vtkQuad * AQuad
vtkIntArray * Flag
vtkSetFilePathMacro(FileName)
Specify the file name of the MFIX Restart data file to read.
vtkHexahedron * AHexahedron
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
int GetNumberOfCellArrays()
Get the number of cell arrays available in the input.
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
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
static vtkMFIXReader * New()
vtkIntArray * VariableIndexToSPX
vtkFloatArray * Minimum
void DisableAllCellArrays()
Turn on/off all cell arrays.
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:139
a cell that represents a 2D quadrilateral
Definition vtkQuad.h:87
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:85
Write VTK XML UnstructuredGrid files.
#define max(a, b)